summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-08-15 09:35:13 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-08-15 09:35:13 (GMT)
commit85675994e68263420588a9257cb7450b7138574c (patch)
treea92987e4f24e9b62284dbe9922617197441b68c7 /Modules
parentbae0e623f9e940f72df8e1f097a5b8837544eb03 (diff)
downloadcpython-85675994e68263420588a9257cb7450b7138574c.zip
cpython-85675994e68263420588a9257cb7450b7138574c.tar.gz
cpython-85675994e68263420588a9257cb7450b7138574c.tar.bz2
Merged revisions 84063 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84063 | victor.stinner | 2010-08-15 11:33:08 +0200 (dim., 15 août 2010) | 5 lines Issue #9605: posix.getlogin() decodes the username with file filesystem encoding and surrogateescape error handler. Patch written by David Watson. Reindent also posix_getlogin(), and fix a typo in the NEWS file. ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c7
1 files changed, 3 insertions, 4 deletions
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;