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

bpo-37751: Document the change in What's New in Python 3.9 #17997

Open
wants to merge 1 commit into
base: master
from

Conversation

@vstinner
Copy link
Member

vstinner commented Jan 14, 2020

@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Jan 14, 2020

@vstinner vstinner force-pushed the vstinner:codecs_whatsnew38 branch from a4c037e to 7bfe9b2 Jan 14, 2020
@vstinner vstinner changed the title bpo-37751: Document the change in What's New in Python 3.8 bpo-37751: Document the change in What's New in Python 3.9 Jan 14, 2020
@vstinner

This comment has been minimized.

Copy link
Member Author

vstinner commented Jan 14, 2020

Oops, the change was done in Python 3.9, not in Python 3.8! PR updated.

Copy link
Member

corona10 left a comment

lgtm

@@ -439,6 +439,12 @@ Changes in the Python API
:data:`~errno.EBADF` error.
(Contributed by Victor Stinner in :issue:`39239`.)

* :func:`codecs.lookup` now normalizes the encoding name the same way than

This comment has been minimized.

Copy link
@serhiy-storchaka

serhiy-storchaka Jan 14, 2020

Member

There are other differences. For example, normalize_encoding("КОИ-8") returns "кои_8", but codecs.lookup normalizes it to "8".

The comment in the sources is also not correct.

This comment has been minimized.

Copy link
@vstinner

vstinner Jan 14, 2020

Author Member

encodings.normalize_encoding() says "Note that encoding names should be ASCII only." You're correct: "КОИ-8" is normalized to "8" by codecs.lookup() because the C function _Py_normalize_encoding() ignores non-ASCII letters.

I don't know which behavior is correct. It sounds strange to me to have a non-ASCII encoding name. Which encoding is supposed to be used to encoding the encoding name?!? :-D Maybe encodings.normalize_encoding() should also ignore non-ASCII letters, be more strict.

This comment has been minimized.

Copy link
@vstinner

vstinner Jan 14, 2020

Author Member

I created bpo-39337: codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them.

@@ -439,6 +439,12 @@ Changes in the Python API
:data:`~errno.EBADF` error.
(Contributed by Victor Stinner in :issue:`39239`.)

* :func:`codecs.lookup` now normalizes the encoding name the same way than

This comment has been minimized.

Copy link
@encukou

encukou Jan 14, 2020

Member
Suggested change
* :func:`codecs.lookup` now normalizes the encoding name the same way than
* :func:`codecs.lookup` now normalizes the encoding name the same way as

This comment has been minimized.

Copy link
@vstinner

vstinner Jan 14, 2020

Author Member

Oh. I copied the NEWS entry from commit 20f59fe. If there is a typo, it should also be fixed in Misc/NEWS.d/next/Core and Builtins/2019-08-20-04-36-37.bpo-37751.CSFzUd.rst.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.