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

minjson serializes single value tuples incorrectly #422

Closed
clofresh opened this issue Mar 25, 2013 · 2 comments
Closed

minjson serializes single value tuples incorrectly #422

clofresh opened this issue Mar 25, 2013 · 2 comments

Comments

@clofresh
Copy link
Contributor

>>> import minjson
>>> minjson.write(tuple(['a']))
'["a",]'

😿

This will affect anyone sending metrics with tags, doesn't have simplejson and is using python < 2.5. Basically CentOS 5 users.

Considering just bundling simplejson if possible, vs fixing a bug in an antiquated json library that probably has more bugs, or just casting tags from a tuple to a list, which does serialize correctly..

@olidb2
Copy link
Member

olidb2 commented Mar 25, 2013

I vote for casting tags into a list right before serializing.
(And this makes me cry too)

@clofresh
Copy link
Contributor Author

Forgot to mention that since having a trailing comma is invalid json, our intake rejects the whole payload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants