mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
PyUnicode_EncodeFS() raises an exception if _Py_wchar2char() fails
* Add error_pos optional argument to _Py_wchar2char() * PyUnicode_EncodeFS() raises a UnicodeEncodeError or MemoryError if _Py_wchar2char() fails
This commit is contained in:
parent
0cfba09b09
commit
2f02a51135
4 changed files with 37 additions and 11 deletions
|
@ -646,7 +646,7 @@ Py_Main(int argc, wchar_t **argv)
|
|||
if (fp == NULL) {
|
||||
char *cfilename_buffer;
|
||||
const char *cfilename;
|
||||
cfilename_buffer = _Py_wchar2char(filename);
|
||||
cfilename_buffer = _Py_wchar2char(filename, NULL);
|
||||
if (cfilename_buffer != NULL)
|
||||
cfilename = cfilename_buffer;
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue