Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create io.BytesIO() in destructor of test_io.py
WrapperTest.test_create_at_shutdown_with_encoding fails with something like: ``` Exception ignored in: <function C.__del__ at 0x101895ae0> Traceback (most recent call last): File "x.py", line 10, in __del__ File "/Users/sgross/Projects/nogil/Lib/_pyio.py", line 2030, in __init__ File "/Users/sgross/Projects/nogil/Lib/_pyio.py", line 1021, in seekable ValueError: I/O operation on closed file. ``` The problem is that the GC calls the finalizer on `self.buf` before the `__del__` on `class C`. I don't think Python guarantees any ordering on destructors.
- Loading branch information