Browse Source

Update contrib/python/idna/py3 to 3.6

robot-contrib 1 year ago
parent
commit
f882cdce88

+ 1 - 3
contrib/python/idna/py2/tests/ya.make

@@ -4,9 +4,6 @@ PEERDIR(
     contrib/python/idna
 )
 
-ENV(LC_ALL=ru_RU.UTF-8)
-ENV(LANG=ru_RU.UTF-8)
-
 TEST_SRCS(
     test_idna_compat.py
     test_idna.py
@@ -17,6 +14,7 @@ TEST_SRCS(
 )
 
 NO_LINT()
+
 FORK_SUBTESTS()
 
 END()

+ 12 - 11
contrib/python/idna/py3/.dist-info/METADATA

@@ -1,8 +1,8 @@
 Metadata-Version: 2.1
 Name: idna
-Version: 3.4
+Version: 3.6
 Summary: Internationalized Domain Names in Applications (IDNA)
-Author-email: Kim Davies <kim@cynosure.com.au>
+Author-email: Kim Davies <kim+pypi@gumleaf.org>
 Requires-Python: >=3.5
 Description-Content-Type: text/x-rst
 Classifier: Development Status :: 5 - Production/Stable
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: Python :: 3.10
 Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Internet :: Name Service (DNS)
@@ -88,9 +89,9 @@ You may use the codec encoding and decoding methods using the
 .. code-block:: pycon
 
     >>> import idna.codec
-    >>> print('домен.испытание'.encode('idna'))
+    >>> print('домен.испытание'.encode('idna2008'))
     b'xn--d1acufc.xn--80akhbyknj4f'
-    >>> print(b'xn--d1acufc.xn--80akhbyknj4f'.decode('idna'))
+    >>> print(b'xn--d1acufc.xn--80akhbyknj4f'.decode('idna2008'))
     домен.испытание
 
 Conversions can be applied at a per-label basis using the ``ulabel`` or
@@ -110,7 +111,7 @@ ways a user may input a domain name. This functionality, known as
 a “mapping”, is considered by the specification to be a local
 user-interface issue distinct from IDNA conversion functionality.
 
-This library provides one such mapping, that was developed by the
+This library provides one such mapping that was developed by the
 Unicode Consortium. Known as `Unicode IDNA Compatibility Processing
 <https://unicode.org/reports/tr46/>`_, it provides for both a regular
 mapping for typical applications, as well as a transitional mapping to
@@ -143,7 +144,7 @@ IDNA specification this conversion is not performed.
     >>> idna.encode('Königsgäßchen', uts46=True, transitional=True)
     'xn--knigsgsschen-lcb0w'
 
-Implementors should use transitional processing with caution, only in
+Implementers should use transitional processing with caution, only in
 rare cases where conversion from legacy labels to current labels must be
 performed (i.e. IDNA implementations that pre-date 2008). For typical
 applications that just need to convert labels, transitional processing
@@ -186,8 +187,8 @@ and perform the required calculations to identify eligibility. There are
 three main modes:
 
 * ``idna-data make-libdata``. Generates ``idnadata.py`` and
-  ``uts46data.py``, the pre-calculated lookup tables using for IDNA and
-  UTS 46 conversions. Implementors who wish to track this library against
+  ``uts46data.py``, the pre-calculated lookup tables used for IDNA and
+  UTS 46 conversions. Implementers who wish to track this library against
   a different Unicode version may use this tool to manually generate a
   different version of the ``idnadata.py`` and ``uts46data.py`` files.
 
@@ -203,7 +204,7 @@ three main modes:
 
 The tool accepts a number of arguments, described using ``idna-data
 -h``. Most notably, the ``--version`` argument allows the specification
-of the version of Unicode to use in computing the table data. For
+of the version of Unicode to be used in computing the table data. For
 example, ``idna-data --version 9.0.0 make-libdata`` will generate
 library data against Unicode 9.0.0.
 
@@ -217,7 +218,7 @@ Additional Notes
 * **Version support**. This library supports Python 3.5 and higher.
   As this library serves as a low-level toolkit for a variety of
   applications, many of which strive for broad compatibility with older
-  Python versions, there is no rush to remove older intepreter support.
+  Python versions, there is no rush to remove older interpreter support.
   Removing support for older versions should be well justified in that the
   maintenance burden has become too high.
 
@@ -235,7 +236,7 @@ Additional Notes
   this library. Encoding of symbols like emoji is expressly prohibited by
   the technical standard IDNA 2008 and emoji domains are broadly phased
   out across the domain industry due to associated security risks. For
-  now, applications that wish need to support these non-compliant labels
+  now, applications that need to support these non-compliant labels
   may wish to consider trying the encode/decode operation in this library
   first, and then falling back to using `encodings.idna`. See `the Github
   project <https://github.com/kjd/idna/issues/18>`_ for more discussion.

+ 19 - 17
contrib/python/idna/py3/LICENSE.md

@@ -1,29 +1,31 @@
 BSD 3-Clause License
 
-Copyright (c) 2013-2021, Kim Davies
+Copyright (c) 2013-2023, Kim Davies and contributors.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
+modification, are permitted provided that the following conditions are
+met:
 
-1. Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
 
-2. Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
 
 3. Neither the name of the copyright holder nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.
 
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 9 - 9
contrib/python/idna/py3/README.rst

@@ -57,9 +57,9 @@ You may use the codec encoding and decoding methods using the
 .. code-block:: pycon
 
     >>> import idna.codec
-    >>> print('домен.испытание'.encode('idna'))
+    >>> print('домен.испытание'.encode('idna2008'))
     b'xn--d1acufc.xn--80akhbyknj4f'
-    >>> print(b'xn--d1acufc.xn--80akhbyknj4f'.decode('idna'))
+    >>> print(b'xn--d1acufc.xn--80akhbyknj4f'.decode('idna2008'))
     домен.испытание
 
 Conversions can be applied at a per-label basis using the ``ulabel`` or
@@ -79,7 +79,7 @@ ways a user may input a domain name. This functionality, known as
 a “mapping”, is considered by the specification to be a local
 user-interface issue distinct from IDNA conversion functionality.
 
-This library provides one such mapping, that was developed by the
+This library provides one such mapping that was developed by the
 Unicode Consortium. Known as `Unicode IDNA Compatibility Processing
 <https://unicode.org/reports/tr46/>`_, it provides for both a regular
 mapping for typical applications, as well as a transitional mapping to
@@ -112,7 +112,7 @@ IDNA specification this conversion is not performed.
     >>> idna.encode('Königsgäßchen', uts46=True, transitional=True)
     'xn--knigsgsschen-lcb0w'
 
-Implementors should use transitional processing with caution, only in
+Implementers should use transitional processing with caution, only in
 rare cases where conversion from legacy labels to current labels must be
 performed (i.e. IDNA implementations that pre-date 2008). For typical
 applications that just need to convert labels, transitional processing
@@ -155,8 +155,8 @@ and perform the required calculations to identify eligibility. There are
 three main modes:
 
 * ``idna-data make-libdata``. Generates ``idnadata.py`` and
-  ``uts46data.py``, the pre-calculated lookup tables using for IDNA and
-  UTS 46 conversions. Implementors who wish to track this library against
+  ``uts46data.py``, the pre-calculated lookup tables used for IDNA and
+  UTS 46 conversions. Implementers who wish to track this library against
   a different Unicode version may use this tool to manually generate a
   different version of the ``idnadata.py`` and ``uts46data.py`` files.
 
@@ -172,7 +172,7 @@ three main modes:
 
 The tool accepts a number of arguments, described using ``idna-data
 -h``. Most notably, the ``--version`` argument allows the specification
-of the version of Unicode to use in computing the table data. For
+of the version of Unicode to be used in computing the table data. For
 example, ``idna-data --version 9.0.0 make-libdata`` will generate
 library data against Unicode 9.0.0.
 
@@ -186,7 +186,7 @@ Additional Notes
 * **Version support**. This library supports Python 3.5 and higher.
   As this library serves as a low-level toolkit for a variety of
   applications, many of which strive for broad compatibility with older
-  Python versions, there is no rush to remove older intepreter support.
+  Python versions, there is no rush to remove older interpreter support.
   Removing support for older versions should be well justified in that the
   maintenance burden has become too high.
 
@@ -204,7 +204,7 @@ Additional Notes
   this library. Encoding of symbols like emoji is expressly prohibited by
   the technical standard IDNA 2008 and emoji domains are broadly phased
   out across the domain industry due to associated security risks. For
-  now, applications that wish need to support these non-compliant labels
+  now, applications that need to support these non-compliant labels
   may wish to consider trying the encode/decode operation in this library
   first, and then falling back to using `encodings.idna`. See `the Github
   project <https://github.com/kjd/idna/issues/18>`_ for more discussion.

+ 20 - 14
contrib/python/idna/py3/idna/codec.py

@@ -1,7 +1,7 @@
 from .core import encode, decode, alabel, ulabel, IDNAError
 import codecs
 import re
-from typing import Tuple, Optional
+from typing import Any, Tuple, Optional
 
 _unicode_dots_re = re.compile('[\u002e\u3002\uff0e\uff61]')
 
@@ -26,24 +26,24 @@ class Codec(codecs.Codec):
         return decode(data), len(data)
 
 class IncrementalEncoder(codecs.BufferedIncrementalEncoder):
-    def _buffer_encode(self, data: str, errors: str, final: bool) -> Tuple[str, int]:  # type: ignore
+    def _buffer_encode(self, data: str, errors: str, final: bool) -> Tuple[bytes, int]:
         if errors != 'strict':
             raise IDNAError('Unsupported error handling \"{}\"'.format(errors))
 
         if not data:
-            return "", 0
+            return b'', 0
 
         labels = _unicode_dots_re.split(data)
-        trailing_dot = ''
+        trailing_dot = b''
         if labels:
             if not labels[-1]:
-                trailing_dot = '.'
+                trailing_dot = b'.'
                 del labels[-1]
             elif not final:
                 # Keep potentially unfinished label until the next call
                 del labels[-1]
                 if labels:
-                    trailing_dot = '.'
+                    trailing_dot = b'.'
 
         result = []
         size = 0
@@ -54,18 +54,21 @@ class IncrementalEncoder(codecs.BufferedIncrementalEncoder):
             size += len(label)
 
         # Join with U+002E
-        result_str = '.'.join(result) + trailing_dot  # type: ignore
+        result_bytes = b'.'.join(result) + trailing_dot
         size += len(trailing_dot)
-        return result_str, size
+        return result_bytes, size
 
 class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
-    def _buffer_decode(self, data: str, errors: str, final: bool) -> Tuple[str, int]:  # type: ignore
+    def _buffer_decode(self, data: Any, errors: str, final: bool) -> Tuple[str, int]:
         if errors != 'strict':
             raise IDNAError('Unsupported error handling \"{}\"'.format(errors))
 
         if not data:
             return ('', 0)
 
+        if not isinstance(data, str):
+            data = str(data, 'ascii')
+
         labels = _unicode_dots_re.split(data)
         trailing_dot = ''
         if labels:
@@ -99,14 +102,17 @@ class StreamReader(Codec, codecs.StreamReader):
     pass
 
 
-def getregentry() -> codecs.CodecInfo:
-    # Compatibility as a search_function for codecs.register()
+def search_function(name: str) -> Optional[codecs.CodecInfo]:
+    if name != 'idna2008':
+        return None
     return codecs.CodecInfo(
-        name='idna',
-        encode=Codec().encode,  # type: ignore
-        decode=Codec().decode,  # type: ignore
+        name=name,
+        encode=Codec().encode,
+        decode=Codec().decode,
         incrementalencoder=IncrementalEncoder,
         incrementaldecoder=IncrementalDecoder,
         streamwriter=StreamWriter,
         streamreader=StreamReader,
     )
+
+codecs.register(search_function)

+ 5 - 5
contrib/python/idna/py3/idna/core.py

@@ -318,7 +318,7 @@ def uts46_remap(domain: str, std3_rules: bool = True, transitional: bool = False
             status = uts46row[1]
             replacement = None  # type: Optional[str]
             if len(uts46row) == 3:
-                replacement = uts46row[2]  # type: ignore
+                replacement = uts46row[2]
             if (status == 'V' or
                     (status == 'D' and not transitional) or
                     (status == '3' and not std3_rules and replacement is None)):
@@ -338,9 +338,9 @@ def uts46_remap(domain: str, std3_rules: bool = True, transitional: bool = False
 
 
 def encode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool = False, std3_rules: bool = False, transitional: bool = False) -> bytes:
-    if isinstance(s, (bytes, bytearray)):
+    if not isinstance(s, str):
         try:
-            s = s.decode('ascii')
+            s = str(s, 'ascii')
         except UnicodeDecodeError:
             raise IDNAError('should pass a unicode string to the function rather than a byte string.')
     if uts46:
@@ -372,8 +372,8 @@ def encode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool =
 
 def decode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool = False, std3_rules: bool = False) -> str:
     try:
-        if isinstance(s, (bytes, bytearray)):
-            s = s.decode('ascii')
+        if not isinstance(s, str):
+            s = str(s, 'ascii')
     except UnicodeDecodeError:
         raise IDNAError('Invalid ASCII in A-label')
     if uts46:

+ 4 - 5
contrib/python/idna/py3/idna/idnadata.py

@@ -1,6 +1,6 @@
 # This file is automatically generated by tools/idna-data
 
-__version__ = '15.0.0'
+__version__ = '15.1.0'
 scripts = {
     'Greek': (
         0x37000000374,
@@ -59,6 +59,7 @@ scripts = {
         0x2b7400002b81e,
         0x2b8200002cea2,
         0x2ceb00002ebe1,
+        0x2ebf00002ee5e,
         0x2f8000002fa1e,
         0x300000003134b,
         0x31350000323b0,
@@ -1834,7 +1835,6 @@ codepoint_classes = {
         0xa7d50000a7d6,
         0xa7d70000a7d8,
         0xa7d90000a7da,
-        0xa7f20000a7f5,
         0xa7f60000a7f8,
         0xa7fa0000a828,
         0xa82c0000a82d,
@@ -1907,9 +1907,7 @@ codepoint_classes = {
         0x1060000010737,
         0x1074000010756,
         0x1076000010768,
-        0x1078000010786,
-        0x10787000107b1,
-        0x107b2000107bb,
+        0x1078000010781,
         0x1080000010806,
         0x1080800010809,
         0x1080a00010836,
@@ -2134,6 +2132,7 @@ codepoint_classes = {
         0x2b7400002b81e,
         0x2b8200002cea2,
         0x2ceb00002ebe1,
+        0x2ebf00002ee5e,
         0x300000003134b,
         0x31350000323b0,
     ),

+ 1 - 1
contrib/python/idna/py3/idna/package_data.py

@@ -1,2 +1,2 @@
-__version__ = '3.4'
+__version__ = '3.6'
 

File diff suppressed because it is too large
+ 210 - 214
contrib/python/idna/py3/idna/uts46data.py


+ 37 - 29
contrib/python/idna/py3/tests/test_idna.py

@@ -231,37 +231,45 @@ class IDNATests(unittest.TestCase):
         self.assertTrue(idna.valid_contexto(ext_arabic_digit + ext_arabic_digit, 0))
         self.assertFalse(idna.valid_contexto(ext_arabic_digit + arabic_digit, 0))
 
-    def test_encode(self):
-
-        self.assertEqual(idna.encode('xn--zckzah.xn--zckzah'), b'xn--zckzah.xn--zckzah')
-        self.assertEqual(idna.encode('\u30c6\u30b9\u30c8.xn--zckzah'), b'xn--zckzah.xn--zckzah')
-        self.assertEqual(idna.encode('\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8'), b'xn--zckzah.xn--zckzah')
-        self.assertEqual(idna.encode('abc.abc'), b'abc.abc')
-        self.assertEqual(idna.encode('xn--zckzah.abc'), b'xn--zckzah.abc')
-        self.assertEqual(idna.encode('\u30c6\u30b9\u30c8.abc'), b'xn--zckzah.abc')
-        self.assertEqual(idna.encode('\u0521\u0525\u0523-\u0523\u0523-----\u0521\u0523\u0523\u0523.aa'),
+    def test_encode(self, encode=None, skip_bytes=False):
+        if encode is None:
+            encode = idna.encode
+
+        self.assertEqual(encode('xn--zckzah.xn--zckzah'), b'xn--zckzah.xn--zckzah')
+        self.assertEqual(encode('\u30c6\u30b9\u30c8.xn--zckzah'), b'xn--zckzah.xn--zckzah')
+        self.assertEqual(encode('\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8'), b'xn--zckzah.xn--zckzah')
+        self.assertEqual(encode('abc.abc'), b'abc.abc')
+        self.assertEqual(encode('xn--zckzah.abc'), b'xn--zckzah.abc')
+        self.assertEqual(encode('\u30c6\u30b9\u30c8.abc'), b'xn--zckzah.abc')
+        self.assertEqual(encode('\u0521\u0525\u0523-\u0523\u0523-----\u0521\u0523\u0523\u0523.aa'),
                          b'xn---------90gglbagaar.aa')
-        self.assertRaises(idna.IDNAError, idna.encode,
-                          '\u0521\u0524\u0523-\u0523\u0523-----\u0521\u0523\u0523\u0523.aa', uts46=False)
-        self.assertEqual(idna.encode('a'*63), b'a'*63)
-        self.assertRaises(idna.IDNAError, idna.encode, 'a'*64)
-        self.assertRaises(idna.core.InvalidCodepoint, idna.encode, '*')
-        self.assertRaises(idna.IDNAError, idna.encode, b'\x0a\x33\x81')
-
-    def test_decode(self):
-
-        self.assertEqual(idna.decode('xn--zckzah.xn--zckzah'), '\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8')
-        self.assertEqual(idna.decode('\u30c6\u30b9\u30c8.xn--zckzah'), '\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8')
-        self.assertEqual(idna.decode('\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8'),
-                         '\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8')
-        self.assertEqual(idna.decode('abc.abc'), 'abc.abc')
-        self.assertEqual(idna.decode('xn---------90gglbagaar.aa'),
+        if encode is idna.encode:
+            self.assertRaises(idna.IDNAError, encode,
+                              '\u0521\u0524\u0523-\u0523\u0523-----\u0521\u0523\u0523\u0523.aa', uts46=False)
+        self.assertEqual(encode('a'*63), b'a'*63)
+        self.assertRaises(idna.IDNAError, encode, 'a'*64)
+        self.assertRaises(idna.core.InvalidCodepoint, encode, '*')
+        if not skip_bytes:
+            self.assertRaises(idna.IDNAError, encode, b'\x0a\x33\x81')
+
+    def test_decode(self, decode=None, skip_str=False):
+        if decode is None:
+            decode = idna.decode
+        self.assertEqual(decode(b'xn--zckzah.xn--zckzah'), '\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8')
+        self.assertEqual(decode(b'xn--d1acufc.xn--80akhbyknj4f'),
+                         '\u0434\u043e\u043c\u0435\u043d.\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435')
+        if not skip_str:
+            self.assertEqual(decode('\u30c6\u30b9\u30c8.xn--zckzah'), '\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8')
+            self.assertEqual(decode('\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8'),
+                             '\u30c6\u30b9\u30c8.\u30c6\u30b9\u30c8')
+            self.assertEqual(decode('abc.abc'), 'abc.abc')
+        self.assertEqual(decode(b'xn---------90gglbagaar.aa'),
                          '\u0521\u0525\u0523-\u0523\u0523-----\u0521\u0523\u0523\u0523.aa')
-        self.assertRaises(idna.IDNAError, idna.decode, 'XN---------90GGLBAGAAC.AA')
-        self.assertRaises(idna.IDNAError, idna.decode, 'xn---------90gglbagaac.aa')
-        self.assertRaises(idna.IDNAError, idna.decode, 'xn--')
-        self.assertRaises(idna.IDNAError, idna.decode, b'\x8d\xd2')
-        self.assertRaises(idna.IDNAError, idna.decode, b'A.A.0.a.a.A.0.a.A.A.0.a.A.0A.2.a.A.A.0.a.A.0.A.a.A0.a.a.A.0.a.fB.A.A.a.A.A.B.A.A.a.A.A.B.A.A.a.A.A.0.a.A.a.a.A.A.0.a.A.0.A.a.A0.a.a.A.0.a.fB.A.A.a.A.A.B.0A.A.a.A.A.B.A.A.a.A.A.a.A.A.B.A.A.a.A.0.a.B.A.A.a.A.B.A.a.A.A.5.a.A.0.a.Ba.A.B.A.A.a.A.0.a.Xn--B.A.A.A.a')
+        self.assertRaises(idna.IDNAError, decode, b'XN---------90GGLBAGAAC.AA')
+        self.assertRaises(idna.IDNAError, decode, b'xn---------90gglbagaac.aa')
+        self.assertRaises(idna.IDNAError, decode, b'xn--')
+        self.assertRaises(idna.IDNAError, decode, b'\x8d\xd2')
+        self.assertRaises(idna.IDNAError, decode, b'A.A.0.a.a.A.0.a.A.A.0.a.A.0A.2.a.A.A.0.a.A.0.A.a.A0.a.a.A.0.a.fB.A.A.a.A.A.B.A.A.a.A.A.B.A.A.a.A.A.0.a.A.a.a.A.A.0.a.A.0.A.a.A0.a.a.A.0.a.fB.A.A.a.A.A.B.0A.A.a.A.A.B.A.A.a.A.A.a.A.A.B.A.A.a.A.0.a.B.A.A.a.A.B.A.a.A.A.5.a.A.0.a.Ba.A.B.A.A.a.A.0.a.Xn--B.A.A.A.a')
 
 if __name__ == '__main__':
     unittest.main()

Some files were not shown because too many files changed in this diff