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

PyonObject.dump fails for xml when path has numbers #4

Open
dapryor opened this issue Jul 21, 2019 · 2 comments
Open

PyonObject.dump fails for xml when path has numbers #4

dapryor opened this issue Jul 21, 2019 · 2 comments

Comments

@dapryor
Copy link
Contributor

dapryor commented Jul 21, 2019

import pyon
p = pyon.PyonObject("/test/123")
p.dump(output_format='xml')

AttributeError: 'int' object has no attribute 'isdigit'```
@lagmoellertim
Copy link
Owner

Hey, I'm currently looking to change the xml conversion library, since it has many other bugs that makes it pretty much unusable for many cases. If you know a library which also includes custom attributes, feel free to recommend one.

@dapryor
Copy link
Contributor Author

dapryor commented Jul 21, 2019

looks like neither the json module nor the dicttoxml module support intergers as keynames:

Example:

json.loads('{"hey": {123: "hey"}}')

json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 10 (char 9)

Found this issue on the dicttoxml page: quandyfactory/dicttoxml#61

Maybe it would be better to mimic the way these two modules work and convert integers to strings before adding them as keys?

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