Deepcopy on ErrorDict shows unexpected duplicates
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?
Change History
(9)
Component: |
Uncategorized → Forms
|
Severity: |
Normal → Release blocker
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
changed from nobody to Tim Graham
|
Status: |
new → assigned
|
Cc: |
Loic Bistuer added
|
Has patch: |
set
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Seems to be a regression from 1.6.