Skip to content

Commit

Permalink
Merge branch 'master' into gha-mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
kjd committed Oct 3, 2021
2 parents 780dcc3 + 4bfc439 commit 7aff89a
Show file tree
Hide file tree
Showing 5 changed files with 616 additions and 370 deletions.
7 changes: 5 additions & 2 deletions idna/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
137 changes: 112 additions & 25 deletions idna/idnadata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is automatically generated by tools/idna-data

__version__ = '13.0.0'
__version__ = '14.0.0'
scripts = {
'Greek': (
0x37000000374,
Expand Down Expand Up @@ -49,12 +49,13 @@
0x30210000302a,
0x30380000303c,
0x340000004dc0,
0x4e0000009ffd,
0x4e000000a000,
0xf9000000fa6e,
0xfa700000fada,
0x16fe200016fe4,
0x16ff000016ff2,
0x200000002a6de,
0x2a7000002b735,
0x200000002a6e0,
0x2a7000002b739,
0x2b7400002b81e,
0x2b8200002cea2,
0x2ceb00002ebe1,
Expand All @@ -75,7 +76,7 @@
'Hiragana': (
0x304100003097,
0x309d000030a0,
0x1b0010001b11f,
0x1b0010001b120,
0x1b1500001b153,
0x1f2000001f201,
),
Expand All @@ -87,7 +88,11 @@
0x330000003358,
0xff660000ff70,
0xff710000ff9e,
0x1aff00001aff4,
0x1aff50001affc,
0x1affd0001afff,
0x1b0000001b001,
0x1b1200001b123,
0x1b1640001b168,
),
}
Expand Down Expand Up @@ -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,
Expand All @@ -426,6 +464,7 @@
0x8b2: 82,
0x8b3: 68,
0x8b4: 68,
0x8b5: 68,
0x8b6: 68,
0x8b7: 68,
0x8b8: 68,
Expand All @@ -444,6 +483,7 @@
0x8c5: 68,
0x8c6: 68,
0x8c7: 68,
0x8c8: 68,
0x8e2: 85,
0x1806: 85,
0x1807: 68,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1168,9 +1226,9 @@
0x8000000082e,
0x8400000085c,
0x8600000086b,
0x8a0000008b5,
0x8b6000008c8,
0x8d3000008e2,
0x87000000888,
0x8890000088f,
0x898000008e2,
0x8e300000958,
0x96000000964,
0x96600000970,
Expand Down Expand Up @@ -1252,11 +1310,12 @@
0xc0e00000c11,
0xc1200000c29,
0xc2a00000c3a,
0xc3d00000c45,
0xc3c00000c45,
0xc4600000c49,
0xc4a00000c4e,
0xc5500000c57,
0xc5800000c5b,
0xc5d00000c5e,
0xc6000000c64,
0xc6600000c70,
0xc8000000c84,
Expand All @@ -1269,7 +1328,7 @@
0xcc600000cc9,
0xcca00000cce,
0xcd500000cd7,
0xcde00000cdf,
0xcdd00000cdf,
0xce000000ce4,
0xce600000cf0,
0xcf100000cf3,
Expand Down Expand Up @@ -1366,9 +1425,8 @@
0x16810000169b,
0x16a0000016eb,
0x16f1000016f9,
0x17000000170d,
0x170e00001715,
0x172000001735,
0x170000001716,
0x171f00001735,
0x174000001754,
0x17600000176d,
0x176e00001771,
Expand Down Expand Up @@ -1397,8 +1455,8 @@
0x1a9000001a9a,
0x1aa700001aa8,
0x1ab000001abe,
0x1abf00001ac1,
0x1b0000001b4c,
0x1abf00001acf,
0x1b0000001b4d,
0x1b5000001b5a,
0x1b6b00001b74,
0x1b8000001bf4,
Expand All @@ -1413,8 +1471,7 @@
0x1d4e00001d4f,
0x1d6b00001d78,
0x1d7900001d9b,
0x1dc000001dfa,
0x1dfb00001e00,
0x1dc000001e00,
0x1e0100001e02,
0x1e0300001e04,
0x1e0500001e06,
Expand Down Expand Up @@ -1563,7 +1620,7 @@
0x1ff600001ff7,
0x214e0000214f,
0x218400002185,
0x2c3000002c5f,
0x2c3000002c60,
0x2c6100002c62,
0x2c6500002c67,
0x2c6800002c69,
Expand Down Expand Up @@ -1652,8 +1709,7 @@
0x31a0000031c0,
0x31f000003200,
0x340000004dc0,
0x4e0000009ffd,
0xa0000000a48d,
0x4e000000a48d,
0xa4d00000a4fe,
0xa5000000a60d,
0xa6100000a62c,
Expand Down Expand Up @@ -1766,9 +1822,16 @@
0xa7bb0000a7bc,
0xa7bd0000a7be,
0xa7bf0000a7c0,
0xa7c10000a7c2,
0xa7c30000a7c4,
0xa7c80000a7c9,
0xa7ca0000a7cb,
0xa7d10000a7d2,
0xa7d30000a7d4,
0xa7d50000a7d6,
0xa7d70000a7d8,
0xa7d90000a7da,
0xa7f20000a7f5,
0xa7f60000a7f8,
0xa7fa0000a828,
0xa82c0000a82d,
Expand Down Expand Up @@ -1834,9 +1897,16 @@
0x104d8000104fc,
0x1050000010528,
0x1053000010564,
0x10597000105a2,
0x105a3000105b2,
0x105b3000105ba,
0x105bb000105bd,
0x1060000010737,
0x1074000010756,
0x1076000010768,
0x1078000010786,
0x10787000107b1,
0x107b2000107bb,
0x1080000010806,
0x1080800010809,
0x1080a00010836,
Expand Down Expand Up @@ -1876,11 +1946,13 @@
0x10f0000010f1d,
0x10f2700010f28,
0x10f3000010f51,
0x10f7000010f86,
0x10fb000010fc5,
0x10fe000010ff7,
0x1100000011047,
0x1106600011070,
0x1106600011076,
0x1107f000110bb,
0x110c2000110c3,
0x110d0000110e9,
0x110f0000110fa,
0x1110000011135,
Expand Down Expand Up @@ -1934,6 +2006,7 @@
0x117000001171b,
0x1171d0001172c,
0x117300001173a,
0x1174000011747,
0x118000001183b,
0x118c0000118ea,
0x118ff00011907,
Expand All @@ -1952,7 +2025,7 @@
0x11a4700011a48,
0x11a5000011a9a,
0x11a9d00011a9e,
0x11ac000011af9,
0x11ab000011af9,
0x11c0000011c09,
0x11c0a00011c37,
0x11c3800011c41,
Expand All @@ -1977,11 +2050,14 @@
0x11fb000011fb1,
0x120000001239a,
0x1248000012544,
0x12f9000012ff1,
0x130000001342f,
0x1440000014647,
0x1680000016a39,
0x16a4000016a5f,
0x16a6000016a6a,
0x16a7000016abf,
0x16ac000016aca,
0x16ad000016aee,
0x16af000016af5,
0x16b0000016b37,
Expand All @@ -1999,7 +2075,10 @@
0x17000000187f8,
0x1880000018cd6,
0x18d0000018d09,
0x1b0000001b11f,
0x1aff00001aff4,
0x1aff50001affc,
0x1affd0001afff,
0x1b0000001b123,
0x1b1500001b153,
0x1b1640001b168,
0x1b1700001b2fc,
Expand All @@ -2008,12 +2087,15 @@
0x1bc800001bc89,
0x1bc900001bc9a,
0x1bc9d0001bc9f,
0x1cf000001cf2e,
0x1cf300001cf47,
0x1da000001da37,
0x1da3b0001da6d,
0x1da750001da76,
0x1da840001da85,
0x1da9b0001daa0,
0x1daa10001dab0,
0x1df000001df1f,
0x1e0000001e007,
0x1e0080001e019,
0x1e01b0001e022,
Expand All @@ -2023,14 +2105,19 @@
0x1e1300001e13e,
0x1e1400001e14a,
0x1e14e0001e14f,
0x1e2900001e2af,
0x1e2c00001e2fa,
0x1e7e00001e7e7,
0x1e7e80001e7ec,
0x1e7ed0001e7ef,
0x1e7f00001e7ff,
0x1e8000001e8c5,
0x1e8d00001e8d7,
0x1e9220001e94c,
0x1e9500001e95a,
0x1fbf00001fbfa,
0x200000002a6de,
0x2a7000002b735,
0x200000002a6e0,
0x2a7000002b739,
0x2b7400002b81e,
0x2b8200002cea2,
0x2ceb00002ebe1,
Expand Down

0 comments on commit 7aff89a

Please sign in to comment.