[Bf-python] Material setName() problem

Willian Padovani Germano wgermano at ig.com.br
Mon Feb 16 06:07:01 CET 2004


Hi Bob,

----- Original Message -----
From: "Bob Holcomb" <bob_holcomb at hotmail.com>
To: <bf-python at blender.org>
Sent: Sunday, February 15, 2004 1:00 PM
Subject: [Bf-python] Material setName() problem

(...)
> The problem seems to be the format description "s" which tells
> python that the argument needs to be a string that does NOT end
> with a null character.  Could we add a check that examines the
> arguments prior calling this function to check for and remove a null
> character if one exists from arguments?  If that is not feasable,
would
> changing the argument description from "s" to "S" (capital S) fix this
> condition?  Maybe this is the way it is designed and the user should
> do the check themself.  Comments?

Looking at the docs,
http://www.python.org/doc/current/api/arg-parsing.html#l2h-164

maybe s# is a better choice.

But under which circunstances does this problem occur?  Strings parsed
from files, names of materials or objects grabbed from Blender?  I made
a few quick tests now and couldn't get the error.  With scripts also, I
never got this error with strings having embedded null bytes.  If
someway a script manages to get strings with null bytes from files, then
maybe the byte parsing is not being done right.

We'd better hunt it down to something reproducible, if possible.  Do you
have any example script that once in a while triggers the problem, for
example?

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list