diff --git a/rowers/dataprep.py b/rowers/dataprep.py index abfde140..40ccfc3f 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -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