Message342628
This was my fault for recommending PyErr_SetFromWindowsErrWithUnicodeFilename without checking the header for deprecation.
PyErr_SetFromWindowsErrWithUnicodeFilename is an internal function (added for PEP 277, circa 2.4), which was never documented in the C API. I don't follow why Serhiy deprecated it in 2016, since at the same time he updated it to use PyUnicode_FromWideChar instead of PyUnicode_FromUnicode. I see no fundamental difference in terms of resource usage between it and PyErr_SetExcFromWindowsErrWithFilename, which instead calls PyUnicode_DecodeFSDefault.
In this case, the section object (file mapping) name is useful information in the exception. If the deprecation isn't lifted, it puts the onus on us to implement this functionality -- i.e. PyUnicode_FromWideChar, PyErr_SetExcFromWindowsErrWithFilenameObjects, Py_XDECREF. Or maybe add a new PyErr_SetExcFromWindowsErrWithWideCharFilename function that takes a `const wchar_t *` string, and document it in the C API. |
|
| Date |
User |
Action |
Args |
| 2019-05-16 08:06:17 | eryksun | set | recipients:
+ eryksun, davin, ZackerySpytz |
| 2019-05-16 08:06:17 | eryksun | set | messageid: <[email protected]> |
| 2019-05-16 08:06:17 | eryksun | link | issue36935 messages |
| 2019-05-16 08:06:16 | eryksun | create | |
|