summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-08-15 09:15:02 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-08-15 09:15:02 (GMT)
commitbae0e623f9e940f72df8e1f097a5b8837544eb03 (patch)
tree44d4912c29da9007aa59bd5df82de82a9c72b2ab
parenteb603e0de1875b7597c731a22d293398a812ee42 (diff)
downloadcpython-bae0e623f9e940f72df8e1f097a5b8837544eb03.zip
cpython-bae0e623f9e940f72df8e1f097a5b8837544eb03.tar.gz
cpython-bae0e623f9e940f72df8e1f097a5b8837544eb03.tar.bz2
Merged revisions 84060 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84060 | victor.stinner | 2010-08-15 11:12:51 +0200 (dim., 15 août 2010) | 4 lines Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name using the filesystem encoding and surrogateescape error handler. Patch written by David Watson. ........
-rw-r--r--Misc/NEWS4
-rw-r--r--Modules/posixmodule.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 3432993..81d3e81 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -93,6 +93,10 @@ C-API
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.
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 951323b..6d92544 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1769,7 +1769,7 @@ posix_ttyname(PyObject *self, PyObject *args)
#endif
if (ret == NULL)
return posix_error();
- return PyUnicode_FromString(ret);
+ return PyUnicode_DecodeFSDefault(ret);
}
#endif
@@ -1791,7 +1791,7 @@ posix_ctermid(PyObject *self, PyObject *noargs)
#endif
if (ret == NULL)
return posix_error();
- return PyUnicode_FromString(buffer);
+ return PyUnicode_DecodeFSDefault(buffer);
}
#endif