techtonik / python-patch

Library to parse and apply unified diffs
https://pypi.python.org/pypi/patch
106 stars 63 forks source link

fromfile leaks file pointer in case parse raises exception #58

Open stefanoborini opened 5 years ago

stefanoborini commented 5 years ago

the opening of the patch file needs a context manager, otherwise if patchset.parse raises an exception, the fp is never closed.