From: Boris Bobrov Date: Fri, 5 Feb 2016 01:32:19 +0000 (+0300) Subject: Prevent `dict changed during iteration` in video X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f13225fa6dc2b4537300e5bed4b587619de9cf26;p=mediagoblin.git Prevent `dict changed during iteration` in video --- diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py index 0cdfbdce..ca3087a2 100644 --- a/mediagoblin/media_types/video/processing.py +++ b/mediagoblin/media_types/video/processing.py @@ -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))):