Pythons path functions - os.walk(). os.path.exists(). etc support bytes for paths as well as strings, support this with blender/rna too.

- bpy.data.*.load() functions were only accepting UTF-8 paths.
- rna functions/properties now accept byte values rather then strings for file paths.
- bpy.path.resolve_ncase now supports byte objects.
This commit is contained in:
2011-02-01 04:24:47 +00:00
parent b17bbf9d95
commit 0362d19f2d
5 changed files with 11 additions and 8 deletions

View File

@@ -228,6 +228,10 @@ const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
* chars since blender doesnt limit this */
return result;
}
else if(PyBytes_Check(py_str)) {
PyErr_Clear();
return PyBytes_AS_STRING(py_str);
}
else {
/* mostly copied from fileio.c's, fileio_init */
PyObject *stringobj;