git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/1] git-p4: close temporary file before removing
@ 2019-08-01  0:36 Philip McGraw via GitGitGadget
  2019-08-01  1:36 ` Andrey
  0 siblings, 1 reply; 2+ messages in thread
From: Philip McGraw via GitGitGadget @ 2019-08-01  0:36 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 0/1] git-p4: close temporary file before removing
  2019-08-01  0:36 [PATCH 0/1] git-p4: close temporary file before removing Philip McGraw via GitGitGadget
@ 2019-08-01  1:36 ` Andrey
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey @ 2019-08-01  1:36 UTC (permalink / raw)
  To: Philip McGraw via GitGitGadget, git; +Cc: Junio C Hamano, luke



31.07.2019, 20:36, "Philip McGraw via GitGitGadget" <gitgitgadget@gmail.com>:
> 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.

>
> 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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-01  1:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01  0:36 [PATCH 0/1] git-p4: close temporary file before removing Philip McGraw via GitGitGadget
2019-08-01  1:36 ` Andrey

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git