os.system() inside a thread problem

Daniel Bernhardt daniel.bernhardt at uni-duesseldorf.de
Sat Dec 11 09:57:18 EST 2004


Hello,

my thread calls a program with os.system(). 
> os.system("/usr/bin/wine /path/to/ultima/online.exe")
Ultima Online is starting and i can enter commands and navigate through the
game with my keyboard. If I move the mouse over the Ultima Online window
Ultima Online crashes. (the mouse just need to overlap 1 pixel of the egde
of the window. titlebar inlcuded)
> /usr/bin/wine: line 55: 11675 Segmentation fault
Same with os.popen()

If I run os.system() outside the thread everything is working like expected.
Other programs (wine emulated and nativ) work inside and outside the thread.

Can anyone tell me how I can fix this?
Google told me simillar problems were fixed by upgrading to python 2.4. that
is no option for me. 

Thanks,
Daniel


some example code:

from threading import Thread
runuo = StartUO(command)
runuo.start()

class StartUO(Thread):
    def __init__(self,command):
        Thread.__init__(self)
        self.command = command
    def run(self):
        os.execv(self.command)



More information about the Python-list mailing list