GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-37751: Fix normalizestring() with hyphens and spaces converted to underscores by fusioncid · Pull Request #15092 · python/cpython

Conversation

@fusioncid

@fusioncid fusioncid commented Aug 3, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Fix normalizestring() with hyphens and spaces converted to underscores
  • Reuse _Py_normalize_encoding() in normalizestring()

https://bugs.python.org/issue37751

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fusioncid
bpo-37751:Fix normalizestring() with hyphens and spaces converted to …
95c6408
…underscores
@the-knights-who-say-ni

the-knights-who-say-ni commented Aug 3, 2019

Copy link
Copy Markdown

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
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@the-knights-who-say-ni the-knights-who-say-ni added the CLA not signed label Aug 3, 2019
@bedevere-bot bedevere-bot added the awaiting review label Aug 3, 2019
shihai1991
shihai1991 approved these changes Aug 3, 2019
View reviewed changes

@shihai1991 shihai1991 left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Aug 3, 2019
@the-knights-who-say-ni the-knights-who-say-ni added CLA signed and removed CLA not signed labels Aug 5, 2019
@vstinner

vstinner commented Aug 12, 2019

Copy link
Copy Markdown
Member

Would it be possible to reuse _Py_normalize_encoding() in codecs.c normalizestring()?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fusioncid

fusioncid commented Aug 14, 2019

Copy link
Copy Markdown
Contributor Author

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fusioncid

fusioncid commented Aug 14, 2019

Copy link
Copy Markdown
Contributor Author

Would it be possible to reuse _Py_normalize_encoding() in codecs.c normalizestring()?

I will do more test for reusing _Py_normalize_encoding() in codecs.c normalizestring(). Thank you for your helpful suggestions。

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Aug 14, 2019

Copy link
Copy Markdown
Member

You can create a new PR, this one can be closed when the new one is merged.

shihai1991 and fusioncid reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fusioncid

fusioncid commented Aug 15, 2019

Copy link
Copy Markdown
Contributor Author

You can create a new PR, this one can be closed when the new one is merged.

Let me try it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fusioncid and others added 3 commits August 17, 2019 18:54
@fusioncid
bpo-37751:Fix normalizestring() with hyphens and spaces converted to …
e7eafdb
…underscores
@fusioncid
bpo-37751:Fix normalizestring() with hyphens and spaces converted to …
ba5138f
…underscores
@fusioncid
delete cscope.out
f3eb230
@fusioncid fusioncid changed the title bpo-37751: Fix normalizestring() with hyphens and spaces converted to… bpo-37751: Fix normalizestring() with hyphens and spaces converted to underscores Aug 17, 2019
vstinner
vstinner requested changes Aug 19, 2019
View reviewed changes
Comment thread Python/codecs.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/codecs.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/codecs.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting core review label Aug 19, 2019
@bedevere-bot

bedevere-bot commented Aug 19, 2019

Copy link
Copy Markdown

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 have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added the awaiting changes label Aug 19, 2019
@fusioncid @vstinner
Update Python/codecs.c
e51724b
I think use a regular exception is better. Thanks.

Co-Authored-By: Victor Stinner <[email protected]>
@vstinner

vstinner commented Aug 19, 2019

Copy link
Copy Markdown
Member

Can you please try to add a NEWS entry using the blurb tool? (install it using: python3 -m pip install --user blurb)

fusioncid reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fusioncid added 2 commits August 19, 2019 21:14
@fusioncid
bpo-37751:Fix normalizestring() with hyphens and spaces converted to …
05eb71f
…underscores
@fusioncid
Merge branch 'fix-issue-37751' of https://github.com/qigangxu/cpython …
07b500d
…into fix-issue-37751
@fusioncid

fusioncid commented Aug 19, 2019

Copy link
Copy Markdown
Contributor Author

Can you please try to add a NEWS entry using the blurb tool? (install it using: python3 -m pip install --user blurb)

Thank you for your careful guidance. I need to take a moment to familiarize myself with the blurb tool.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@blurb-it
📜🤖 Added by blurb_it.
2396200
@fusioncid

fusioncid commented Aug 20, 2019

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting changes label Aug 20, 2019
@bedevere-bot

bedevere-bot commented Aug 20, 2019

Copy link
Copy Markdown

Thanks for making the requested changes!

