Fixed "RuntimeError: dictionary changed size during iteration" exception while updating upload progress

This commit is contained in:
Micah Lee 2018-05-20 14:05:34 -07:00
parent d6ce902eb6
commit 451e07269f
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -128,7 +128,8 @@ class Upload(QtWidgets.QWidget):
self.common.human_readable_filesize(total_uploaded_bytes),
estimated_time_remaining)
for filename in progress:
# Using list(progress) to avoid "RuntimeError: dictionary changed size during iteration"
for filename in list(progress):
# Add a new file if needed
if filename not in self.files:
self.files[filename] = File(self.common, filename)