Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name

using the filesystem encoding and surrogateescape error handler. Patch
written by David Watson.
This commit is contained in:
Victor Stinner 2010-08-15 09:12:51 +00:00
parent 0b5669c0f5
commit 5fe6de8c72
2 changed files with 6 additions and 2 deletions

View File

@ -83,6 +83,10 @@ Extensions
Library
-------
- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
using the filesystem encoding and surrogateescape error handler. Patch
written by David Watson.
- Issue #8688: MANIFEST files created by distutils now include a magic
comment indicating they are generated. Manually maintained MANIFESTs
without this marker will not be overwritten or removed.

View File

@ -1849,7 +1849,7 @@ posix_ttyname(PyObject *self, PyObject *args)
#endif
if (ret == NULL)
return posix_error();
return PyUnicode_FromString(ret);
return PyUnicode_DecodeFSDefault(ret);
}
#endif
@ -1871,7 +1871,7 @@ posix_ctermid(PyObject *self, PyObject *noargs)
#endif
if (ret == NULL)
return posix_error();
return PyUnicode_FromString(buffer);
return PyUnicode_DecodeFSDefault(buffer);
}
#endif