Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dictionary payload with numeric keys become strings #67

Closed
baubie opened this issue Aug 3, 2016 · 2 comments
Closed

Dictionary payload with numeric keys become strings #67

baubie opened this issue Aug 3, 2016 · 2 comments

Comments

@baubie
Copy link

baubie commented Aug 3, 2016

Happens using Serializer and URLSafeSerializer:

>>> s.loads(s.dumps({1: 2}))
{'1': 2}

I don't think this should be intended behaviour -- using version 0.24 with Python 3.5.

@ThiefMaster
Copy link
Member

ThiefMaster commented Aug 3, 2016 via email

@davidism
Copy link
Member

davidism commented Aug 3, 2016

You can use a different internal serializer, such as custom JSON that converts a dict to a list of key, value pairs, or YAML. Pass serializer= when instantiating the serializer (confusingly named, yes). https://pythonhosted.org/itsdangerous/#itsdangerous.Serializer This isn't something that will be changed in the library though.

@davidism davidism closed this as completed Aug 3, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants