gh-85287: Convert UnicodeError to UnicodeEncodeError| UnicodeDecodeError #21165
Closed
srinivasreddy wants to merge 4 commits intopython:mainfrom
srinivasreddy:bpo-41115
Closed
gh-85287: Convert UnicodeError to UnicodeEncodeError| UnicodeDecodeError #21165srinivasreddy wants to merge 4 commits intopython:mainfrom srinivasreddy:bpo-41115
srinivasreddy wants to merge 4 commits intopython:mainfrom
srinivasreddy:bpo-41115
Conversation
…rror in idna.py, utf_16.py, utf_32.py, punycode.py, undefined.py modules.
eamanu
reviewed
Jun 26, 2020
| @@ -1,4 +1,4 @@ | |||
| """ Codec for the Punicode encoding, as specified in RFC 3492 | |||
| """ Codec for the Punycode encoding, as specified in RFC 3492 | |||
Contributor
Author
|
@pitrou Please review! |
Contributor
|
The patch get the offsets in the exception object wrong for all non-trivial cases. For example the following case: >>> s = 'foo.' + 60*'\xff'
>>> s.encode('idna')gives the stack trace: However the bad characters are not Fixing this would require to track the correct offset across multiple function calls. I'm not sure whether that added complexity is justified. |
Member
|
A review by @doerwalter hasn't been being addressed for three years and the OP blocked their branch from external pushes thus preventing us from applying all necessary fixes by ourselves. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://bugs.python.org/issue41115