From: "Philip McGraw via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 0/1] git-p4: close temporary file before removing
Date: Wed, 31 Jul 2019 17:36:21 -0700 (PDT) [thread overview]
Message-ID: <pull.301.git.gitgitgadget@gmail.com> (raw)
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.
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
next reply other threads:[~2019-08-01 0:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 0:36 Philip McGraw via GitGitGadget [this message]
2019-08-01 1:36 ` [PATCH 0/1] git-p4: close temporary file before removing Andrey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.301.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).