[Python-checkins] r84060 - in python/branches/py3k: Misc/NEWS Modules/posixmodule.c

victor.stinner python-checkins at python.org
Sun Aug 15 11:12:51 CEST 2010


Author: victor.stinner
Date: Sun Aug 15 11:12:51 2010
New Revision: 84060

Log:
Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
using the filesystem encoding and surrogateescape error handler. Patch
written by David Watson.


Modified:
   python/branches/py3k/Misc/NEWS
   python/branches/py3k/Modules/posixmodule.c

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Sun Aug 15 11:12:51 2010
@@ -83,6 +83,10 @@
 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.

Modified: python/branches/py3k/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k/Modules/posixmodule.c	(original)
+++ python/branches/py3k/Modules/posixmodule.c	Sun Aug 15 11:12:51 2010
@@ -1849,7 +1849,7 @@
 #endif
     if (ret == NULL)
         return posix_error();
-    return PyUnicode_FromString(ret);
+    return PyUnicode_DecodeFSDefault(ret);
 }
 #endif
 
@@ -1871,7 +1871,7 @@
 #endif
     if (ret == NULL)
         return posix_error();
-    return PyUnicode_FromString(buffer);
+    return PyUnicode_DecodeFSDefault(buffer);
 }
 #endif
 


More information about the Python-checkins mailing list