Perfect your code
With built-in code review tools, GitHub makes it easy to raise the quality bar before you ship. Join the 40 million developers who've merged over 200 million pull requests.
Sign up for free See pricing for teams and enterprisesbpo-19083: IDNA prefix should be case insensitive #17726
+10
−3
Conversation
Any capitalization of "xn--" should be acceptable for the ACE prefix (see https://tools.ietf.org/html/rfc3490#section-5). Co-Authored-By: Pepijn de Vos <pepijndevos@gmail.com>
This comment has been minimized.
This comment has been minimized.
|
I plan on adding a news entry. |
|
Looks good to me :) |
| @@ -121,7 +121,7 @@ def ToUnicode(label): | |||
| except UnicodeError: | |||
| raise UnicodeError("Invalid character in IDN label") | |||
| # Step 3: Check for ACE prefix | |||
| if not label.startswith(ace_prefix): | |||
| if not label.lower().startswith(ace_prefix): | |||
This comment has been minimized.
This comment has been minimized.
asvetlov
Dec 29, 2019
Contributor
The change is memory and CPU expensive; explicit check for first 3 characters could be much better I believe.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


ZackerySpytz commentedDec 28, 2019
•
edited by bedevere-bot
Any capitalization of "xn--" should be acceptable for the ACE prefix
(see https://tools.ietf.org/html/rfc3490#section-5).
Co-Authored-By: Pepijn de Vos pepijndevos@gmail.com
https://bugs.python.org/issue19083