diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-09-30 13:38:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-30 13:38:41 (GMT) |
commit | 6537bc9a49d31a3dc7f5df1284285bafdd0f56ef (patch) | |
tree | a62bf9d9587b5c3ceebff37b0da326bf87be6764 /Python/pymath.c | |
parent | 0fbee30f7166a5b75c738e27e506e2f125bad479 (diff) | |
download | cpython-6537bc9a49d31a3dc7f5df1284285bafdd0f56ef.zip cpython-6537bc9a49d31a3dc7f5df1284285bafdd0f56ef.tar.gz cpython-6537bc9a49d31a3dc7f5df1284285bafdd0f56ef.tar.bz2 |
gh-94526: getpath_dirname() no longer encodes the path (GH-97645)
Fix the Python path configuration used to initialized sys.path at
Python startup. Paths are no longer encoded to UTF-8/strict to avoid
encoding errors if it contains surrogate characters (bytes paths are
decoded with the surrogateescape error handler).
getpath_basename() and getpath_dirname() functions no longer encode
the path to UTF-8/strict, but work directly on Unicode strings. These
functions now use PyUnicode_FindChar() and PyUnicode_Substring() on
the Unicode path, rather than strrchr() on the encoded bytes string.
(cherry picked from commit 9f2f1dd131b912e224cd0269adde8879799686c4)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Python/pymath.c')
0 files changed, 0 insertions, 0 deletions