hoffmangroup / segway

Application for semi-automated genomic annotation.
http://segway.hoffmanlab.org/
GNU General Public License v2.0
13 stars 7 forks source link

save_gmtk_input() hides exception raised by genomedata #122

Open EricR86 opened 6 years ago

EricR86 commented 6 years ago

Original report (BitBucket issue) by Mickaël Mendez (Bitbucket: Mickael Mendez).


If the code at lines 2028-2035 of the run.py file rises an exception, Segway will execute the finally clause without reporting the exception.

For example, I had to remove the try-finally clause to find out that Genome() raised the following error:

tables.exceptions.HDF5ExtError: HDF5 error back trace

  File "H5F.c", line 604, in H5Fopen
    unable to open file
  File "H5Fint.c", line 992, in H5F_open
    unable to open file: time = Tue Jan ...
, name = '...chr2.genomedata', tent_flags = 0
  File "H5FD.c", line 993, in H5FD_open
    open failed
  File "H5FDsec2.c", line 339, in H5FD_sec2_open
    unable to open file: name = '...', errno = 24, error message = 'Too many open files', flags = 0, o_flags = 0

End of HDF5 error back trace

Furthermore, if an exception occurs in the list comprehension assigned to genomes variable, genomes will remain unassigned and the finally clause will throw the following exception:

UnboundLocalError: local variable 'genomes' referenced before assignment 
EricR86 commented 6 years ago

Original comment by Eric Roberts (Bitbucket: ericr86, GitHub: ericr86).