[issue21103] Encoding str to IDNA with ellipsis decomposes to empty labels

Christopher Foo report at bugs.python.org
Sun Mar 30 19:57:53 CEST 2014


New submission from Christopher Foo:

When encoding a string with the IDNA codec I expected that it will always raise an exception with empty labels. When I do this

    >>> 'example.c…'.encode('idna').decode('ascii')

it returns

    'example.c...'

instead of raising UnicodeError. The original string ends with U+2026 HORIZONTAL ELLIPSIS if you can't see it clearly. These strings are coming from web pages in a web crawler.

I tested this on Python 3.4, 3.3.2, 2.7.5, 2.6.9.

----------
components: Library (Lib)
messages: 215189
nosy: chfoo
priority: normal
severity: normal
status: open
title: Encoding str to IDNA with ellipsis decomposes to empty labels
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21103>
_______________________________________


More information about the Python-bugs-list mailing list