]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 17 Mar 2021 21:11:14 +0000 (14:11 -0700)
committerGitHub <noreply@github.com>
Wed, 17 Mar 2021 21:11:14 +0000 (14:11 -0700)
commitaa967ec4d4c2fc844f8f16b339140b050ae4d5e2
treeab5f15e947070acb95684e29c47b7a3638df27b4
parentdb733761060be92915b5f5cba209dcaada88f94e
bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843)

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>
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