Skip to content

Commit bae0e62

Browse files
author
Victor Stinner
committed
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. ........
1 parent eb603e0 commit bae0e62

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ C-API
9393
Library
9494
-------
9595

96+
- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
97+
using the filesystem encoding and surrogateescape error handler. Patch
98+
written by David Watson.
99+
96100
- Issue #8688: MANIFEST files created by distutils now include a magic
97101
comment indicating they are generated. Manually maintained MANIFESTs
98102
without this marker will not be overwritten or removed.

Modules/posixmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,7 @@ posix_ttyname(PyObject *self, PyObject *args)
17691769
#endif
17701770
if (ret == NULL)
17711771
return posix_error();
1772-
return PyUnicode_FromString(ret);
1772+
return PyUnicode_DecodeFSDefault(ret);
17731773
}
17741774
#endif
17751775

@@ -1791,7 +1791,7 @@ posix_ctermid(PyObject *self, PyObject *noargs)
17911791
#endif
17921792
if (ret == NULL)
17931793
return posix_error();
1794-
return PyUnicode_FromString(buffer);
1794+
return PyUnicode_DecodeFSDefault(buffer);
17951795
}
17961796
#endif
17971797

0 commit comments

Comments
 (0)