Skip to content

Handle missing input file explicitly#226

Merged
dilshod merged 1 commit intodilshod:masterfrom
brandonrobertz:master
Sep 13, 2023
Merged

Handle missing input file explicitly#226
dilshod merged 1 commit intodilshod:masterfrom
brandonrobertz:master

Conversation

@brandonrobertz
Copy link
Copy Markdown
Contributor

This PR introduces a check for and raises an exception when the user passes a non-existing file as input. Without this PR, when the user passes a non-existing file this error is raised:

Exception AttributeError: "Xlsx2csv instance has no attribute 'ziphandle'" in <bound method Xlsx2csv.del of <main.Xlsx2csv instance at 0x02BD9940>> ignored

This is the same exception raised when a non-XLSX file is passed, making debugging a little confusing. This PR makes the situation clear.

Check for and raise an exception when the user passes a
non-existing file as input. This makes such errors easier
to identify, as opposed to the code path and exception that
is raised with a non-existing file is passed (which also happens
to be the same exception raised when a non-XLSX file is passed,
making this error confusing).
@indigoviolet
Copy link
Copy Markdown

@dilshod can this be merged?

@cscortes
Copy link
Copy Markdown

Did this ever get merged?

@dilshod dilshod merged commit dc1f8f5 into dilshod:master Sep 13, 2023
@Vincent14
Copy link
Copy Markdown

Vincent14 commented Jun 11, 2025

Has it been deployed & built?

Invalid xlsx file: a
Exception ignored in: <function Xlsx2csv.__del__ at 0x78bfcd3fa950>
Traceback (most recent call last):
  File "/usr/bin/xlsx2csv", line 213, in __del__
AttributeError: 'Xlsx2csv' object has no attribute 'ziphandle'

I'm still having the issue, but probably because I'm still using Ubuntu 22.04.5 LTS

@brandonrobertz
Copy link
Copy Markdown
Contributor Author

Has it been deployed & built?

Invalid xlsx file: a
Exception ignored in: <function Xlsx2csv.__del__ at 0x78bfcd3fa950>
Traceback (most recent call last):
  File "/usr/bin/xlsx2csv", line 213, in __del__
AttributeError: 'Xlsx2csv' object has no attribute 'ziphandle'

I'm still having the issue, but probably because I'm still using Ubuntu 22.04.5 LTS

Check the version of the library. This got rolled into 0.8.2

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

Successfully merging this pull request may close these issues.

5 participants