mirror of
https://github.com/python/cpython.git
synced 2025-10-15 11:22:18 +00:00
PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
PyUnicode_FromString() to support surrogates in the filename and use the right encoding
This commit is contained in:
parent
b9a20ad036
commit
0964ee1cf5
2 changed files with 5 additions and 1 deletions
|
@ -12,6 +12,10 @@ What's New in Python 3.2 Alpha 1?
|
||||||
Core and Builtins
|
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
|
- PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handler
|
||||||
|
|
||||||
- Issue #8419: Prevent the dict constructor from accepting non-string keyword
|
- 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)
|
if (stream == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (name != NULL) {
|
if (name != NULL) {
|
||||||
nameobj = PyUnicode_FromString(name);
|
nameobj = PyUnicode_DecodeFSDefault(name);
|
||||||
if (nameobj == NULL)
|
if (nameobj == NULL)
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue