Message305803
To reproduce:
```
import threading
import io
import time
import _pyio
class MyFileIO(io.FileIO):
def flush(self):
# Simulate a slow flush. Slow disk, etc.
time.sleep(0.25)
super().flush()
raw = MyFileIO('test.dat', 'wb')
#fp = _pyio.BufferedWriter(raw)
fp = io.BufferedWriter(raw)
t1 = threading.Thread(target=fp.close)
t1.start()
time.sleep(0.1) # Ensure t1 is sleeping in fp.close()/raw.flush()
fp.write(b'test')
t1.join()
```
_pyio.BufferedWriter ignores the error completely rather than throwing a ValueError("write to closed file"). |
|
Date |
User |
Action |
Args |
2017-11-08 04:27:27 | benfogle | set | recipients:
+ benfogle |
2017-11-08 04:27:27 | benfogle | set | messageid: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za> |
2017-11-08 04:27:27 | benfogle | link | issue31976 messages |
2017-11-08 04:27:27 | benfogle | create | |
|