Kaydet (Commit) 85675994 authored tarafından Victor Stinner's avatar Victor Stinner

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.
........
üst bae0e623
...@@ -93,6 +93,9 @@ C-API ...@@ -93,6 +93,9 @@ C-API
Library 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 - Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
using the filesystem encoding and surrogateescape error handler. Patch using the filesystem encoding and surrogateescape error handler. Patch
written by David Watson. written by David Watson.
......
...@@ -4144,13 +4144,12 @@ posix_getlogin(PyObject *self, PyObject *noargs) ...@@ -4144,13 +4144,12 @@ posix_getlogin(PyObject *self, PyObject *noargs)
name = getlogin(); name = getlogin();
if (name == NULL) { if (name == NULL) {
if (errno) if (errno)
posix_error(); posix_error();
else else
PyErr_SetString(PyExc_OSError, PyErr_SetString(PyExc_OSError, "unable to determine login name");
"unable to determine login name");
} }
else else
result = PyUnicode_FromString(name); result = PyUnicode_DecodeFSDefault(name);
errno = old_errno; errno = old_errno;
return result; return result;
......
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