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 socketpair
Recipients ezio.melotti, socketpair, vstinner
Date 2017-12-28.08:48:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1514450935.58.0.213398074469.issue32437@psf.upfronthosting.co.za>
In-reply-to
Content
First: This is the bug:

In [1]: 'großhandel-shop'.encode('idna')
Out[1]: b'grosshandel-shop'

This lead to this:

'xn--einla-pqa'.decode('idna')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/encodings/idna.py", line 214, in decode
    result.append(ToUnicode(label))
  File "/usr/lib/python3.6/encodings/idna.py", line 139, in ToUnicode
    raise UnicodeError("IDNA does not round-trip", label, label2)
UnicodeError: ('IDNA does not round-trip', b'xn--einla-pqa', b'einlass')


https://stackoverflow.com/questions/9806036/idna-does-not-round-trip


xn--grohandel-shop-2fb has been correctly encoded by IDNA 2008 (which is correct in Germany/DENIC since a while). Your Python very likely tries to decode it using the old IDNA 2003, which doesn't know 'ß'. see denic.de/en/know-how/idn-domains
History
Date User Action Args
2017-12-28 08:48:55socketpairsetrecipients: + socketpair, vstinner, ezio.melotti
2017-12-28 08:48:55socketpairsetmessageid: <1514450935.58.0.213398074469.issue32437@psf.upfronthosting.co.za>
2017-12-28 08:48:55socketpairlinkissue32437 messages
2017-12-28 08:48:54socketpaircreate