Skip to content

fd.close() may be called on unassigned fd #53

@GoogleCodeExporter

Description

@GoogleCodeExporter
(Originally submitted by https://github.com/Hexadite-Max)

In the "try" statement the call to file(fname, 'rb') may fail to various 
reasons, however the exception that it throws gets lost due to the call to 
fd.close() as there is no fd which results in:

File "C:\Python27\lib\site-packages\pefile.py", line 1810, in parse
UnboundLocalError: local variable 'fd' referenced before assignment

Patch attached. 

Original issue reported on code.google.com by [email protected] on 9 Oct 2014 at 2:23

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions