xhero.gm at gmail.com
Fri Jul 13 14:49:48 BST 2012
On Thu, Jul 12, 2012 at 11:44 PM, Phil Thompson
<phil at riverbankcomputing.com> wrote:
> On Thu, 12 Jul 2012 21:08:11 +0200, Rodolfo Zitellini <xhero.gm at gmail.com>
>> Hi All,
>> I'm trying to run a pyqt software (frescobaldi,
>> http://frescobaldi.org/) in macos using macports. I have macports
>> 2.1.1 on macosx 10.7.4, xcode 4.3.2 (qt 4.8.2, pyqt 4.9.1, sip 4.13.2,
>> for completeness).
>> My problem, it seems, is that object will never be null but only
>> QPyNullVariant. Eg.:
>> language = QSettings().value("language", "")
>> if language:
>> #do stuff
>> language is never null: it is either the correct class or
>> QPyNullVariant (instead of null!), so it always tests true.
>> I'm asking this here in this list since with the old qt for mac 4.7 it
>> worked. I also tried the same software on linux, with qt 4.8.1 and
>> same pyqt/sip, and it works as is should (i.e. null and not
>> I initially suspected it could be a compilation configuration option,
>> but I could not find anything. Anyone han an idea of what I can be
>> doing wrong?
> I don't know what you mean by null in this context, but ...
> ...may help.
what bugs me most is that Frescobaldi on linux works perfectly, on
macos (same pyhon and lib versions) it crashes on startup:
<PyQt4.QtCore.QPyNullVariant object at 0x10f581980>
Traceback (most recent call last):
File "frescobaldi", line 3, in <module>
line 41, in <module>
import po.setup # Setup language
line 74, in <module>
line 64, in setup
mo = find(language)
line 41, in find
filename = os.path.join(podir, language + ".mo")
TypeError: unsupported operand type(s) for +: 'QPyNullVariant' and 'str'
The offending code is in setup.py, when it reads the language:
language = QSettings().value("language", "")
if not language:
language = locale.getdefaultlocale()
if not language:
language = "C"
in linux, language prints None, on osx it prints QPyNullVariant. it
will then evaluate False in "if not language" and then crash when it
arrives in __init__.py.
This used to work with qt 4.7 on osx. Just upgrading to 4.8 breaks everything.
More information about the PyQt