Skip to content

Commit 279a962

Browse files
authored
bpo-30736: upgrade to Unicode 10.0 (#2344)
Straightforward. While we're at it, though, strip trailing whitespace from generated tables.
1 parent b066edf commit 279a962

File tree

11 files changed

+34581
-33452
lines changed

11 files changed

+34581
-33452
lines changed

Doc/library/stdtypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ Notes:
354354
The numeric literals accepted include the digits ``0`` to ``9`` or any
355355
Unicode equivalent (code points with the ``Nd`` property).
356356

357-
See http://www.unicode.org/Public/8.0.0/ucd/extracted/DerivedNumericType.txt
357+
See http://www.unicode.org/Public/10.0.0/ucd/extracted/DerivedNumericType.txt
358358
for a complete list of code points with the ``Nd`` property.
359359

360360

Doc/library/unicodedata.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
This module provides access to the Unicode Character Database (UCD) which
1919
defines character properties for all Unicode characters. The data contained in
20-
this database is compiled from the `UCD version 9.0.0
21-
<http://www.unicode.org/Public/9.0.0/ucd>`_.
20+
this database is compiled from the `UCD version 10.0.0
21+
<http://www.unicode.org/Public/10.0.0/ucd>`_.
2222

2323
The module uses the same names and symbols as defined by Unicode
2424
Standard Annex #44, `"Unicode Character Database"
@@ -168,6 +168,6 @@ Examples:
168168

169169
.. rubric:: Footnotes
170170

171-
.. [#] http://www.unicode.org/Public/9.0.0/ucd/NameAliases.txt
171+
.. [#] http://www.unicode.org/Public/10.0.0/ucd/NameAliases.txt
172172
173-
.. [#] http://www.unicode.org/Public/9.0.0/ucd/NamedSequences.txt
173+
.. [#] http://www.unicode.org/Public/10.0.0/ucd/NamedSequences.txt

Doc/reference/lexical_analysis.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ The Unicode category codes mentioned above stand for:
313313
* *Nd* - decimal numbers
314314
* *Pc* - connector punctuations
315315
* *Other_ID_Start* - explicit list of characters in `PropList.txt
316-
<http://www.unicode.org/Public/8.0.0/ucd/PropList.txt>`_ to support backwards
316+
<http://www.unicode.org/Public/10.0.0/ucd/PropList.txt>`_ to support backwards
317317
compatibility
318318
* *Other_ID_Continue* - likewise
319319

@@ -875,4 +875,4 @@ occurrence outside string literals and comments is an unconditional error:
875875
876876
.. rubric:: Footnotes
877877

878-
.. [#] http://www.unicode.org/Public/8.0.0/ucd/NameAliases.txt
878+
.. [#] http://www.unicode.org/Public/10.0.0/ucd/NameAliases.txt

Doc/whatsnew/3.7.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,13 @@ xmlrpc.server
237237
its subclasses can be used as a decorator. (Contributed by Xiang Zhang in
238238
:issue:`7769`.)
239239

240+
unicodedata
241+
-----------
242+
243+
The internal :mod:`unicodedata` database has been upgraded to use `Unicode 10
244+
<http://www.unicode.org/versions/Unicode10.0.0/>`_. (Contributed by Benjamin
245+
Peterson.)
246+
240247
urllib.parse
241248
------------
242249

Lib/test/test_unicodedata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class UnicodeMethodsTest(unittest.TestCase):
2121

2222
# update this, if the database changes
23-
expectedchecksum = 'c1fa98674a683aa8a8d8dee0c84494f8d36346e6'
23+
expectedchecksum = '727091e0fd5807eb41c72912ae95cdd74c795e27'
2424

2525
def test_method_checksum(self):
2626
h = hashlib.sha1()
@@ -80,7 +80,7 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
8080

8181
# Update this if the database changes. Make sure to do a full rebuild
8282
# (e.g. 'make distclean && make') to get the correct checksum.
83-
expectedchecksum = 'f891b1e6430c712531b9bc935a38e22d78ba1bf3'
83+
expectedchecksum = 'db6f92bb5010f8e85000634b08e77233355ab37a'
8484
def test_function_checksum(self):
8585
data = []
8686
h = hashlib.sha1()

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 3.7.0 alpha 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- bpo-30736: The internal unicodedata database has been upgraded to Unicode
14+
10.0.
15+
1316
- bpo-30604: Move co_extra_freefuncs from per-thread to per-interpreter to
1417
avoid crashes.
1518

Modules/unicodedata.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,11 +921,12 @@ is_unified_ideograph(Py_UCS4 code)
921921
{
922922
return
923923
(0x3400 <= code && code <= 0x4DB5) || /* CJK Ideograph Extension A */
924-
(0x4E00 <= code && code <= 0x9FD5) || /* CJK Ideograph */
924+
(0x4E00 <= code && code <= 0x9FEA) || /* CJK Ideograph */
925925
(0x20000 <= code && code <= 0x2A6D6) || /* CJK Ideograph Extension B */
926926
(0x2A700 <= code && code <= 0x2B734) || /* CJK Ideograph Extension C */
927927
(0x2B740 <= code && code <= 0x2B81D) || /* CJK Ideograph Extension D */
928-
(0x2B820 <= code && code <= 0x2CEA1); /* CJK Ideograph Extension E */
928+
(0x2B820 <= code && code <= 0x2CEA1) || /* CJK Ideograph Extension E */
929+
(0x2CEB0 <= code && code <= 0x2EBEF); /* CJK Ideograph Extension F */
929930
}
930931

931932
/* macros used to determine if the given code point is in the PUA range that

Modules/unicodedata_db.h

Lines changed: 6630 additions & 6568 deletions
Large diffs are not rendered by default.

Modules/unicodename_db.h

Lines changed: 25629 additions & 24607 deletions
Large diffs are not rendered by default.

Objects/unicodetype_db.h

Lines changed: 2295 additions & 2262 deletions
Large diffs are not rendered by default.

Tools/unicode/makeunicodedata.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# * Doc/library/stdtypes.rst, and
4343
# * Doc/library/unicodedata.rst
4444
# * Doc/reference/lexical_analysis.rst (two occurrences)
45-
UNIDATA_VERSION = "9.0.0"
45+
UNIDATA_VERSION = "10.0.0"
4646
UNICODE_DATA = "UnicodeData%s.txt"
4747
COMPOSITION_EXCLUSIONS = "CompositionExclusions%s.txt"
4848
EASTASIAN_WIDTH = "EastAsianWidth%s.txt"
@@ -99,11 +99,12 @@
9999
# these ranges need to match unicodedata.c:is_unified_ideograph
100100
cjk_ranges = [
101101
('3400', '4DB5'),
102-
('4E00', '9FD5'),
102+
('4E00', '9FEA'),
103103
('20000', '2A6D6'),
104104
('2A700', '2B734'),
105105
('2B740', '2B81D'),
106106
('2B820', '2CEA1'),
107+
('2CEB0', '2EBE0'),
107108
]
108109

109110
def maketables(trace=0):
@@ -1262,12 +1263,12 @@ def dump(self, file, trace=0):
12621263
for item in self.data:
12631264
i = str(item) + ", "
12641265
if len(s) + len(i) > 78:
1265-
file.write(s + "\n")
1266+
file.write(s.rstrip() + "\n")
12661267
s = " " + i
12671268
else:
12681269
s = s + i
12691270
if s.strip():
1270-
file.write(s + "\n")
1271+
file.write(s.rstrip() + "\n")
12711272
file.write("};\n\n")
12721273

12731274
def getsize(data):

0 commit comments

Comments
 (0)