diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-08-15 09:12:51 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-08-15 09:12:51 (GMT) |
commit | 5fe6de8c72977c794cbc39001ffd21ae7297684a (patch) | |
tree | cca8c38d0c51c135cf5889c6a32163fba1c59e4e /Modules | |
parent | 0b5669c0f55501b59aebafcc704ef397861742ce (diff) | |
download | cpython-5fe6de8c72977c794cbc39001ffd21ae7297684a.zip cpython-5fe6de8c72977c794cbc39001ffd21ae7297684a.tar.gz cpython-5fe6de8c72977c794cbc39001ffd21ae7297684a.tar.bz2 |
Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
using the filesystem encoding and surrogateescape error handler. Patch
written by David Watson.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 087457e..df7cb83 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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 |