Given this code:
import io
import zipfile
zipbytes = io.BytesIO()
zip = zipfile.ZipFile(zipbytes, 'w', zipfile.ZIP_DEFLATED, False)
and running the program, i get this error:
Exception ignored in: <function ZipFile.__del__ at 0x101244220>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/zipfile.py", line 1874, in __del__
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/zipfile.py", line 1891, in close
ValueError: I/O operation on closed file.
the error appears, when the code tries initialising the zip variable .
But it appears, that the error is ignored and the rest of the program executes just fine, HOWEVER the zipfile is not created at the end, which led me to assume, that this error is the reason it is not created. I could not find any reference of it on the internet or any relation of it to the zipfile library. How can i fix this?