git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/1] git-p4: close temporary file before removing

From
AAndrey <ahippo@yandex.ru>
Date
Aug 1, 2019, 01:36 UTC
Message-ID
<2689051564623400@vla1-83cc2ae1c2ed.qloud-c.yandex.net>
In-Reply-To
<pull.301.git.gitgitgadget@gmail.com>
31.07.2019, 20:36, "Philip McGraw via GitGitGadget" <gitgitgadget@gmail.com>:
Show 7 quoted lines
> python os.remove() throws exceptions on Windows platform when attempting to
> remove file while still open.
>
> Add local allocateTempFileName() to clarify that only the name is being
> allocated by NamedTemporaryFile(); file and handle are closed (but not
> deleted) when leave scope. Subsequent file deletion will succeed since file
> was closed.
I would also mention that this avoids double-open issue on Windows.
Show 17 quoted lines
>
> Also print error details after resulting IOError to make debugging cause of
> exception less mysterious when it has nothing to do with "git version recent
> enough."
>
> Philip.McGraw (1):
>   git-p4: close temporary file before removing
>
>  git-p4.py | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
>
> base-commit: 026dd738a6e5f1e42ef0f390feacb5ed6acc4ee8
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-301%2Fphilip-mcgraw%2Fgit-p4-close-temporary-file-before-remove-v2-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-301/philip-mcgraw/git-p4-close-temporary-file-before-remove-v2-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/301
> --
> gitgitgadget
Please, feel free to add
Reviewed-by: Andrey Mazo <ahippo@yandex.com>

Thank you, Andrey.

Previous: Philip McGraw via GitGitGadget
Message 2 of 2 in “git-p4: close temporary file before removing”
  1. 0/1 git-p4: close temporary file before removingPhilip McGraw via GitGitGadget, Aug 1, 2019
  2. AndreyAug 1, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.