try/except around get_file_type to catch corrupt gzip
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user