-# Get the input file for the task and open it for reading
-with open(arvados.get_task_param_mount('input')) as f:
+# Get the input file for the task
+input_file = arvados.get_task_param_mount('input')
+
+# Open the input file for reading
+with open(input_file) as f: