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

called yet: detect bootstrap (startup) issues earlier.
This commit is contained in:
Victor Stinner 2011-03-31 13:39:03 +02:00
parent 7899acfc23
commit 27181ac778
2 changed files with 6 additions and 2 deletions

View File

@ -49,6 +49,9 @@ Core and Builtins
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 #11256: Fix inspect.getcallargs on functions that take only keyword

View File

@ -259,8 +259,9 @@ sys_getfilesystemencoding(PyObject *self)
{
if (Py_FileSystemDefaultEncoding)
return PyUnicode_FromString(Py_FileSystemDefaultEncoding);
Py_INCREF(Py_None);
return Py_None;
PyErr_SetString(PyExc_RuntimeError,
"filesystem encoding is not initialized");
return NULL;
}
PyDoc_STRVAR(getfilesystemencoding_doc,