Skip to content

Commit

Permalink
Fix zipfile.BadZipFile error when reading .xlsx files.
Browse files Browse the repository at this point in the history
Use the name of the `.xlsx`, when opening the workbook, since the following
error is thrown when attempting to read the `io.TextIOWrapper` instance:

`zipfile.BadZipFile: File is not a zip file when loading an .xlsx file`

Issue: ets#54.
  • Loading branch information
craigastill committed May 16, 2023
1 parent 2700771 commit dd6a696
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tap_spreadsheets_anywhere/excel_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_legacy_row_iterator(table_spec, file_handle):


def get_row_iterator(table_spec, file_handle):
workbook = openpyxl.load_workbook(file_handle, read_only=True)
workbook = openpyxl.load_workbook(file_handle.name, read_only=True)

if "worksheet_name" in table_spec:
try:
Expand Down

0 comments on commit dd6a696

Please sign in to comment.