import idzip
with open("/tmp/r.txt", mode="wb") as f:
zipfile = idzip.IdzipFile(fileobj=f, mode="wb")
zipfile.write(b"\x00ed")
zipfile.close()
Stacktrace
Traceback (most recent call last):
File "/tmp/trial.py", line 4, in <module>
zipfile = idzip.IdzipFile(fileobj=f, mode="wb")
File "/home/arun/src/gh/stardict/.venv/lib/python3.6/site-packages/idzip/api.py", line 39, in __init__
self._impl = self._make_writer(fileobj, sync_size=sync_size, mtime=mtime)
File "/home/arun/src/gh/stardict/.venv/lib/python3.6/site-packages/idzip/api.py", line 53, in _make_writer
return IdzipWriter(filespec, sync_size=sync_size, mtime=mtime)
File "/home/arun/src/gh/stardict/.venv/lib/python3.6/site-packages/idzip/compressor.py", line 266, in __init__
"`output` must be a file-like object supporting "
TypeError: `output` must be a file-like object supporting write, tell, flush, and close!
Exception ignored in: <bound method IOStreamWrapperMixin.__del__ of <idzip.compressor.IdzipWriter object at 0x7f6039c2d4a8>>
Traceback (most recent call last):
File "/home/arun/src/gh/stardict/.venv/lib/python3.6/site-packages/idzip/_stream.py", line 22, in __del__
if not self.closed:
File "/home/arun/src/gh/stardict/.venv/lib/python3.6/site-packages/idzip/_stream.py", line 7, in closed
return self.stream.closed
File "/home/arun/src/gh/stardict/.venv/lib/python3.6/site-packages/idzip/compressor.py", line 293, in stream
return self.output
AttributeError: 'IdzipWriter' object has no attribute 'output'
python-idzip version 0.3
Sample code to reproduce the issue
Stacktrace