This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rschiron
Recipients benjamin.peterson, ezio.melotti, hokousya, larry, lukasz.langa, miss-islington, ned.deily, orsenthil, rschiron, steve.dower, vstinner, xtreak
Date 2019-06-07.17:59:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559930357.74.0.640852548427.issue36742@roundup.psfhosted.org>
In-reply-to
Content
The fix for python-2.7 (https://github.com/python/cpython/pull/13815/files#diff-b577545d73dd0cdb2c337a4c5f89e1d7R183) causes errors when netloc contains characters that can't be encoded by 'ascii' codec.

You can see it by doing:
>>> netloc = u'example.com\uFF03@bing.com'
>>> raise ValueError(u"netloc '" + netloc + u"' contains invalid characters under NFKC normalization")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: <exception str() failed>
>>> str(netloc)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\uff03' in position 11: ordinal not in range(128)

I suggest we use `repr(netloc)` instead of `netloc` in the ValueError message.
History
Date User Action Args
2019-06-07 17:59:17rschironsetrecipients: + rschiron, orsenthil, vstinner, larry, benjamin.peterson, ned.deily, ezio.melotti, lukasz.langa, steve.dower, miss-islington, xtreak, hokousya
2019-06-07 17:59:17rschironsetmessageid: <1559930357.74.0.640852548427.issue36742@roundup.psfhosted.org>
2019-06-07 17:59:17rschironlinkissue36742 messages
2019-06-07 17:59:17rschironcreate