Commit 0964ee1c authored by Victor Stinner's avatar Victor Stinner

PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of

PyUnicode_FromString() to support surrogates in the filename and use the right
encoding
parent b9a20ad0
......@@ -12,6 +12,10 @@ What's New in Python 3.2 Alpha 1?
Core and Builtins
-----------------
- PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
PyUnicode_FromString() to support surrogates in the filename and use the
right encoding
- PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handler
- Issue #8419: Prevent the dict constructor from accepting non-string keyword
......
......@@ -41,7 +41,7 @@ PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding,
if (stream == NULL)
return NULL;
if (name != NULL) {
nameobj = PyUnicode_FromString(name);
nameobj = PyUnicode_DecodeFSDefault(name);
if (nameobj == NULL)
PyErr_Clear();
else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment