]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 84060 via svnmerge from
authorVictor Stinner <victor.stinner@haypocalc.com>
Sun, 15 Aug 2010 09:15:02 +0000 (09:15 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Sun, 15 Aug 2010 09:15:02 +0000 (09:15 +0000)
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.
........

Misc/NEWS
Modules/posixmodule.c

index 343299334636c53e2704cbd93d9a94a4c5d2d5b1..81d3e81c543cea83d91bbca2baac84b9a8afbad3 100644 (file)
--- 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.
index 951323bc91a05300c4db262362073ba2256fc1a8..6d92544982cdb14aa9d71bf27e46dabd5dfdfeb1 100644 (file)
@@ -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