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

Python 3.9 removed encoding from json.JSONDecoder #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Fmstrat
Copy link
Contributor

@Fmstrat Fmstrat commented Jan 14, 2022

Fix for #39

@@ -54,7 +54,7 @@ def __init__(self, fileObject=None):
else:
try:
self.textureData = json.load(
fileObject, encoding='utf-8', cls=TextureConfigDecoder)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably add "encoding='utf-8'" to the open call of fileObject. Otherwise the file encoding used will be platform dependent.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://stackoverflow.com/questions/66032031/why-was-the-keyword-argument-encoding-removed-from-json-loads-in-python-3-9

Looks like json.load will detect the encoding automatically, hence specifying the encoding explicitly is not needed

Copy link

@saurabhchatterjee23 saurabhchatterjee23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

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 this pull request may close these issues.

3 participants