You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File ".../venv/lib/python3.10/site-packages/ebooklib/epub.py", line 1700, in _load
if os.path.isdir(self.file_name):
File "/usr/lib/python-exec/python3.10/../../../lib/python3.10/genericpath.py", line 42, in isdir
st = os.stat(s)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not ZipExtFile
To clarify, my script opens a zip file with zipfile.ZipFile in the standard library, and then opens .epub files inside the zip file with ZipFile.open()
You might be able to say it's a bug in os.stat.isdir() since it's definitely not a dir 😄. But, it would be nice if you could catch TypeError and then treat the input as a file and not a directory.
The text was updated successfully, but these errors were encountered:
Hi,
I encountered a regression from 0.17.1 -> 0.18 in that the library crashes if it's fed a ZipExtFile object.
The crash is here:
ebooklib/ebooklib/epub.py
Line 1702 in a55089a
To clarify, my script opens a zip file with
zipfile.ZipFile
in the standard library, and then opens .epub files inside the zip file withZipFile.open()
You might be able to say it's a bug in
os.stat.isdir()
since it's definitely not a dir 😄. But, it would be nice if you could catch TypeError and then treat the input as a file and not a directory.The text was updated successfully, but these errors were encountered: