[PyKDE] Errors with Python Subinterpreters

Petr Vaněk petr.vanek at ika.cz
Sat Jan 18 15:32:00 GMT 2003


good afternoon...

I've found this one in archive:

--- cut ---
> Since Scribus uses QT, it seems that it's recommended to use PyQt
> for creating some script driven Dialogs.
>
> But... When I run a PyQt-Script the very first time it works perfectly,
> trying it to run a second time or running another script that contains
> import qt or from qt import * it fails with the following error message:
>
> Traceback (most recent call last):
>   File "<string>", line 4, in ?
>   File "/home/franz/PyQtTest.py", line 9, in ?
>     from qt import *
>   File "/usr/local/lib/python2.1/site-packages/qt.py", line 925, in ?
>     libqtc.sipRegisterClasses()
> RuntimeError: SIP - module "qt" implements QObject but it has already been
> implemented
>
> Scribus uses Py_NewInterpreter()  to create a new Python Interpreter
> for every Script that should be run, to ensure that every Script has a
> clean namespace.
>
> Avoiding Py_NewInterpreter() by using everytime the main Python Interpreter
> causes this error on the second run:
>     Fatal Python error: PyThreadState_Get: no current thread
>
> Could you tell me a way how to avoid these errors?

This may need changes to SIP to work properly - but I'm happy to try and get 
this working.

I'm about to disappear for a week or so, I'll look at it more when I get back. 
Feel free to look at it and suggest a patch.
--- cut ---

is this fixed?

-- 
  ------------------------------------------------
  Petr Vanek         [Ty jsi piskal na moji holku?
  petr.vanek at ika.cz  [To muj kocour, to muj kocour!
  ----- www.yarpen.cz --- allmetal.cz ------------
         Kuolema Kaikille (Paitsi Meille)




More information about the PyQt mailing list