Skip to content
Snippets Groups Projects
Commit a04367db authored by Manuel Günther's avatar Manuel Günther
Browse files

Propagating Unicode error if existent.

parent ac4bd1ae
No related branches found
No related tags found
1 merge request!23Resolve "What is the use of PyBobIo_FilenameConverter"
Pipeline #
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment