Commit 27181ac7 authored by Victor Stinner's avatar Victor Stinner

sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not

called yet: detect bootstrap (startup) issues earlier.
parent 7899acfc
...@@ -49,6 +49,9 @@ Core and Builtins ...@@ -49,6 +49,9 @@ Core and Builtins
Library Library
------- -------
- sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not
called yet: detect bootstrap (startup) issues earlier.
- Issue #11618: Fix the timeout logic in threading.Lock.acquire() under Windows. - Issue #11618: Fix the timeout logic in threading.Lock.acquire() under Windows.
- Issue #11256: Fix inspect.getcallargs on functions that take only keyword - Issue #11256: Fix inspect.getcallargs on functions that take only keyword
......
...@@ -259,8 +259,9 @@ sys_getfilesystemencoding(PyObject *self) ...@@ -259,8 +259,9 @@ sys_getfilesystemencoding(PyObject *self)
{ {
if (Py_FileSystemDefaultEncoding) if (Py_FileSystemDefaultEncoding)
return PyUnicode_FromString(Py_FileSystemDefaultEncoding); return PyUnicode_FromString(Py_FileSystemDefaultEncoding);
Py_INCREF(Py_None); PyErr_SetString(PyExc_RuntimeError,
return Py_None; "filesystem encoding is not initialized");
return NULL;
} }
PyDoc_STRVAR(getfilesystemencoding_doc, PyDoc_STRVAR(getfilesystemencoding_doc,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment