[PyQt] PyQt v4.5.2 QVariant woes

Hans-Peter Jansen hpj at urpla.net
Wed Jul 22 15:08:43 BST 2009


Hi Phil,

sorry for the delay..

Am Montag, 20. Juli 2009 schrieb Phil Thompson:
> On Sun, 19 Jul 2009 18:35:24 +0200, "Hans-Peter Jansen" <hpj at urpla.net>
>
> wrote:
> > Hi Phil,
> >
> > after updating to 4.5.2, I suffer from a new issue, which is rather
>
> basic.
>
> > According to the changelog, you modified QVariant to not accept None
> > anymore, but would accept None directly, where a QVariant is expected.
>
> This
>
> > is unfortunate, since it breaks my code, but anyway, the second term
> > does
> >
> > not apply to QSettings.value() at least:
> >>>> from PyQt4 import QtCore
> >>>> settings = QtCore.QSettings()
> >>>> settings.value("xxx", None)
> >
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> > TypeError: argument 2 of QSettings.value() has an invalid type
> >
> >
> > probably due to the const'ness of the 2nd QVariant.
> >
> > Is there any grave technical reason to not support the QVariant(None)
> > anymore? I was so convenient to use a special cased None and and having
> > a
> >
> > way to differentiate it with say, empty strings, empty somethings...
>
> Both issues should be fixed in *current* SIP and PyQt snapshots.
>
> The behaviour is slightly different. Before, None was wrapped as a valid
> QVariant which was unwrapped by toPyObject(). Now, None is converted to
> an invalid QVariant which is converted back to None by toPyObject().
> Hopefully you won't notice the difference.

No, that's fine with me, as long I get back what I stick into ;-) 

> If you can confirm you have no remaining problems I'll make a new release
> in a day or two.

Confirmed, all is well now. 

While at it, I noticed, that SUSE applies two patches to PyQt. Both 
attached. While the disable-rpath patch is more of a distribution policy, 
it may be worth an command line option, but the second is useful in general 
I think, as long as some check for the existence of python-config is added. 
What do you think?

Thanks a lot,

Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: disable-rpaths.diff
Type: text/x-diff
Size: 447 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090722/20c6cbb9/disable-rpaths.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: link-python.diff
Type: text/x-diff
Size: 531 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090722/20c6cbb9/link-python.bin


More information about the PyQt mailing list