[issue21363] io.TextIOWrapper always closes wrapped files

2021-06-03 Thread Marten H. van Kerkwijk
Marten H. van Kerkwijk added the comment: In astropy we are now working around the auto-closing of the underlying stream in TextIOWrapper by subclassing and overriding `__del__` to detach [1]. It would seem more elegant if `TestIOWrapper` (and really, `BufferedReader`) could gain

[issue40720] accessing mmap of file that is overwritten causes bus error

2020-05-22 Thread Marten H. van Kerkwijk
Marten H. van Kerkwijk added the comment: I should probably have added that the bus error happens on linux. On Windows, the opening of the file for writing leads to an error, as the file is still opened for reading inside the mmap. -- ___ Python

[issue40720] accessing mmap of file that is overwritten causes bus error

2020-05-21 Thread Marten H. van Kerkwijk
New submission from Marten H. van Kerkwijk : While debugging a strange failure with tests and np.memmap, I realized that the following direct use of mmap reliably leads to a bus error. Here, obviously mmap'ing a file, closing it, opening the file for writing but not writing anything