]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843)
authorVictor Stinner <vstinner@python.org>
Wed, 17 Mar 2021 20:46:53 +0000 (21:46 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Mar 2021 20:46:53 +0000 (21:46 +0100)
commit9976834f807ea63ca51bc4f89be457d734148682
tree2ed6ca7dd002f141e1a2ade2e5dd502514ae29f0
parent6086ae7fd4aeb4089282189673f9bd0cc33abf9b
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.
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