[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48030] trunk/blender/source/blender/ python/generic/py_capi_utils.c: Fix #31856: movieclips.load(filepath=None) or value crash Blender

Campbell Barton ideasman42 at gmail.com
Mon Jun 18 14:50:19 CEST 2012


On my system I get:

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
TypeError: BlendDataMovieClips.load(): error with keyword argument
"filepath" -  Function.filepath expected a string type, not NoneType

Could you revert this, Id rather find why windows allows None to be
accepted as a string (thats really crappy and would probably give bugs
elsewhere if its true)

On Mon, Jun 18, 2012 at 2:34 PM, Sergey Sharybin <sergey.vfx at gmail.com> wrote:
> Revision: 48030
>          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48030
> Author:   nazgul
> Date:     2012-06-18 12:34:19 +0000 (Mon, 18 Jun 2012)
> Log Message:
> -----------
> 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.
>
> Modified Paths:
> --------------
>    trunk/blender/source/blender/python/generic/py_capi_utils.c
>
> Modified: trunk/blender/source/blender/python/generic/py_capi_utils.c
> ===================================================================
> --- trunk/blender/source/blender/python/generic/py_capi_utils.c 2012-06-18 12:29:44 UTC (rev 48029)
> +++ trunk/blender/source/blender/python/generic/py_capi_utils.c 2012-06-18 12:34:19 UTC (rev 48030)
> @@ -384,7 +384,10 @@
>        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))) {
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs



-- 
- Campbell


More information about the Bf-committers mailing list