Ticket #30 (closed defect: fixed)

Opened 9 months ago

Last modified 4 months ago

Threading and stdout_capture.py

Reported by: jwienke@techfak.uni-bielefeld.de Assigned to:
Priority: blocker Keywords: threading, sysout, print
Cc:

Description

I was trying out how well reinteract supports threading and noticed the following behaviour for this small code snippet:

from threading import Thread
class TestThread(Thread):
    def run(self):
        print "foo"
t = TestThread()
t.start()

After some time this results in the following errors on the console:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "<syntax-tree>", line 2, in run
  File "/home/languitar/Desktop/reinteract/lib/reinteract/stdout_capture.py", line 17, in write
    self.current.write(str)
  File "/home/languitar/Desktop/reinteract/lib/reinteract/stdout_capture.py", line 17, in write
    self.current.write(str)

....

  File "/home/languitar/Desktop/reinteract/lib/reinteract/stdout_capture.py", line 17, in write
    self.current.write(str)
  File "/home/languitar/Desktop/reinteract/lib/reinteract/stdout_capture.py", line 17, in write
    self.current.write(str)
RuntimeError: maximum recursion depth exceeded

I'm not really sure, how Reinteract should react on such a situation but this error message seems to be wrong, nevertheless.

Change History

08/10/08 22:13:04 changed by otaylor

  • status changed from new to closed.
  • resolution set to fixed.
  • summary changed from Threading and Reinteract to Threading and stdout_capture.py.

Fixed the particular bug at hand:

http://git.fishsoup.net/cgit/reinteract/commit/?id=3e14c93a4fcaa93ec18999b4d87743003ad7c284

I don't think threading and reinteract will do much useful, except in limited cases like a side-effect free function that uses threads internally. Most of the time I'd expect threading to confuse reinteract badly.