Commit 5fe6de8c authored by Victor Stinner's avatar Victor Stinner

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

using the filesystem encoding and surrogateescape error handler. Patch
written by David Watson.
parent 0b5669c0
...@@ -83,6 +83,10 @@ Extensions ...@@ -83,6 +83,10 @@ Extensions
Library 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 - Issue #8688: MANIFEST files created by distutils now include a magic
comment indicating they are generated. Manually maintained MANIFESTs comment indicating they are generated. Manually maintained MANIFESTs
without this marker will not be overwritten or removed. without this marker will not be overwritten or removed.
......
...@@ -1849,7 +1849,7 @@ posix_ttyname(PyObject *self, PyObject *args) ...@@ -1849,7 +1849,7 @@ posix_ttyname(PyObject *self, PyObject *args)
#endif #endif
if (ret == NULL) if (ret == NULL)
return posix_error(); return posix_error();
return PyUnicode_FromString(ret); return PyUnicode_DecodeFSDefault(ret);
} }
#endif #endif
...@@ -1871,7 +1871,7 @@ posix_ctermid(PyObject *self, PyObject *noargs) ...@@ -1871,7 +1871,7 @@ posix_ctermid(PyObject *self, PyObject *noargs)
#endif #endif
if (ret == NULL) if (ret == NULL)
return posix_error(); return posix_error();
return PyUnicode_FromString(buffer); return PyUnicode_DecodeFSDefault(buffer);
} }
#endif #endif
......
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