mirror of
https://github.com/python/cpython.git
synced 2025-08-26 19:55:24 +00:00
Closes #27781: Removes special cases for the experimental aspect of PEP 529
This commit is contained in:
commit
257a4c1503
4 changed files with 5 additions and 24 deletions
|
@ -3832,18 +3832,9 @@ PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
|
|||
cannot only rely on it: check also interp->fscodec_initialized for
|
||||
subinterpreters. */
|
||||
if (Py_FileSystemDefaultEncoding && interp->fscodec_initialized) {
|
||||
PyObject *res = PyUnicode_Decode(s, size,
|
||||
return PyUnicode_Decode(s, size,
|
||||
Py_FileSystemDefaultEncoding,
|
||||
Py_FileSystemDefaultEncodeErrors);
|
||||
#ifdef MS_WINDOWS
|
||||
if (!res && PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) {
|
||||
_PyErr_FormatFromCause(PyExc_RuntimeError,
|
||||
"filesystem path bytes were not correctly encoded with '%s'. "
|
||||
"Please report this at http://bugs.python.org/issue27781",
|
||||
Py_FileSystemDefaultEncoding);
|
||||
}
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
else {
|
||||
return PyUnicode_DecodeLocaleAndSize(s, size, Py_FileSystemDefaultEncodeErrors);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue