Threading on IRIX 646

Martin Franklin martin.franklin at westgeo.com
Tue Sep 18 12:31:46 CEST 2001


Hi All,

I have a problem with threads on IRIX......  that probably says it all...

I have a Tkinter application that spawns a shell process (os.popen)
like so.

in the GUI code:-

t=threading.Thread(target=cdb.createdb)
t.start()


where cdb.createdb is somthing like :-

def createdb():
    thing=os.popen('long running shell script')
    while 1:
        line=thing.readline()
        if not line: break
        print line


I have redirected stdout to a Pmw.ScrolledTextbox (extended with a write 
method) like so


    def write(self, stuff):
        self.insert('end',stuff)
        self.yview_pickplace('end')

This is OK on Linux, AIX and Solaris (with Python 2.0 BTW + pthreads)

but on IRIX I get:-




Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/lib/python2.0/threading.py",
line 376, in __bootstrap
    self.run()
  File "/usr/local/lib/python2.0/threading.py",
line 364, in run
    apply(self.__target, self.__args, self.__kwargs)
  File "../dev/createdb.py", line 435, in createdb
  File "../dev/MyScrolledText.py", line 44, in write
  File "<string>", line 1, in insert
  File
"/usr/local/lib/python2.0/lib-tk/Tkinter.py",
line 2680, in insert
    self.tk.call((self._w, 'insert', index, chars) + args)
TclError: Nonebad option "0": must be bbox, cget, compare, configure, debug,
delete, dlineinfo, dump, get, image, index, insert, mark, scan, search, see,
tag, window, xview, or yview


What do I do...

For now I have an if trap on sys.platform and avoid using threads on irix 
only...  


Thanks for any help you may give..

Martin











More information about the Python-list mailing list