@vstinner: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added the awaiting change review label Aug 20, 2019
vstinner
vstinner reviewed Aug 20, 2019
View reviewed changes
Comment thread Misc/NEWS.d/next/Core and Builtins/2019-08-20-04-36-37.bpo-37751.CSFzUd.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@fusioncid
bpo-37751: Optimize NEWS.d doc for normalizestring() fixing
6178176
vstinner
vstinner approved these changes Aug 21, 2019
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting change review labels Aug 21, 2019
@vstinner
vstinner merged commit 20f59fe into python:master Aug 21, 2019
@bedevere-bot bedevere-bot removed the awaiting merge label Aug 21, 2019
@fusioncid
fusioncid deleted the fix-issue-37751 branch August 21, 2019 14:24
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
@fusioncid @lisroach
bpo-37751: Fix codecs.lookup() normalization (pythonGH-15092)
74447e6
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.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
@fusioncid @DinoV
bpo-37751: Fix codecs.lookup() normalization (pythonGH-15092)
49d58a2
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.
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
@fusioncid @websurfer5
bpo-37751: Fix codecs.lookup() normalization (pythonGH-15092)
22de191
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.
@yan12125 yan12125 mentioned this pull request Dec 2, 2020
Fix running with Python 3.9 eight04/pyUAO#1
Merged
eight04 added a commit to eight04/pyUAO that referenced this pull request Feb 22, 2021
Chih-Hsuan Yen @eight04
Add: support Python 3.9 (#1)
68a8f54
* 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 <[email protected]>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jul 28, 2025
@serhiy-storchaka
pythongh-88886: Remove excessive encoding name normalization
02ae0e1
The codecs lookup function now performs only minimal normalization of
the encoding name before passing it to the serach functions:
all ASCII letters are converted to lower case, spaces are replaced
with hyphens.

Excessive normalization broke third-party codecs providers, like
python-iconv.

Revert "bpo-37751: Fix codecs.lookup() normalization (pythonGH-15092)"

This reverts commit 20f59fe.
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jul 28, 2025
@serhiy-storchaka
pythongh-88886: Remove excessive encoding name normalization
2df6169
The codecs lookup function now performs only minimal normalization of
the encoding name before passing it to the search functions:
all ASCII letters are converted to lower case, spaces are replaced
with hyphens.

Excessive normalization broke third-party codecs providers, like
python-iconv.

Revert "bpo-37751: Fix codecs.lookup() normalization (pythonGH-15092)"

This reverts commit 20f59fe.
@serhiy-storchaka serhiy-storchaka mentioned this pull request Jul 28, 2025
gh-88886: Remove excessive encoding name normalization #137167
Merged
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jul 28, 2025
@serhiy-storchaka
pythongh-88886: Remove excessive encoding name normalization
ae1cae2
The codecs lookup function now performs only minimal normalization of
the encoding name before passing it to the search functions:
all ASCII letters are converted to lower case, spaces are replaced
with hyphens.

Excessive normalization broke third-party codecs providers, like
python-iconv.

Revert "bpo-37751: Fix codecs.lookup() normalization (pythonGH-15092)"

This reverts commit 20f59fe.
serhiy-storchaka added a commit that referenced this pull request Sep 9, 2025
@serhiy-storchaka
gh-88886: Remove excessive encoding name normalization (GH-137167)
af58a6f
The codecs lookup function now performs only minimal normalization of
the encoding name before passing it to the search functions:
all ASCII letters are converted to lower case, spaces are replaced
with hyphens.

Excessive normalization broke third-party codecs providers, like
python-iconv.

Revert "bpo-37751: Fix codecs.lookup() normalization (GH-15092)"

This reverts commit 20f59fe.
lkollar pushed a commit to lkollar/cpython that referenced this pull request Sep 9, 2025
@serhiy-storchaka @lkollar
pythongh-88886: Remove excessive encoding name normalization (pythonG…
0a3e79b
…H-137167)

The codecs lookup function now performs only minimal normalization of
the encoding name before passing it to the search functions:
all ASCII letters are converted to lower case, spaces are replaced
with hyphens.

Excessive normalization broke third-party codecs providers, like
python-iconv.

Revert "bpo-37751: Fix codecs.lookup() normalization (pythonGH-15092)"

This reverts commit 20f59fe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@shihai1991 shihai1991 shihai1991 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@fusioncid @the-knights-who-say-ni @vstinner @bedevere-bot @shihai1991
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.