Private
Public Access
1
0

try/except around get_file_type to catch corrupt gzip

This commit is contained in:
Sander Roosendaal
2017-10-18 09:16:15 +02:00
parent 828f406139
commit 35ad449421

View File

@@ -828,7 +828,13 @@ def new_workout_from_file(r,f2,
makeprivate=False,
notes=''):
message = None
fileformat = get_file_type(f2)
try:
fileformat = get_file_type(f2)
except IOError:
os.remove(f2)
message = "Rowsandall could not process this file. The extension is supported but the file seems corrupt. Contact info@rowsandall.com if you think this is incorrect."
return (0,message,f2)
summary = ''
oarlength = 2.89
inboard = 0.88