Irit Katriel added the comment:
Reproduced on 3.11:
Traceback (most recent call last):
File "/Users/iritkatriel/src/cpython-1/Lib/encodings/idna.py", line 165, in
encode
raise UnicodeError("label empty or too long")
^
UnicodeError: label
Mike Milkin added the comment:
Moved the conditional logic out of the method. There are no tests for ToASCII
function and I was not comfortable making changes to it without adding tests.
--
Added file: http://bugs.python.org/file30139/Issue9682-5513.patch
Mike Milkin added the comment:
Dave, let me know what you think of the tests, ill fix the rest of your
comments.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
___
R. David Murray added the comment:
As I said in the review, thanks for working more on this.
For the reason for (3), look at the test just before the ones you added.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
Mike Milkin added the comment:
There are a few of interesting parts.
1.) I noticed that the ToASCII class is not tested.
2.) I had some unreachable branches due to concatenation of constant variable
ace_prefix.
3) I also found it weird that we only check the max of labels[-1], but decided
Changes by Mike Milkin mmil...@gmail.com:
Removed file: http://bugs.python.org/file29850/Issue9682-full.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
___
Changes by Mike Milkin mmil...@gmail.com:
Removed file: http://bugs.python.org/file29984/Issue9682.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
___
Changes by Mike Milkin mmil...@gmail.com:
Added file: http://bugs.python.org/file29985/Issue9682-42213.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
___
Mike Milkin added the comment:
Sure ill modify the patch, thanks for the feedback.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
___
___
R. David Murray added the comment:
The message in both branches of the if talk about empty labels, which is
probably my fault since I got the sense of the if wrong in my suggestion. One
of them should be about the label being too long. The one that should be the
'empty' message also doesn't
Mike Milkin added the comment:
I did not mean to take the decode out of the previos patch. Sorry for the spam.
--
Added file: http://bugs.python.org/file29850/Issue9682-full.patch
___
Python tracker rep...@bugs.python.org
Changes by Mike Milkin mmil...@gmail.com:
Removed file: http://bugs.python.org/file29834/Issue9682-full.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
___
Mike Milkin added the comment:
This patch adds better exception messages.
If any label other then the last is empty or is too long the request is added
to the exception message.
If the last label is over 64, the label is added to the exception message
--
keywords: +patch
nosy:
R. David Murray added the comment:
Thanks, Mike. I made some review comments (you should have gotten an email, or
look at them via the 'review' link on the patch).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
Mike Milkin added the comment:
Made changes to to the tests and made changes to the error messages.
I think decode() is valid since the input is already ascii encoded.
--
Added file: http://bugs.python.org/file29834/Issue9682-full.patch
___
Python
Changes by Georg Brandl ge...@python.org:
--
assignee: - loewis
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
___
___
Python-bugs-list
Changes by Giampaolo Rodola' g.rod...@gmail.com:
--
nosy: +giampaolo.rodola
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9682
___
___
Martin v. Löwis mar...@v.loewis.de added the comment:
why is it a UnicodeError?
Because IDNA is an encoding, and codecs are supposed to raise UnicodeErrors.
The string you are trying to encode is not supported in the encoding in
question.
It would be possible to catch the UnicodeError, and
R. David Murray rdmur...@bitdance.com added the comment:
Ah, I wondered if it was something like that (encoding=UnicodeError). It's
not really a *unicode* error, it's a syntax error in the domain name
construction (ie: it is invalid whether or not unicode is involved, it just
isn't caught in
Martin v. Löwis mar...@v.loewis.de added the comment:
Ah, I wondered if it was something like that
(encoding=UnicodeError). It's not really a *unicode* error, it's a
syntax error in the domain name construction (ie: it is invalid
whether or not unicode is involved, it just isn't caught in
20 matches
Mail list logo