]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843) (GH-24906)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 29 Mar 2021 19:36:47 +0000 (12:36 -0700)
committerGitHub <noreply@github.com>
Mon, 29 Mar 2021 19:36:47 +0000 (21:36 +0200)
commit3b6e61ee0812359029cac176042d9c835c60f185
tree1822604c7a133ca320ae917e4105a4015e0f74e7
parente9092b221d4951609827e437178a557fd07353af
bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843) (GH-24906)

Python no longer fails at startup with a fatal error if a command
line argument contains an invalid Unicode character.

The Py_DecodeLocale() function now escapes byte sequences which would
be decoded as Unicode characters outside the [U+0000; U+10ffff]
range.

Use MAX_UNICODE constant in unicodeobject.c.
(cherry picked from commit 9976834f807ea63ca51bc4f89be457d734148682)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/test/test_cmd_line.py
Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst [new file with mode: 0644]
Objects/unicodeobject.c
Python/fileutils.c