]> granicus.if.org Git - python/commitdiff
Add a crasher for the thread-unsafety of file objects.
authorGeorg Brandl <georg@python.org>
Tue, 28 Aug 2007 18:54:44 +0000 (18:54 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 28 Aug 2007 18:54:44 +0000 (18:54 +0000)
Lib/test/crashers/file_threads.py [new file with mode: 0644]

diff --git a/Lib/test/crashers/file_threads.py b/Lib/test/crashers/file_threads.py
new file mode 100644 (file)
index 0000000..d82ad3c
--- /dev/null
@@ -0,0 +1,8 @@
+# An example for http://bugs.python.org/issue815646
+
+import thread
+
+while 1:
+    f = open("/tmp/dupa", "w")
+    thread.start_new_thread(f.close, ())
+    f.close()