diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-10-14 15:43:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-14 15:43:31 (GMT) |
commit | c5b049b91ca50c615f9a5425055c2b79a82ac547 (patch) | |
tree | 7fac1361bbd7bb7ca533f034d800e593b32266b4 /Lib/encodings | |
parent | b4d895336a4692c95b4533adcc5c63a489e5e4e4 (diff) | |
download | cpython-c5b049b91ca50c615f9a5425055c2b79a82ac547.zip cpython-c5b049b91ca50c615f9a5425055c2b79a82ac547.tar.gz cpython-c5b049b91ca50c615f9a5425055c2b79a82ac547.tar.bz2 |
bpo-39337: encodings.normalize_encoding() now ignores non-ASCII characters (GH-22219)
Diffstat (limited to 'Lib/encodings')
-rw-r--r-- | Lib/encodings/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py index ddd5afd..4b37d33 100644 --- a/Lib/encodings/__init__.py +++ b/Lib/encodings/__init__.py @@ -61,7 +61,8 @@ def normalize_encoding(encoding): if c.isalnum() or c == '.': if punct and chars: chars.append('_') - chars.append(c) + if c.isascii(): + chars.append(c) punct = False else: punct = True |