[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] Re: New bug in SIP
From: Phil Thompson <phil () riverbankcomputing ! co ! uk>
Date: 2008-05-30 10:32:28
Message-ID: 200805301132.28250.phil () riverbankcomputing ! co ! uk
[Download RAW message or body]
On Wednesday 28 May 2008 3:39:11 pm Giovanni Bajo wrote:
> Hi Phil,
>
> I found a new bug in SIP (it used to work with a SIP from September 2007).
>
> If you declare a class with a single constructor, you write %MethodCode
> for that constructor, and you make it raise an exception (PyErr_Format)
> and set sipIsErr=1, the exception is not propagated to Python: it gets
> "swallowed" and changed into an AttributeError which says "... is a
> private method".
>
> Basically, this code in sipWrapper_init, line 7173:
>
> /*
> * If the arguments were parsed without error then assume an
> * exception has already been raised for why the instance
> * wasn't created.
> */
> if (pstate == PARSE_OK)
> argsparsed = PARSE_RAISED;
>
>
> is not executed, because pstate was already mutated a few lines above:
>
>
> /*
> * If the parse was successful but no C/C++ object was
> created then
> * we assume that handwritten code decided after the parse
> that * it didn't want to handle the signature.
> */
> if (pstate == PARSE_OK)
> pstate = PARSE_TYPE;
>
>
> I was wondering if it should check "argsparsed == PARSE_OK" (at line
> 7173) instead of "pstate == PARSE_OK".
>
> Thanks!
I think the bug is that the earlier code should be...
if (pstate == PARSE_OK)
pstate = argsparsed = PARSE_TYPE;
Phil
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic