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