diff options
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Modules/posixmodule.c | 7 |
2 files changed, 6 insertions, 4 deletions
@@ -93,6 +93,9 @@ C-API Library ------- +- Issue #9605: posix.getlogin() decodes the username with file filesystem + encoding and surrogateescape error handler. Patch written by David Watson. + - Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name using the filesystem encoding and surrogateescape error handler. Patch written by David Watson. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 6d92544..ef91dab 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -4144,13 +4144,12 @@ posix_getlogin(PyObject *self, PyObject *noargs) name = getlogin(); if (name == NULL) { if (errno) - posix_error(); + posix_error(); else - PyErr_SetString(PyExc_OSError, - "unable to determine login name"); + PyErr_SetString(PyExc_OSError, "unable to determine login name"); } else - result = PyUnicode_FromString(name); + result = PyUnicode_DecodeFSDefault(name); errno = old_errno; return result; |