Issue39377
Created on 2020-01-18 05:27 by xtreak, last changed 2020-01-22 10:22 by methane. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 18075 | merged | methane, 2020-01-20 04:02 | |
| PR 18076 | merged | methane, 2020-01-20 05:07 | |
| Messages (9) | |||
|---|---|---|---|
| msg360235 - (view) | Author: Karthikeyan Singaravelan (xtreak) * | Date: 2020-01-18 05:27 | |
This is a followup of issue33461. 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. |
|||
| msg360289 - (view) | Author: Inada Naoki (methane) * | Date: 2020-01-20 04:54 | |
New changeset 5492bfcefec67b016e8239c0e9135bc2f03e3058 by Inada Naoki in branch 'master': bpo-39377: json: Remove the encoding option. (GH-18075) https://github.com/python/cpython/commit/5492bfcefec67b016e8239c0e9135bc2f03e3058 |
|||
| msg360291 - (view) | Author: Karthikeyan Singaravelan (xtreak) * | Date: 2020-01-20 05:36 | |
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. |
|||
| msg360292 - (view) | Author: Ammar Askar (ammar2) * | Date: 2020-01-20 06:08 | |
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'
|
|||
| msg360293 - (view) | Author: Inada Naoki (methane) * | Date: 2020-01-20 06:24 | |
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. |
|||
| msg360294 - (view) | Author: Karthikeyan Singaravelan (xtreak) * | Date: 2020-01-20 07:50 | |
> Do you mean to say we should or shouldn't be raising an error? With Inada-san's change you get this: 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. * https://github.com/ansible/ansible/issues/66592 * https://github.com/jupyter/notebook/issues/5165 * https://github.com/django-extensions/django-extensions/issues/1465 |
|||
| msg360295 - (view) | Author: STINNER Victor (vstinner) * | Date: 2020-01-20 07:54 | |
I reopen the issue. > New changeset 5492bfcefec67b016e8239c0e9135bc2f03e3058 by Inada Naoki in branch 'master': > bpo-39377: json: Remove the encoding option. (GH-18075) > https://github.com/python/cpython/commit/5492bfcefec67b016e8239c0e9135bc2f03e3058 Would you mind to document the removal in the following doc section? https://docs.python.org/dev/whatsnew/3.9.html#removed |
|||
| msg360296 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2020-01-20 08:13 | |
Please update the documentation which still mentions the encoding parameter. |
|||
| msg360457 - (view) | Author: Inada Naoki (methane) * | Date: 2020-01-22 10:01 | |
New changeset 5bbac8cbdf140ebce446ea4e7db2b20a5d7b8402 by Inada Naoki in branch 'master': bpo-39377: json: Update doc about the encoding option. (GH-18076) https://github.com/python/cpython/commit/5bbac8cbdf140ebce446ea4e7db2b20a5d7b8402 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-01-22 10:22:24 | methane | set | status: open -> closed resolution: fixed |
| 2020-01-22 10:01:48 | methane | set | messages: + msg360457 |
| 2020-01-20 08:13:05 | serhiy.storchaka | set | messages: + msg360296 |
| 2020-01-20 07:54:32 | vstinner | set | status: closed -> open resolution: fixed -> (no value) messages: + msg360295 |
| 2020-01-20 07:50:35 | xtreak | set | messages: + msg360294 |
| 2020-01-20 06:24:18 | methane | set | messages: + msg360293 |
| 2020-01-20 06:08:56 | ammar2 | set | nosy:
+ ammar2 messages: + msg360292 |
| 2020-01-20 05:36:14 | xtreak | set | messages: + msg360291 |
| 2020-01-20 05:07:43 | methane | set | pull_requests: + pull_request17469 |
| 2020-01-20 04:54:18 | methane | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020-01-20 04:54:08 | methane | set | messages: + msg360289 |
| 2020-01-20 04:02:20 | methane | set | keywords:
+ patch stage: patch review pull_requests: + pull_request17468 |
| 2020-01-18 05:27:40 | xtreak | create | |