[PyQt] Goods news about the "menu text missing in PyKDE apps with Oxygen" bug

Simon Edwards simon at simonzone.com
Sat Apr 12 20:27:43 BST 2008


Detlev Offenbach wrote:
> On Donnerstag, 10. April 2008, Simon Edwards wrote:
>> Hello all,
>>
>> Some people here might have crossed paths with the "menu text missing in
>> PyKDE apps with Oxygen" bug. Basically menu labels are not rendered when
>> a PyKDE4 application is used with the Oxygen widget style. After quite a
>> lot of hair-pulling work over the last few days I've figured out what
>> the problem is.
>>
>> First, a solution. Put the following lines in your PyKDE4/__init__.py
>> file in your Python installation's site-packages directory. (typically
>> /lib/python2.5/site-packages/PyKDE4/__init__.py).
>>
>>    import sys, dl
>>    sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
> 
> Python seems to be broken on openSUSE 10.3 64-bit. It doesn't contain the 
> dl.so library. Any help is appreciated.

Looking at the dl docs I see:

"""
Note: This module will not work unless sizeof(int) == sizeof(long) == 
sizeof(char *) If this is not the case, SystemError will be raised on 
import.
"""

That explains why it is not there for 64bit.

Docs for sys.setdlopenflags():

"""
setdlopenflags(  n)
  Set the flags used by the interpreter for dlopen() calls, such as when 
the interpreter loads extension modules. Among other things, this will 
enable a lazy resolving of symbols when importing a module, if called as 
sys.setdlopenflags(0). To share symbols across extension modules, call 
as sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_GLOBAL). Symbolic names for 
the flag modules can be either found in the dl module, or in the DLFCN 
module. If DLFCN is not available, it can be generated from 
/usr/include/dlfcn.h using the h2py script. Availability: Unix. New in 
version 2.2.
"""

Try this:

     import sys,DLFCN
     sys.setdlopenflags(DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
simon at simonzone.com       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."


More information about the PyQt mailing list