Open heiseish opened 5 days ago
This sounds like a genuine bug. I know there are methods to chain contexts, but probably there is a simple fix available by patching the close method of the compression file-like object.
This kind of thing doesn't show up in tests because:
del
which exposes it.
Context
compression
parameter tofsspec.open
, the underlying Filesystem object is not properly cleaned up (even with context).Details
Reproducible code
The above code snippet will happily run (assuming s3 credentials are setup properly etc) and function exits successfully, but later when the file object destructor get called, we will see the following exception
Exception
I have not tried with any other FS yet but I reckon as long as we can trigger the error during flush/close, we should be able to reproduce the error.
Temporary work around
Relevant library code