Skip to content

Commit

Permalink
Implementing fix for ets#54
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsqu authored Oct 3, 2023
1 parent 9da7ca5 commit ae28881
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tap_spreadsheets_anywhere/format_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ def get_row_iterator(table_spec, uri):
reader = get_streamreader(uri, universal_newlines=universal_newlines, open_mode='r', encoding=encoding)
iterator = tap_spreadsheets_anywhere.csv_handler.get_row_iterator(table_spec, reader)
elif format == 'excel':
reader = get_streamreader(uri, universal_newlines=universal_newlines,newline=None, open_mode='rb')
if uri.lower().endswith(".xls"):
reader = get_streamreader(uri, universal_newlines=universal_newlines,newline=None, open_mode='rb')
iterator = tap_spreadsheets_anywhere.excel_handler.get_legacy_row_iterator(table_spec, reader)
else:
reader = get_streamreader(uri, universal_newlines=universal_newlines,newline=None, open_mode='rb', encoding=None) # Adding encoding `None` to ensure smart_open will use binary mode
iterator = tap_spreadsheets_anywhere.excel_handler.get_row_iterator(table_spec, reader)
elif format == 'json':
reader = get_streamreader(uri, universal_newlines=universal_newlines, open_mode='r', encoding=encoding)
Expand Down

0 comments on commit ae28881

Please sign in to comment.