[Python-Dev] 2.2a3 oddities

Jeremy Hylton jeremy@zope.com
Sun, 9 Sep 2001 21:15:13 -0400 (EDT)


I have a better solution for the bug, which I will check in as soon as
I come up with a good testcase.

Here's the long explanation:

The problem was introduced by a refactoring.  convertsimple() used to
be a wrapper that called convertsimple1() and generated an error
message if convertsimple1() returned NULL.  I turned it inside out:
convertsimple() became converterr() and convertsimple1() became
convertsimple().  When the old convertsimple1() returned NULL, the new
convertsimple() calls converterr().

The problem is that the Unicode routines change the value of the arg
variable and set it to NULL if an error occurs.  Then when the error
routine is called, the arg variable is set to NULL.  In the old code,
the error routine used the value of arg in the caller -- so the
assignment in the Unicode path wasn't relevant.

The test for NULL isn't a good solution, because the original value
for arg should be getting passed instead of NULL.

Jeremy