Skip to content

Commit

Permalink
Decode zfile name
Browse files Browse the repository at this point in the history
Closes #271
  • Loading branch information
oldnapalm committed Nov 13, 2023
1 parent e93b9f0 commit 69a4961
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zwift_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,10 @@ def api_zfiles():
except IOError as e:
logger.error("failed to create zfiles dir (%s): %s", zfiles_dir, str(e))
return '', 400
try:
zfile.filename = zfile.filename.decode('utf-8', 'ignore')
except AttributeError:
pass
with open(os.path.join(zfiles_dir, quote(zfile.filename, safe=' ')), 'wb') as fd:
fd.write(zfile.file)
row = Zfile.query.filter_by(folder=zfile.folder, filename=zfile.filename, player_id=current_user.player_id).first()
Expand Down

0 comments on commit 69a4961

Please sign in to comment.