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
{{ message }}
Repository navigation
feat: distinguish "no such file" from "not a ZIP" #1410
on Document("/a/b/c.docx") when the file or path provided does not resolve to a ZIP archive. For diagnostic purposes it would be better to distinguish a No such file or directory condition from a file exists but is not a ZIP archive (and so not a DOCX file) condition.
Proposed
Add a separate os.file.isfile() test on a provided file-path before attempting to open it with zipfile. Give this a focused message like FileNotFoundError: No such file or directory: '/a/b/c.docx' so the problem is unambiguous.
Change the PackageNotFoundError text to more specifically indicate the file is not a zip archive.
Activity