bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422)

Python initialization now fails if decoding pybuilddir.txt
configuration file fails at startup.

_PyPathConfig_Calculate() now reports memory allocation failure and
decoding error on decoding pybuilddir.txt content from
UTF-8/surrogateescape.
This commit is contained in:
Victor Stinner 2019-03-19 01:46:25 +01:00 committed by GitHub
parent 7b14f0c02c
commit 5f9cf23502
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 16 deletions

View file

@ -30,7 +30,8 @@ PyAPI_FUNC(int) _Py_EncodeUTF8Ex(
PyAPI_FUNC(wchar_t*) _Py_DecodeUTF8_surrogateescape(
const char *arg,
Py_ssize_t arglen);
Py_ssize_t arglen,
size_t *wlen);
PyAPI_FUNC(int) _Py_GetForceASCII(void);