Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while processing password protected XLSX #1

Open
sarathkrishnan-007 opened this issue Jan 18, 2025 · 3 comments
Open

Error while processing password protected XLSX #1

sarathkrishnan-007 opened this issue Jan 18, 2025 · 3 comments

Comments

@sarathkrishnan-007
Copy link

I'd provided the xlsx file as input (both with explicit file path and relative file path)

File accepted
Traceback (most recent call last):
File "/Users/Sarath/Downloads/ExcelSheetUnblocker-main/unblock.py", line 41, in
processfile(filepath)
~~~~~~~~~~~^^^^^^^^^^
File "/Users/Sarath/Downloads/ExcelSheetUnblocker-main/unblock.py", line 27, in processfile
with zipfile.ZipFile(excelfile) as zip:
~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/zipfile/init.py", line 1380, in init
self._RealGetContents()
~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/Cellar/[email protected]/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/zipfile/init.py", line 1447, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

@0tii
Copy link
Owner

0tii commented Jan 18, 2025

Is it a proper .xlsx file and what is your python version?

@sarathkrishnan-007
Copy link
Author

Python 3.13.1 as shown in the error message (File "/usr/local/Cellar/[email protected]/3.13.1)
The xlsx is a proper file as I had opened it like 6 months ago, but forgot the password now

@gouldcs
Copy link

gouldcs commented Feb 6, 2025

Windows 11 patch? Using proper xlsx. Seems the unzip method doesn't work in Windows 11, even when done manually.

File accepted
Traceback (most recent call last):
  File "unblock.py", line 41, in <module>
    processfile(filepath)
  File "unblock.py", line 27, in processfile
    with zipfile.ZipFile(excelfile) as zip:
  File "C:\Users\*****\AppData\Local\Programs\Python\Python36-32\lib\zipfile.py", line 1108, in __init__
    self._RealGetContents()
  File "C:\Users\*****\AppData\Local\Programs\Python\Python36-32\lib\zipfile.py", line 1175, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants