[Biopython-dev] [Biopython - Bug #3266] (New) Bio/PDB/PDBParser.py: local variable 'i' referenced before assignment

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Sat Jul 16 21:42:16 UTC 2011


Issue #3266 has been reported by Boris Nagaev.

----------------------------------------
Bug #3266: Bio/PDB/PDBParser.py: local variable 'i' referenced before assignment
https://redmine.open-bio.org/issues/3266

Author: Boris Nagaev
Status: New
Priority: Normal
Assignee: 
Category: 
Target version: 
URL: 


Hey!

Look at file Bio/PDB/PDBParser.py, line 100:

<pre>
     91     def _get_header(self, header_coords_trailer):
     92         "Get the header of the PDB file, return the rest."
     93         structure_builder=self.structure_builder
     94         for i in range(0, len(header_coords_trailer)):
     95             structure_builder.set_line_counter(i+1)
     96             line=header_coords_trailer[i]
     97             record_type=line[0:6] 
     98             if(record_type=='ATOM  ' or record_type=='HETATM' or record_type=='MODEL '):
     99                 break
    100         header=header_coords_trailer[0:i]
    101         # Return the rest of the coords+trailer for further processing
    102         self.line_counter=i
    103         coords_trailer=header_coords_trailer[i:]
    104         header_dict=_parse_pdb_header_list(header)
    105         return header_dict, coords_trailer
</pre>

At line 100, variable i is used, but it may be undefined, if len(header_coords_trailer) = 0

Biopython version 1.57-1+b1, debian lenny


----------------------------------------
You have received this notification because this email was added to the New Issue Alert plugin


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org




More information about the Biopython-dev mailing list