When passing a tuple to signing.dumps, I get a list back after calling signing.loads
>>> from django.core import signing
>>> a = signing.dumps(('a','b','c'))
>>> signing.loads(a)
['a', 'b', 'c']
I'd have expected it to behave the same as pickle:
>>> a = pickle.dumps(('a','b','c'))
>>> pickle.loads(a)
('a', 'b', 'c')
Change History
(4)
Component: |
Uncategorized → Core (Other)
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
changed from nobody to anonymous
|
Status: |
new → assigned
|
Owner: |
changed from anonymous to MattBlack
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Signing uses JSON to dump and load content, and there is no native distinction in JSON between lists and tuples. I don't know if we can/should do something to fix this, but accepting because it should at least be documented (https://docs.djangoproject.com/en/dev/topics/signing/#protecting-complex-data-structures).