-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-37751: Fix normalizestring() with hyphens and spaces converted to underscores #15092
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
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Our records indicate we have not received your CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the check have been passed, so LGTM.
Would it be possible to reuse _Py_normalize_encoding() in codecs.c normalizestring()? |
I went through two functions and found that they do have similar functions. At the same time, I tried to modify the code and the test cases passed. The code can be modified just like 'check_force_ascii‘ calls ‘_Py_normalize_encoding‘ . And I think it's better to call _Py_normalize_encoding as an external function to other modules. There is also a process problem. I am not quite sure whether to submit another issue to discuss this modification, or can I directly modify it in this issue? |
I will do more test for reusing _Py_normalize_encoding() in codecs.c normalizestring(). Thank you for your helpful suggestions。 |
You can create a new PR, this one can be closed when the new one is merged. |
Let me try it. |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I think use a regular exception is better. Thanks. Co-Authored-By: Victor Stinner <vstinner@redhat.com>
Can you please try to add a NEWS entry using the blurb tool? (install it using: python3 -m pip install --user blurb) |
…into fix-issue-37751
Thank you for your careful guidance. I need to take a moment to familiarize myself with the blurb tool. |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
Misc/NEWS.d/next/Core and Builtins/2019-08-20-04-36-37.bpo-37751.CSFzUd.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the update.
Fix codecs.lookup() to normalize the encoding name the same way than encodings.normalize_encoding(), except that codecs.lookup() also converts the name to lower case.
Fix codecs.lookup() to normalize the encoding name the same way than encodings.normalize_encoding(), except that codecs.lookup() also converts the name to lower case.
Fix codecs.lookup() to normalize the encoding name the same way than encodings.normalize_encoding(), except that codecs.lookup() also converts the name to lower case.
* Fix running with Python 3.9 Since Python 3.9 [1], codecs names are normalized in a different way. [1] python/cpython#15092 * Add: github action, bump dependencies Co-authored-by: eight04 <eight04@gmail.com>
https://bugs.python.org/issue37751