Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-06-18 16:34:19 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-06-18 16:34:19 +0400
commit35b3736b16bfb604c2eb56eee9afb1a15dbbafea (patch)
tree93d6ecd0f7e249b2bb8f252e8ffe3f3c77312103 /source/blender/python
parenta558eed3e48eb6652e6613e69663fc34af09ac9f (diff)
Fix #31856: movieclips.load(filepath=None) or value crash Blender
Disallow running PyUnicode_EncodeFSDefault for None type which seems to be an issue on Windows.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/generic/py_capi_utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index fd12f7f483d..f487414956c 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -384,7 +384,10 @@ const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
else {
PyErr_Clear();
- if (PyBytes_Check(py_str)) {
+ if (py_str == Py_None) {
+ return NULL;
+ }
+ else if (PyBytes_Check(py_str)) {
return PyBytes_AS_STRING(py_str);
}
else if ((*coerce = PyUnicode_EncodeFSDefault(py_str))) {