heyyy / espa

Automatically exported from code.google.com/p/espa
0 stars 0 forks source link

cdr_ecv_mapper.py open_log_handler()/close_log_handler() #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The cdr_ecv_mapper.py is using an open file handle and not ensuring that the 
resources are released.  It gets a reference to the log file using 
open_log_handler and closes it with close_log_handler but this logic 
(close_file_handle) is not guaranteed to execute in the even of an exception or 
premature termination of the code.

This is high priority.

Original issue reported on code.google.com by davehil...@gmail.com on 17 Jun 2014 at 2:54

GoogleCodeExporter commented 9 years ago
close_log_handler is called in multiple places in this method, depending on if 
the code exited successfully or unsuccessfully.  

Simply move all calls to close_log_handler() to a finally: block at the end and 
remove the others.  This will guarantee closure.

Original comment by davehil...@gmail.com on 17 Jun 2014 at 2:57

GoogleCodeExporter commented 9 years ago
Added a finally block and a call to close_log_handler in it.

Original comment by rd.alt.5...@gmail.com on 17 Jun 2014 at 3:53

GoogleCodeExporter commented 9 years ago
Changed status to fixed

Original comment by rd.alt.5...@gmail.com on 18 Jun 2014 at 2:00

GoogleCodeExporter commented 9 years ago

Original comment by davehil...@gmail.com on 18 Jun 2014 at 6:37

GoogleCodeExporter commented 9 years ago
verified

Original comment by davehil...@gmail.com on 31 Jul 2014 at 6:43