Commit a04367db authored by Manuel Günther's avatar Manuel Günther
Browse files

Propagating Unicode error if existent.

parent ac4bd1ae
Pipeline #12318 passed with stages
in 9 minutes and 59 seconds
......@@ -73,12 +73,14 @@ int PyBobIo_FilenameConverter (PyObject* o, const char** b) {
*b = PyUnicode_AsUTF8(o);
} else {
PyObject* temp = PyObject_Bytes(o);
if (!temp) return 0;
auto temp_ = make_safe(temp);
*b = PyBytes_AsString(temp);
}
#else
if (PyUnicode_Check(o)) {
PyObject* temp = PyUnicode_AsEncodedString(o, Py_FileSystemDefaultEncoding, "strict");
if (!temp) return 0;
auto temp_ = make_safe(temp);
*b = PyString_AsString(temp);
} 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