We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc1f92d commit fc4df5dCopy full SHA for fc4df5d
Lib/test/test_threading.py
@@ -1338,6 +1338,20 @@ def run(self):
1338
# explicitly break the reference cycle to not leak a dangling thread
1339
thread.exc = None
1340
1341
+ def test_multithread_modify_file(self):
1342
+ import traceback
1343
+ def modify_file():
1344
+ with open(__file__, 'a') as fp:
1345
+ fp.write(' ')
1346
+ traceback.format_stack()
1347
+
1348
+ threads = [
1349
+ threading.Thread(target=modify_file)
1350
+ for i in range(100)
1351
+ ]
1352
+ [t.start() for t in threads]
1353
+ [t.join() for t in threads]
1354
1355
1356
class ThreadRunFail(threading.Thread):
1357
def run(self):
@@ -1634,3 +1648,4 @@ def run_last():
1634
1648
1635
1649
if __name__ == "__main__":
1636
1650
unittest.main()
1651
0 commit comments