-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them #83518
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
Comments
bpo-37751 changed codecs.lookup() in a subtle way: non-ASCII characters are now ignored, whereas they were copied unmodified previously. I would prefer that codecs.lookup() and encodings.normalize_encoding() behave the same. Either always ignore or always copy. Moreover, it seems like there is no test on how the encoding names are normalized in codecs.register(). I recall that using codecs.register() in an unit test causes troubles since there is no API to unregister a search function. Maybe we should just add a private function for test in _testcapi. Serhiy Storchaka wrote an example on my PR:
|
How about calling
I can try to add some test cases in next weekend ;) |
I have try this idea, but it make the testcase of test_io.py failed because some object will call
I try to add a For example: In master: after PR18987: |
Oh, there have a problem with this idea: |
Use _testinternalcapi in this case. |
|
Thanks Hai Shi for the change and for new codecs and encodings tests. |
Thanks for everyone's continus review :) |
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: