Projects
openEuler:22.03:LTS:LoongArch
python-idna
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 5
View file
_service:tar_scm_kernel_repo:python-idna.spec
Changed
@@ -1,6 +1,6 @@ Name: python-idna Version: 3.2 -Release: 2 +Release: 3 Summary: Internationalized Domain Names in Applications (IDNA) License: BSD and Python and Unicode URL: https://github.com/kjd/idna @@ -10,6 +10,12 @@ BuildRequires: python3-devel python3-setuptools +Patch6000: backport-0001-CVE-2024-3651.patch +Patch6001: backport-0002-CVE-2024-3651.patch +Patch6002: backport-0003-CVE-2024-3651.patch +Patch6003: backport-0004-CVE-2024-3651.patch +Patch6004: backport-0005-CVE-2024-3651.patch + %description A library to support the Internationalised Domain Names in Applications (IDNA) protocol as specified in RFC 5891 @@ -47,6 +53,9 @@ %{python3_sitelib}/* %changelog +* Tue May 07 2024 zhangpan <zhangpan103@h-partners.com> - 3.2-3 +- fix CVE-2024-3651 + * Wed Oct 26 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 3.2-2 - Rebuild for next release
View file
_service:tar_scm_kernel_repo:backport-0001-CVE-2024-3651.patch
Added
@@ -0,0 +1,2364 @@ +From b22480c50f09b9423cfe20d53ba0fdc0045ce7b4 Mon Sep 17 00:00:00 2001 +From: Kim Davies <kim.davies@iana.org> +Date: Tue, 14 Sep 2021 13:17:10 -0700 +Subject: [PATCH] Update to Unicode 14 + +Reference:https://github.com/kjd/idna/commit/b22480c50f09b9423cfe20d53ba0fdc0045ce7b4 +Conflict:NA + +--- + idna/idnadata.py | 137 ++++++-- + idna/uts46data.py | 839 +++++++++++++++++++++++++++------------------- + tools/idna-data | 2 +- + 3 files changed, 610 insertions(+), 368 deletions(-) + +diff --git a/idna/idnadata.py b/idna/idnadata.py +index b86a3e0..1b5805d 100644 +--- a/idna/idnadata.py ++++ b/idna/idnadata.py +@@ -1,6 +1,6 @@ + # This file is automatically generated by tools/idna-data + +-__version__ = '13.0.0' ++__version__ = '14.0.0' + scripts = { + 'Greek': ( + 0x37000000374, +@@ -49,12 +49,13 @@ + 0x30210000302a, + 0x30380000303c, + 0x340000004dc0, +- 0x4e0000009ffd, ++ 0x4e000000a000, + 0xf9000000fa6e, + 0xfa700000fada, ++ 0x16fe200016fe4, + 0x16ff000016ff2, +- 0x200000002a6de, +- 0x2a7000002b735, ++ 0x200000002a6e0, ++ 0x2a7000002b739, + 0x2b7400002b81e, + 0x2b8200002cea2, + 0x2ceb00002ebe1, +@@ -75,7 +76,7 @@ + 'Hiragana': ( + 0x304100003097, + 0x309d000030a0, +- 0x1b0010001b11f, ++ 0x1b0010001b120, + 0x1b1500001b153, + 0x1f2000001f201, + ), +@@ -87,7 +88,11 @@ + 0x330000003358, + 0xff660000ff70, + 0xff710000ff9e, ++ 0x1aff00001aff4, ++ 0x1aff50001affc, ++ 0x1affd0001afff, + 0x1b0000001b001, ++ 0x1b1200001b123, + 0x1b1640001b168, + ), + } +@@ -405,6 +410,39 @@ + 0x868: 68, + 0x869: 82, + 0x86a: 82, ++ 0x870: 82, ++ 0x871: 82, ++ 0x872: 82, ++ 0x873: 82, ++ 0x874: 82, ++ 0x875: 82, ++ 0x876: 82, ++ 0x877: 82, ++ 0x878: 82, ++ 0x879: 82, ++ 0x87a: 82, ++ 0x87b: 82, ++ 0x87c: 82, ++ 0x87d: 82, ++ 0x87e: 82, ++ 0x87f: 82, ++ 0x880: 82, ++ 0x881: 82, ++ 0x882: 82, ++ 0x883: 67, ++ 0x884: 67, ++ 0x885: 67, ++ 0x886: 68, ++ 0x887: 85, ++ 0x888: 85, ++ 0x889: 68, ++ 0x88a: 68, ++ 0x88b: 68, ++ 0x88c: 68, ++ 0x88d: 68, ++ 0x88e: 82, ++ 0x890: 85, ++ 0x891: 85, + 0x8a0: 68, + 0x8a1: 68, + 0x8a2: 68, +@@ -426,6 +464,7 @@ + 0x8b2: 82, + 0x8b3: 68, + 0x8b4: 68, ++ 0x8b5: 68, + 0x8b6: 68, + 0x8b7: 68, + 0x8b8: 68, +@@ -444,6 +483,7 @@ + 0x8c5: 68, + 0x8c6: 68, + 0x8c7: 68, ++ 0x8c8: 68, + 0x8e2: 85, + 0x1806: 85, + 0x1807: 68, +@@ -768,6 +808,24 @@ + 0x10f52: 68, + 0x10f53: 68, + 0x10f54: 82, ++ 0x10f70: 68, ++ 0x10f71: 68, ++ 0x10f72: 68, ++ 0x10f73: 68, ++ 0x10f74: 82, ++ 0x10f75: 82, ++ 0x10f76: 68, ++ 0x10f77: 68, ++ 0x10f78: 68, ++ 0x10f79: 68, ++ 0x10f7a: 68, ++ 0x10f7b: 68, ++ 0x10f7c: 68, ++ 0x10f7d: 68, ++ 0x10f7e: 68, ++ 0x10f7f: 68, ++ 0x10f80: 68, ++ 0x10f81: 68, + 0x10fb0: 68, + 0x10fb1: 85, + 0x10fb2: 68, +@@ -1168,9 +1226,9 @@ + 0x8000000082e, + 0x8400000085c, + 0x8600000086b, +- 0x8a0000008b5, +- 0x8b6000008c8, +- 0x8d3000008e2, ++ 0x87000000888, ++ 0x8890000088f, ++ 0x898000008e2, + 0x8e300000958, + 0x96000000964, + 0x96600000970, +@@ -1252,11 +1310,12 @@ + 0xc0e00000c11, + 0xc1200000c29, + 0xc2a00000c3a, +- 0xc3d00000c45, ++ 0xc3c00000c45, + 0xc4600000c49, + 0xc4a00000c4e, + 0xc5500000c57, + 0xc5800000c5b, ++ 0xc5d00000c5e, + 0xc6000000c64, + 0xc6600000c70, + 0xc8000000c84, +@@ -1269,7 +1328,7 @@ + 0xcc600000cc9, + 0xcca00000cce, + 0xcd500000cd7, +- 0xcde00000cdf, ++ 0xcdd00000cdf, + 0xce000000ce4, + 0xce600000cf0, + 0xcf100000cf3, +@@ -1366,9 +1425,8 @@ + 0x16810000169b, + 0x16a0000016eb, + 0x16f1000016f9, +- 0x17000000170d, +- 0x170e00001715, +- 0x172000001735, ++ 0x170000001716, ++ 0x171f00001735, + 0x174000001754, + 0x17600000176d, + 0x176e00001771, +@@ -1397,8 +1455,8 @@ + 0x1a9000001a9a, + 0x1aa700001aa8, + 0x1ab000001abe, +- 0x1abf00001ac1, +- 0x1b0000001b4c,
View file
_service:tar_scm_kernel_repo:backport-0002-CVE-2024-3651.patch
Added
@@ -0,0 +1,43 @@ +From f50df5120f3584c3375f1a42e413826fe9411a53 Mon Sep 17 00:00:00 2001 +From: Kim Davies <kim.davies@iana.org> +Date: Sun, 3 Oct 2021 07:45:11 -0700 +Subject: [PATCH] Raise IDNAError on non-ASCII A-Label (fixes #108) + +Reference:https://github.com/kjd/idna/commit/f50df5120f3584c3375f1a42e413826fe9411a53 +Conflict:NA + +--- + idna/core.py | 7 +++++-- + tests/test_idna.py | 1 + + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/idna/core.py b/idna/core.py +index d605129..871ebd3 100644 +--- a/idna/core.py ++++ b/idna/core.py +@@ -383,8 +383,11 @@ def encode(s, strict=False, uts46=False, std3_rules=False, transitional=False): + + def decode(s, strict=False, uts46=False, std3_rules=False): + # type: (Union[str, bytes, bytearray], bool, bool, bool) -> str +- if isinstance(s, (bytes, bytearray)): +- s = s.decode('ascii') ++ try: ++ if isinstance(s, (bytes, bytearray)): ++ s = s.decode('ascii') ++ except UnicodeDecodeError: ++ raise IDNAError('Invalid ASCII in A-label') + if uts46: + s = uts46_remap(s, std3_rules, False) + trailing_dot = False +diff --git a/tests/test_idna.py b/tests/test_idna.py +index 9e1d2d9..7ac6057 100755 +--- a/tests/test_idna.py ++++ b/tests/test_idna.py +@@ -259,6 +259,7 @@ def test_decode(self): + 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') + + if __name__ == '__main__': + unittest.main()
View file
_service:tar_scm_kernel_repo:backport-0003-CVE-2024-3651.patch
Added
@@ -0,0 +1,1116 @@ +From 8bbb873421dd565af69541844a61a4d0fbf6aa60 Mon Sep 17 00:00:00 2001 +From: Kim Davies <kim.davies@iana.org> +Date: Sun, 3 Oct 2021 08:38:24 -0700 +Subject: [PATCH] Resync type annotations with master + +Reference:https://github.com/kjd/idna/commit/8bbb873421dd565af69541844a61a4d0fbf6aa60 +Conflict:NA + +--- + idna/codec.py | 15 +-- + idna/compat.py | 9 +- + idna/core.py | 54 ++++------- + idna/intranges.py | 12 +-- + idna/uts46data.py | 243 ++++++++++++++++------------------------------ + tools/idna-data | 2 +- + 6 files changed, 112 insertions(+), 223 deletions(-) + +diff --git a/idna/codec.py b/idna/codec.py +index 080f22a..1ca9ba6 100644 +--- a/idna/codec.py ++++ b/idna/codec.py +@@ -7,8 +7,7 @@ + + class Codec(codecs.Codec): + +- def encode(self, data, errors='strict'): +- # type: (str, str) -> Tuple[bytes, int] ++ def encode(self, data: str, errors: str = 'strict') -> Tuple[bytes, int]: + if errors != 'strict': + raise IDNAError('Unsupported error handling \"{}\"'.format(errors)) + +@@ -17,8 +16,7 @@ def encode(self, data, errors='strict'): + + return encode(data), len(data) + +- def decode(self, data, errors='strict'): +- # type: (bytes, str) -> Tuple[str, int] ++ def decode(self, data: bytes, errors: str = 'strict') -> Tuple[str, int]: + if errors != 'strict': + raise IDNAError('Unsupported error handling \"{}\"'.format(errors)) + +@@ -28,8 +26,7 @@ def decode(self, data, errors='strict'): + return decode(data), len(data) + + class IncrementalEncoder(codecs.BufferedIncrementalEncoder): +- def _buffer_encode(self, data, errors, final): # type: ignore +- # type: (str, str, bool) -> Tuple[str, int] ++ def _buffer_encode(self, data: str, errors: str, final: bool) -> Tuple[str, int]: # type: ignore + if errors != 'strict': + raise IDNAError('Unsupported error handling \"{}\"'.format(errors)) + +@@ -62,8 +59,7 @@ def _buffer_encode(self, data, errors, final): # type: ignore + return result_str, size + + class IncrementalDecoder(codecs.BufferedIncrementalDecoder): +- def _buffer_decode(self, data, errors, final): # type: ignore +- # type: (str, str, bool) -> Tuple[str, int] ++ def _buffer_decode(self, data: str, errors: str, final: bool) -> Tuple[str, int]: # type: ignore + if errors != 'strict': + raise IDNAError('Unsupported error handling \"{}\"'.format(errors)) + +@@ -103,8 +99,7 @@ class StreamReader(Codec, codecs.StreamReader): + pass + + +-def getregentry(): +- # type: () -> codecs.CodecInfo ++def getregentry() -> codecs.CodecInfo: + # Compatibility as a search_function for codecs.register() + return codecs.CodecInfo( + name='idna', +diff --git a/idna/compat.py b/idna/compat.py +index dc896c7..786e6bd 100644 +--- a/idna/compat.py ++++ b/idna/compat.py +@@ -2,15 +2,12 @@ + from .codec import * + from typing import Any, Union + +-def ToASCII(label): +- # type: (str) -> bytes ++def ToASCII(label: str) -> bytes: + return encode(label) + +-def ToUnicode(label): +- # type: (Union[bytes, bytearray]) -> str ++def ToUnicode(label: Union[bytes, bytearray]) -> str: + return decode(label) + +-def nameprep(s): +- # type: (Any) -> None ++def nameprep(s: Any) -> None: + raise NotImplementedError('IDNA 2008 does not utilise nameprep protocol') + +diff --git a/idna/core.py b/idna/core.py +index c66fb9f..55ab967 100644 +--- a/idna/core.py ++++ b/idna/core.py +@@ -29,43 +29,36 @@ class InvalidCodepointContext(IDNAError): + pass + + +-def _combining_class(cp): +- # type: (int) -> int ++def _combining_class(cp: int) -> int: + v = unicodedata.combining(chr(cp)) + if v == 0: + if not unicodedata.name(chr(cp)): + raise ValueError('Unknown character in unicodedata') + return v + +-def _is_script(cp, script): +- # type: (str, str) -> bool ++def _is_script(cp: str, script: str) -> bool: + return intranges_contain(ord(cp), idnadata.scripts[script]) + +-def _punycode(s): +- # type: (str) -> bytes ++def _punycode(s: str) -> bytes: + return s.encode('punycode') + +-def _unot(s): +- # type: (int) -> str ++def _unot(s: int) -> str: + return 'U+{:04X}'.format(s) + + +-def valid_label_length(label): +- # type: (Union[bytes, str]) -> bool ++def valid_label_length(label: Union[bytes, str]) -> bool: + if len(label) > 63: + return False + return True + + +-def valid_string_length(label, trailing_dot): +- # type: (Union[bytes, str], bool) -> bool ++def valid_string_length(label: Union[bytes, str], trailing_dot: bool) -> bool: + if len(label) > (254 if trailing_dot else 253): + return False + return True + + +-def check_bidi(label, check_ltr=False): +- # type: (str, bool) -> bool ++def check_bidi(label: str, check_ltr: bool = False) -> bool: + # Bidi rules should only be applied if string contains RTL characters + bidi_label = False + for (idx, cp) in enumerate(label, 1): +@@ -124,15 +117,13 @@ def check_bidi(label, check_ltr=False): + return True + + +-def check_initial_combiner(label): +- # type: (str) -> bool ++def check_initial_combiner(label: str) -> bool: + if unicodedata.category(label[0])[0] == 'M': + raise IDNAError('Label begins with an illegal combining character') + return True + + +-def check_hyphen_ok(label): +- # type: (str) -> bool ++def check_hyphen_ok(label: str) -> bool: + if label[2:4] == '--': + raise IDNAError('Label has disallowed hyphens in 3rd and 4th position') + if label[0] == '-' or label[-1] == '-': +@@ -140,14 +131,12 @@ def check_hyphen_ok(label): + return True + + +-def check_nfc(label): +- # type: (str) -> None ++def check_nfc(label: str) -> None: + if unicodedata.normalize('NFC', label) != label: + raise IDNAError('Label must be in Normalization Form C') + + +-def valid_contextj(label, pos): +- # type: (str, int) -> bool ++def valid_contextj(label: str, pos: int) -> bool: + cp_value = ord(label[pos]) + + if cp_value == 0x200c: +@@ -190,8 +179,7 @@ def valid_contextj(label, pos): + return False + + +-def valid_contexto(label, pos, exception=False): +- # type: (str, int, bool) -> bool ++def valid_contexto(label: str, pos: int, exception: bool = False) -> bool: + cp_value = ord(label[pos]) + + if cp_value == 0x00b7: +@@ -233,8 +221,7 @@ def valid_contexto(label, pos, exception=False): + return False + + +-def check_label(label):
View file
_service:tar_scm_kernel_repo:backport-0004-CVE-2024-3651.patch
Added
@@ -0,0 +1,911 @@ +From 527fa86d555490f13fda85133e8fe3a918f8bece Mon Sep 17 00:00:00 2001 +From: Kim Davies <kim.davies@iana.org> +Date: Tue, 13 Sep 2022 09:30:44 +0800 +Subject: [PATCH] Update to Unicode 15 + +Reference:https://github.com/kjd/idna/commit/527fa86d555490f13fda85133e8fe3a918f8bece +Conflict:NA + +--- + idna/idnadata.py | 34 ++++-- + idna/uts46data.py | 306 +++++++++++++++++++++++++++++----------------- + tools/idna-data | 2 +- + 3 files changed, 222 insertions(+), 120 deletions(-) + +diff --git a/idna/idnadata.py b/idna/idnadata.py +index 1b5805d..67db462 100644 +--- a/idna/idnadata.py ++++ b/idna/idnadata.py +@@ -1,6 +1,6 @@ + # This file is automatically generated by tools/idna-data + +-__version__ = '14.0.0' ++__version__ = '15.0.0' + scripts = { + 'Greek': ( + 0x37000000374, +@@ -55,12 +55,13 @@ + 0x16fe200016fe4, + 0x16ff000016ff2, + 0x200000002a6e0, +- 0x2a7000002b739, ++ 0x2a7000002b73a, + 0x2b7400002b81e, + 0x2b8200002cea2, + 0x2ceb00002ebe1, + 0x2f8000002fa1e, + 0x300000003134b, ++ 0x31350000323b0, + ), + 'Hebrew': ( + 0x591000005c8, +@@ -77,6 +78,7 @@ + 0x304100003097, + 0x309d000030a0, + 0x1b0010001b120, ++ 0x1b1320001b133, + 0x1b1500001b153, + 0x1f2000001f201, + ), +@@ -93,6 +95,7 @@ + 0x1affd0001afff, + 0x1b0000001b001, + 0x1b1200001b123, ++ 0x1b1550001b156, + 0x1b1640001b168, + ), + } +@@ -1331,7 +1334,7 @@ + 0xcdd00000cdf, + 0xce000000ce4, + 0xce600000cf0, +- 0xcf100000cf3, ++ 0xcf100000cf4, + 0xd0000000d0d, + 0xd0e00000d11, + 0xd1200000d45, +@@ -1366,7 +1369,7 @@ + 0xeb400000ebe, + 0xec000000ec5, + 0xec600000ec7, +- 0xec800000ece, ++ 0xec800000ecf, + 0xed000000eda, + 0xede00000ee0, + 0xf0000000f01, +@@ -1859,7 +1862,7 @@ + 0xab200000ab27, + 0xab280000ab2f, + 0xab300000ab5b, +- 0xab600000ab6a, ++ 0xab600000ab69, + 0xabc00000abeb, + 0xabec0000abee, + 0xabf00000abfa, +@@ -1943,7 +1946,7 @@ + 0x10e8000010eaa, + 0x10eab00010ead, + 0x10eb000010eb2, +- 0x10f0000010f1d, ++ 0x10efd00010f1d, + 0x10f2700010f28, + 0x10f3000010f51, + 0x10f7000010f86, +@@ -1966,7 +1969,7 @@ + 0x111dc000111dd, + 0x1120000011212, + 0x1121300011238, +- 0x1123e0001123f, ++ 0x1123e00011242, + 0x1128000011287, + 0x1128800011289, + 0x1128a0001128e, +@@ -2047,11 +2050,16 @@ + 0x11d9300011d99, + 0x11da000011daa, + 0x11ee000011ef7, ++ 0x11f0000011f11, ++ 0x11f1200011f3b, ++ 0x11f3e00011f43, ++ 0x11f5000011f5a, + 0x11fb000011fb1, + 0x120000001239a, + 0x1248000012544, + 0x12f9000012ff1, +- 0x130000001342f, ++ 0x1300000013430, ++ 0x1344000013456, + 0x1440000014647, + 0x1680000016a39, + 0x16a4000016a5f, +@@ -2079,7 +2087,9 @@ + 0x1aff50001affc, + 0x1affd0001afff, + 0x1b0000001b123, ++ 0x1b1320001b133, + 0x1b1500001b153, ++ 0x1b1550001b156, + 0x1b1640001b168, + 0x1b1700001b2fc, + 0x1bc000001bc6b, +@@ -2096,17 +2106,21 @@ + 0x1da9b0001daa0, + 0x1daa10001dab0, + 0x1df000001df1f, ++ 0x1df250001df2b, + 0x1e0000001e007, + 0x1e0080001e019, + 0x1e01b0001e022, + 0x1e0230001e025, + 0x1e0260001e02b, ++ 0x1e0300001e06e, ++ 0x1e08f0001e090, + 0x1e1000001e12d, + 0x1e1300001e13e, + 0x1e1400001e14a, + 0x1e14e0001e14f, + 0x1e2900001e2af, + 0x1e2c00001e2fa, ++ 0x1e4d00001e4fa, + 0x1e7e00001e7e7, + 0x1e7e80001e7ec, + 0x1e7ed0001e7ef, +@@ -2115,13 +2129,13 @@ + 0x1e8d00001e8d7, + 0x1e9220001e94c, + 0x1e9500001e95a, +- 0x1fbf00001fbfa, + 0x200000002a6e0, +- 0x2a7000002b739, ++ 0x2a7000002b73a, + 0x2b7400002b81e, + 0x2b8200002cea2, + 0x2ceb00002ebe1, + 0x300000003134b, ++ 0x31350000323b0, + ), + 'CONTEXTJ': ( + 0x200c0000200e, +diff --git a/idna/uts46data.py b/idna/uts46data.py +index 8f65705..186796c 100644 +--- a/idna/uts46data.py ++++ b/idna/uts46data.py +@@ -7,7 +7,7 @@ + """IDNA Mapping Table from UTS46.""" + + +-__version__ = '14.0.0' ++__version__ = '15.0.0' + def _seg_0() -> List[Union[Tuple[int, str], Tuple[int, str, str]]]: + return [ + (0x0, '3'), +@@ -1300,7 +1300,7 @@ def _seg_12() -> List[Union[Tuple[int, str], Tuple[int, str, str]]]: + (0xCE6, 'V'), + (0xCF0, 'X'), + (0xCF1, 'V'), +- (0xCF3, 'X'), ++ (0xCF4, 'X'), + (0xD00, 'V'), + (0xD0D, 'X'), + (0xD0E, 'V'), +@@ -1368,7 +1368,7 @@ def _seg_13() -> List[Union[Tuple[int, str], Tuple[int, str, str]]]: + (0xEC6, 'V'), + (0xEC7, 'X'), + (0xEC8, 'V'), +- (0xECE, 'X'), ++ (0xECF, 'X'), + (0xED0, 'V'), + (0xEDA, 'X'), + (0xEDC, 'M', 'ຫນ'),
View file
_service:tar_scm_kernel_repo:backport-0005-CVE-2024-3651.patch
Added
@@ -0,0 +1,2489 @@ +From 5beb28b9dd77912c0dd656d8b0fdba3eb80222e7 Mon Sep 17 00:00:00 2001 +From: Kim Davies <kim@cynosure.com.au> +Date: Mon, 1 Apr 2024 20:24:57 -0700 +Subject: [PATCH] More efficient resolution of joiner contexts + +In some pathological cases, this would out eligibility under +CONTEXTJ rules much faster. + +Reference:https://github.com/kjd/idna/commit/5beb28b9dd77912c0dd656d8b0fdba3eb80222e7 +Conflict:NA + +--- + idna/core.py | 16 +- + idna/idnadata.py | 2197 ++++++++++++++++++++++++++++++++++++++++++++-- + tools/idna-data | 13 +- + 3 files changed, 2164 insertions(+), 62 deletions(-) + +diff --git a/idna/core.py b/idna/core.py +index aaf7d65..a90bc69 100644 +--- a/idna/core.py ++++ b/idna/core.py +@@ -150,9 +150,11 @@ def valid_contextj(label: str, pos: int) -> bool: + joining_type = idnadata.joining_types.get(ord(label[i])) + if joining_type == ord('T'): + continue +- if joining_type in [ord('L'), ord('D')]: ++ elif joining_type in [ord('L'), ord('D')]: + ok = True + break ++ else: ++ break + + if not ok: + return False +@@ -162,9 +164,11 @@ def valid_contextj(label: str, pos: int) -> bool: + joining_type = idnadata.joining_types.get(ord(label[i])) + if joining_type == ord('T'): + continue +- if joining_type in [ord('R'), ord('D')]: ++ elif joining_type in [ord('R'), ord('D')]: + ok = True + break ++ else: ++ break + return ok + + if cp_value == 0x200d: +@@ -236,12 +240,8 @@ def check_label(label: Union[str, bytes, bytearray]) -> None: + if intranges_contain(cp_value, idnadata.codepoint_classes['PVALID']): + continue + elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTJ']): +- try: +- if not valid_contextj(label, pos): +- raise InvalidCodepointContext('Joiner {} not allowed at position {} in {}'.format( +- _unot(cp_value), pos+1, repr(label))) +- except ValueError: +- raise IDNAError('Unknown codepoint adjacent to joiner {} at position {} in {}'.format( ++ if not valid_contextj(label, pos): ++ raise InvalidCodepointContext('Joiner {} not allowed at position {} in {}'.format( + _unot(cp_value), pos+1, repr(label))) + elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTO']): + if not valid_contexto(label, pos): +diff --git a/idna/idnadata.py b/idna/idnadata.py +index 5cd05d9..c61dcf9 100644 +--- a/idna/idnadata.py ++++ b/idna/idnadata.py +@@ -101,16 +101,190 @@ + ), + } + joining_types = { +- 0x600: 85, +- 0x601: 85, +- 0x602: 85, +- 0x603: 85, +- 0x604: 85, +- 0x605: 85, +- 0x608: 85, +- 0x60b: 85, ++ 0xad: 84, ++ 0x300: 84, ++ 0x301: 84, ++ 0x302: 84, ++ 0x303: 84, ++ 0x304: 84, ++ 0x305: 84, ++ 0x306: 84, ++ 0x307: 84, ++ 0x308: 84, ++ 0x309: 84, ++ 0x30a: 84, ++ 0x30b: 84, ++ 0x30c: 84, ++ 0x30d: 84, ++ 0x30e: 84, ++ 0x30f: 84, ++ 0x310: 84, ++ 0x311: 84, ++ 0x312: 84, ++ 0x313: 84, ++ 0x314: 84, ++ 0x315: 84, ++ 0x316: 84, ++ 0x317: 84, ++ 0x318: 84, ++ 0x319: 84, ++ 0x31a: 84, ++ 0x31b: 84, ++ 0x31c: 84, ++ 0x31d: 84, ++ 0x31e: 84, ++ 0x31f: 84, ++ 0x320: 84, ++ 0x321: 84, ++ 0x322: 84, ++ 0x323: 84, ++ 0x324: 84, ++ 0x325: 84, ++ 0x326: 84, ++ 0x327: 84, ++ 0x328: 84, ++ 0x329: 84, ++ 0x32a: 84, ++ 0x32b: 84, ++ 0x32c: 84, ++ 0x32d: 84, ++ 0x32e: 84, ++ 0x32f: 84, ++ 0x330: 84, ++ 0x331: 84, ++ 0x332: 84, ++ 0x333: 84, ++ 0x334: 84, ++ 0x335: 84, ++ 0x336: 84, ++ 0x337: 84, ++ 0x338: 84, ++ 0x339: 84, ++ 0x33a: 84, ++ 0x33b: 84, ++ 0x33c: 84, ++ 0x33d: 84, ++ 0x33e: 84, ++ 0x33f: 84, ++ 0x340: 84, ++ 0x341: 84, ++ 0x342: 84, ++ 0x343: 84, ++ 0x344: 84, ++ 0x345: 84, ++ 0x346: 84, ++ 0x347: 84, ++ 0x348: 84, ++ 0x349: 84, ++ 0x34a: 84, ++ 0x34b: 84, ++ 0x34c: 84, ++ 0x34d: 84, ++ 0x34e: 84, ++ 0x34f: 84, ++ 0x350: 84, ++ 0x351: 84, ++ 0x352: 84, ++ 0x353: 84, ++ 0x354: 84, ++ 0x355: 84, ++ 0x356: 84, ++ 0x357: 84, ++ 0x358: 84, ++ 0x359: 84, ++ 0x35a: 84, ++ 0x35b: 84, ++ 0x35c: 84, ++ 0x35d: 84, ++ 0x35e: 84, ++ 0x35f: 84, ++ 0x360: 84, ++ 0x361: 84, ++ 0x362: 84, ++ 0x363: 84, ++ 0x364: 84, ++ 0x365: 84, ++ 0x366: 84, ++ 0x367: 84, ++ 0x368: 84, ++ 0x369: 84, ++ 0x36a: 84, ++ 0x36b: 84, ++ 0x36c: 84, ++ 0x36d: 84, ++ 0x36e: 84, ++ 0x36f: 84, ++ 0x483: 84, ++ 0x484: 84, ++ 0x485: 84, ++ 0x486: 84, ++ 0x487: 84, ++ 0x488: 84, ++ 0x489: 84, ++ 0x591: 84,
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.