-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
json.loads encoding parameter deprecation removal in Python 3.9 #83558
Comments
This is a followup of bpo-33461. The warning says about removal of the encoding parameter in 3.9 . It's already ignored since 3.1 hence I assume this should be raising a TypeError in 3.9 removing the deprecation warning. I am finding some projects using the encoding parameter though it has no effect. Since Python 3.9 has alpha 3 to be released it will be good to fix the deprecation in the early stage of release cycle. |
Should we be raising an error if encoding is present on 3.9 as part of kwargs? It's obtrusive but for people going from Python 3.7 to 3.9 there will be no change and they will keep assuming encoding parameter is valid. |
Do you mean to say we should or shouldn't be raising an error? With Inada-san's change you get this: >>> json.loads("true", encoding='utf8')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\ammar\workspace\cpython\lib\json\__init__.py", line 359, in loads
return cls(**kw).decode(s)
TypeError: __init__() got an unexpected keyword argument 'encoding' |
If this broke some real-world software and the pain is high enough, we can revert the change and add one more deprecation period, like all other removals. |
Sorry, I misread the patch as only removal and didn't test the change completely. I am filing issues on code that I can find using this pattern and will wait for the feedback during alpha cycle.
|
I reopen the issue.
Would you mind to document the removal in the following doc section? |
Please update the documentation which still mentions the encoding parameter. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: