This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author benfogle
Recipients benfogle
Date 2017-11-08.04:27:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za>
In-reply-to
Content
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").
History
Date User Action Args
2017-11-08 04:27:27benfoglesetrecipients: + benfogle
2017-11-08 04:27:27benfoglesetmessageid: <1510115247.54.0.213398074469.issue31976@psf.upfronthosting.co.za>
2017-11-08 04:27:27benfoglelinkissue31976 messages
2017-11-08 04:27:27benfoglecreate