Skip to content

Commit

Permalink
fix: fix importing from file for compressed json files
Browse files Browse the repository at this point in the history
  • Loading branch information
daxartio committed Nov 24, 2024
1 parent 42e806a commit 9998ab4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sportorg/gui/menu/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,14 +912,14 @@ def execute(self):

try:
with open(file_name, mode=mode, encoding=def_encoding) as f:
attr = get_races_from_file(f)
attr = get_races_from_file(f, compress=use_gzip)
except UnicodeDecodeError:
f.close()

alt_encoding = None if use_utf8 or use_gzip else "utf-8"

with open(file_name, mode=mode, encoding=alt_encoding) as f:
attr = get_races_from_file(f)
attr = get_races_from_file(f, compress=use_gzip)

SportOrgImportDialog(*attr).exec_()
self.app.refresh()
Expand Down

0 comments on commit 9998ab4

Please sign in to comment.