#23594: Deepcopy on ErrorDict shows unexpected duplicates
-------------------------------+--------------------
Reporter: troygrosfield | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Using python 3.4, django 1.7, you'll see the following error when
deepcopying ErrorDicts:
{{{
$ python
Python 3.4.1 (default, Aug 24 2014, 21:32:40)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from copy import deepcopy
>>> from django.forms.utils import ErrorList
>>> from django.forms.utils import ErrorDict
>>>
>>>
>>> ed = ErrorDict()
>>> ed['__all__'] = ErrorList(['first thing'])
>>> ed
{'__all__': ['first thing']}
>>> ed_copy = deepcopy(ed)
>>> ed_copy
{'__all__': ['first thing', 'first thing']} # <-- what happened here?
why is "first thing" listed twice?
>>> len(ed['__all__']) == len(ed_copy['__all__'])
False
}}}
Why did "first thing" get copied twice?
--
Ticket URL: <https://code.djangoproject.com/ticket/23594>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/056.0b6959f408d5d15b000557daf80fdf27%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.