idna 3.6__tar.gz → 3.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
idna-3.7/HISTORY.rst ADDED
@@ -0,0 +1,238 @@
1
+ .. :changelog:
2
+
3
+ History
4
+ -------
5
+
6
+ 3.7 (2024-04-11)
7
+ ++++++++++++++++
8
+
9
+ - Fix issue where specially crafted inputs to encode() could
10
+ take exceptionally long amount of time to process. [CVE-2024-3651]
11
+
12
+ Thanks to Guido Vranken for reporting the issue.
13
+
14
+ 3.6 (2023-11-25)
15
+ ++++++++++++++++
16
+
17
+ - Fix regression to include tests in source distribution.
18
+
19
+ 3.5 (2023-11-24)
20
+ ++++++++++++++++
21
+
22
+ - Update to Unicode 15.1.0
23
+ - String codec name is now "idna2008" as overriding the system codec
24
+ "idna" was not working.
25
+ - Fix typing error for codec encoding
26
+ - "setup.cfg" has been added for this release due to some downstream
27
+ lack of adherence to PEP 517. Should be removed in a future release
28
+ so please prepare accordingly.
29
+ - Removed reliance on a symlink for the "idna-data" tool to comport
30
+ with PEP 517 and the Python Packaging User Guide for sdist archives.
31
+ - Added security reporting protocol for project
32
+
33
+ Thanks Jon Ribbens, Diogo Teles Sant'Anna, Wu Tingfeng for contributions
34
+ to this release.
35
+
36
+ 3.4 (2022-09-14)
37
+ ++++++++++++++++
38
+
39
+ - Update to Unicode 15.0.0
40
+ - Migrate to pyproject.toml for build information (PEP 621)
41
+ - Correct another instance where generic exception was raised instead of
42
+ IDNAError for malformed input
43
+ - Source distribution uses zeroized file ownership for improved
44
+ reproducibility
45
+
46
+ Thanks to Seth Michael Larson for contributions to this release.
47
+
48
+ 3.3 (2021-10-13)
49
+ ++++++++++++++++
50
+
51
+ - Update to Unicode 14.0.0
52
+ - Update to in-line type annotations
53
+ - Throw IDNAError exception correctly for some malformed input
54
+ - Advertise support for Python 3.10
55
+ - Improve testing regime on Github
56
+ - Fix Russian typo in documentation
57
+
58
+ Thanks to Jon Defresne, Hugo van Kemenade, Seth Michael Larson,
59
+ Patrick Ventuzelo and Boris Verhovsky for contributions to this
60
+ release.
61
+
62
+ 3.2 (2021-05-29)
63
+ ++++++++++++++++
64
+
65
+ - Add type hints (Thanks, Seth Michael Larson!)
66
+ - Remove support for Python 3.4
67
+
68
+ 3.1 (2021-01-04)
69
+ ++++++++++++++++
70
+
71
+ - Ensure license is included in package (Thanks, Julien Schueller)
72
+ - No longer mark wheel has universal (Thanks, Matthieu Darbois)
73
+ - Test on PowerPC using Travis CI
74
+
75
+ 3.0 (2021-01-01)
76
+ ++++++++++++++++
77
+
78
+ - Python 2 is no longer supported (the 2.x branch supports Python 2,
79
+ use "idna<3" in your requirements file if you need Python 2 support)
80
+ - Support for V2 UTS 46 test vectors.
81
+
82
+ 2.10 (2020-06-27)
83
+ +++++++++++++++++
84
+
85
+ - Update to Unicode 13.0.0.
86
+ - Throws a more specific exception if "xn--" is provided as a label.
87
+ - This is expected to be the last version that supports Python 2.
88
+
89
+ 2.9 (2020-02-16)
90
+ ++++++++++++++++
91
+
92
+ - Update to Unicode 12.1.0.
93
+ - Prohibit A-labels ending with a hyphen (Thanks, Julien Bernard!)
94
+ - Future-proofing: Test on Python 3.7 and 3.8, don't immediately
95
+ fail should Python 4 come along.
96
+ - Made BSD 3-clause license clearer
97
+
98
+ 2.8 (2018-12-04)
99
+ ++++++++++++++++
100
+
101
+ - Update to Unicode 11.0.0.
102
+ - Provide more specific exceptions for some malformed labels.
103
+
104
+ 2.7 (2018-06-10)
105
+ ++++++++++++++++
106
+
107
+ - Update to Unicode 10.0.0.
108
+ - No longer accepts dot-prefixed domains (e.g. ".example") as valid.
109
+ This is to be more conformant with the UTS 46 spec. Users should
110
+ strip dot prefixes from domains before processing.
111
+
112
+ 2.6 (2017-08-08)
113
+ ++++++++++++++++
114
+
115
+ - Allows generation of IDNA and UTS 46 table data for different
116
+ versions of Unicode, by deriving properties directly from
117
+ Unicode data.
118
+ - Ability to generate RFC 5892/IANA-style table data
119
+ - Diagnostic output of IDNA-related Unicode properties and
120
+ derived calculations for a given codepoint
121
+ - Support for idna.__version__ to report version
122
+ - Support for idna.idnadata.__version__ and
123
+ idna.uts46data.__version__ to report Unicode version of
124
+ underlying IDNA and UTS 46 data respectively.
125
+
126
+ 2.5 (2017-03-07)
127
+ ++++++++++++++++
128
+
129
+ - Fix bug with Katakana middle dot context-rule (Thanks, Greg
130
+ Shikhman.)
131
+
132
+ 2.4 (2017-03-01)
133
+ ++++++++++++++++
134
+
135
+ - Restore IDNAError to be a subclass of UnicodeError, as some users of
136
+ this library are only looking for the latter to catch invalid strings.
137
+
138
+ 2.3 (2017-02-28)
139
+ ++++++++++++++++
140
+
141
+ - Fix bugs relating to deriving IDNAError from UnicodeError.
142
+ - More memory footprint improvements (Thanks, Alex Gaynor)
143
+
144
+ 2.2 (2016-12-21)
145
+ ++++++++++++++++
146
+
147
+ - Made some changes to the UTS 46 data that should allow Jython to get around
148
+ 64kb Java class limits. (Thanks, John A. Booth and Marcin Płonka.)
149
+ - In Python 2.6, skip two tests that rely on data not present in that
150
+ Python version's unicodedata module.
151
+ - Use relative imports to help downstream users.
152
+
153
+ 2.1 (2016-03-20)
154
+ ++++++++++++++++
155
+
156
+ - Memory consumption optimizations. The library should consume significantly
157
+ less memory through smarter data structures being used to represent
158
+ relevant Unicode properties. Many thanks to Shivaram Lingamneni for this
159
+ patch.
160
+ - Patches to make library work better with Python 2.6. The core library
161
+ currently works however the unit testing does not. (Thanks, Robert
162
+ Buchholz)
163
+ - Better affix all Unicode codepoint properties to a specific version.
164
+
165
+ 2.0 (2015-05-18)
166
+ ++++++++++++++++
167
+
168
+ - Added support for Unicode IDNA Compatibility Processing (aka Unicode
169
+ Technical Standard #46). Big thanks to Jon Ribbens who contributed this
170
+ functionality.
171
+
172
+ 1.1 (2015-01-27)
173
+ ++++++++++++++++
174
+
175
+ - Use IDNA properties from Unicode 6.3.0. Internet Architecture Board (IAB)
176
+ issued statement recommending against the use of Unicode 7.0.0 until
177
+ issues relating to U+08A1 codepoint are resolved. See http://goo.gl/Ed1n0K
178
+ - Identify some cases when label would be too longer to be a legal DNS name
179
+ and raise an exception. (Thanks, Ed Lewis)
180
+
181
+ 1.0 (2014-10-12)
182
+ ++++++++++++++++
183
+
184
+ - Update IDNA properties for Unicode 7.0.0.
185
+
186
+ 0.9 (2014-07-18)
187
+ ++++++++++++++++
188
+
189
+ - Fix issue with non-UTF-8 environments reading the README file
190
+ now that it contains non-ASCII. (Thanks, Tom Prince)
191
+ - Codec functions are useful, so they are separated into their own
192
+ module, rather than just existing for compatibility reasons.
193
+ - Add LICENSE file.
194
+
195
+ 0.8 (2014-07-09)
196
+ ++++++++++++++++
197
+
198
+ - Added MANIFEST.in for correct source distribution compilation.
199
+
200
+ 0.7 (2014-07-09)
201
+ ++++++++++++++++
202
+
203
+ - Filled out missing tests for various functions.
204
+ - Fix bug in CONTEXTO validation for Greek lower numeral sign (U+0375)
205
+ - Fix bug in CONTEXTO validation for Japanese middle dot (U+30FB)
206
+ - Improved documentation
207
+ - Move designation to Stable
208
+
209
+ 0.6 (2014-04-29)
210
+ ++++++++++++++++
211
+
212
+ - Minor improvements to Python 3 support, tests (Thanks, Derek Wilson)
213
+
214
+ 0.5 (2014-02-05)
215
+ ++++++++++++++++
216
+
217
+ - Update IDNA properties for Unicode 6.3.0.
218
+
219
+ 0.4 (2014-01-07)
220
+ ++++++++++++++++
221
+
222
+ - Fix trove classifier for Python 3. (Thanks, Hynek Schlawack)
223
+
224
+ 0.3 (2013-07-18)
225
+ ++++++++++++++++
226
+
227
+ - Ported to Python 3.
228
+
229
+ 0.2 (2013-07-16)
230
+ ++++++++++++++++
231
+
232
+ - Improve packaging.
233
+ - More conformant, passes all relevant tests in the Unicode TR46 test suite.
234
+
235
+ 0.1 (2013-05-27)
236
+ ++++++++++++++++
237
+
238
+ - First proof-of-concept version.
@@ -1,6 +1,6 @@
1
1
  BSD 3-Clause License
2
2
 
3
- Copyright (c) 2013-2023, Kim Davies and contributors.
3
+ Copyright (c) 2013-2024, Kim Davies and contributors.
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: idna
3
- Version: 3.6
3
+ Version: 3.7
4
4
  Summary: Internationalized Domain Names in Applications (IDNA)
5
5
  Author-email: Kim Davies <kim+pypi@gumleaf.org>
6
6
  Requires-Python: >=3.5
@@ -150,9 +150,11 @@ def valid_contextj(label: str, pos: int) -> bool:
150
150
  joining_type = idnadata.joining_types.get(ord(label[i]))
151
151
  if joining_type == ord('T'):
152
152
  continue
153
- if joining_type in [ord('L'), ord('D')]:
153
+ elif joining_type in [ord('L'), ord('D')]:
154
154
  ok = True
155
155
  break
156
+ else:
157
+ break
156
158
 
157
159
  if not ok:
158
160
  return False
@@ -162,9 +164,11 @@ def valid_contextj(label: str, pos: int) -> bool:
162
164
  joining_type = idnadata.joining_types.get(ord(label[i]))
163
165
  if joining_type == ord('T'):
164
166
  continue
165
- if joining_type in [ord('R'), ord('D')]:
167
+ elif joining_type in [ord('R'), ord('D')]:
166
168
  ok = True
167
169
  break
170
+ else:
171
+ break
168
172
  return ok
169
173
 
170
174
  if cp_value == 0x200d:
@@ -236,12 +240,8 @@ def check_label(label: Union[str, bytes, bytearray]) -> None:
236
240
  if intranges_contain(cp_value, idnadata.codepoint_classes['PVALID']):
237
241
  continue
238
242
  elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTJ']):
239
- try:
240
- if not valid_contextj(label, pos):
241
- raise InvalidCodepointContext('Joiner {} not allowed at position {} in {}'.format(
242
- _unot(cp_value), pos+1, repr(label)))
243
- except ValueError:
244
- raise IDNAError('Unknown codepoint adjacent to joiner {} at position {} in {}'.format(
243
+ if not valid_contextj(label, pos):
244
+ raise InvalidCodepointContext('Joiner {} not allowed at position {} in {}'.format(
245
245
  _unot(cp_value), pos+1, repr(label)))
246
246
  elif intranges_contain(cp_value, idnadata.codepoint_classes['CONTEXTO']):
247
247
  if not valid_contexto(label, pos):
@@ -262,13 +262,8 @@ def alabel(label: str) -> bytes:
262
262
  except UnicodeEncodeError:
263
263
  pass
264
264
 
265
- if not label:
266
- raise IDNAError('No Input')
267
-
268
- label = str(label)
269
265
  check_label(label)
270
- label_bytes = _punycode(label)
271
- label_bytes = _alabel_prefix + label_bytes
266
+ label_bytes = _alabel_prefix + _punycode(label)
272
267
 
273
268
  if not valid_label_length(label_bytes):
274
269
  raise IDNAError('Label too long')