Prevent `dict changed during iteration` in video
authorBoris Bobrov <breton@cynicmansion.ru>
Fri, 5 Feb 2016 01:32:19 +0000 (04:32 +0300)
committerBoris Bobrov <breton@cynicmansion.ru>
Fri, 5 Feb 2016 01:32:19 +0000 (04:32 +0300)
mediagoblin/media_types/video/processing.py

index 0cdfbdceeab1b00b7fccb8076625349032ff495c..ca3087a2c399564cf2f2f18557dee6d76c9fde83 100644 (file)
@@ -110,7 +110,7 @@ def get_tags(stream_info):
             dt.get_year(), dt.get_month(), dt.get_day(), dt.get_hour(),
             dt.get_minute(), dt.get_second(),
             dt.get_microsecond()).isoformat()
-    for k, v in tags.items():
+    for k, v in tags.copy().items():
         # types below are accepted by json; others must not present
         if not isinstance(v, (dict, list, six.string_types, int, float, bool,
                               type(None))):