diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1811,7 +1811,7 @@ def incoming(ui, repo, source="default", ui.write("\n") if cleanup: - os.close(fd) + other.close() # explicit close for unlink os.unlink(cleanup) def init(ui, dest="."):