[Python-Dev] Patch 595601

Tim Peters tim@zope.com
Mon, 23 Jun 2003 13:28:35 -0400


    http://www.python.org/sf/595601

has been in limbo a long time.  Looks like it popped up in real life, in
Zope last week.

Quickie:  if you let run this long enough, it will die with a segfault (and
under any version of Python):

"""
import threading

class Worker(threading.Thread):
    def __init__(self, f):
        threading.Thread.__init__(self)
        self.f = f

    def run(self):
        for i in xrange(100):
            self.f.write('abc')

def doit():
    f = file('junk.txt', 'wb')
    w = Worker(f)
    w.start()
    f.close()
    w.join()

if __name__ == '__main__':
    while True:
        print '.',
        doit()
"""

Who here cares?