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

AttributeError: 'module' object has no attribute 'inf' #60

Closed
rqx110 opened this issue Nov 29, 2022 · 3 comments · Fixed by #61
Closed

AttributeError: 'module' object has no attribute 'inf' #60

rqx110 opened this issue Nov 29, 2022 · 3 comments · Fixed by #61

Comments

@rqx110
Copy link
Contributor

rqx110 commented Nov 29, 2022

Python 2.7.18

after upgrade to latest version v0.9.10,

import json5
import codecs

config = {"foo": 'bar'}
with codecs.open('config1.json', 'w', encoding='utf-8') as f:
    json5.dump(config, f, indent=4, quote_keys=True, trailing_commas=False, ensure_ascii=False)

an error occurred as title

@dpranke
Copy link
Owner

dpranke commented Dec 1, 2022

Whoops, sorry about that. v0.9.10 requires Python 3. I forgot to make that clear in the release notes. I will fix that soon.

@rqx110
Copy link
Contributor Author

rqx110 commented Dec 2, 2022

it looks like 0.9.9 is already requires Python 3. see 1f7f806

@dpranke
Copy link
Owner

dpranke commented Dec 2, 2022

Hmm. You might be right, I think I got that change confused with something else. Good news is that maybe I can go back to supporting Python 2.

I'll try to check on these things in the next day or two.

aarongable pushed a commit to chromium/chromium that referenced this issue Mar 17, 2023
There was one minor code change between these two versions --
[GitHub issue #60](dpranke/pyjson5#60) for
a Python2 compatibility fix -- and few changes to non-code files (README.md, setup.py, and ios-simulator.json).

Change-Id: I8516fbc6e2af82501da6b0671b142c3a212629d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4348412
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1118717}
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

Successfully merging a pull request may close this issue.

2 participants