{"thread":{"id":"51566","subject":"[PATCH 0/1] git-p4: close temporary file before removing","startedAt":"2019-08-01T00:37:19Z","lastAt":"2019-08-01T01:36:46Z","messageCount":2,"participants":["Philip McGraw via GitGitGadget","Andrey"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"379725","messageId":"pull.301.git.gitgitgadget@gmail.com","threadId":"51566","inReplyTo":null,"subject":"[PATCH 0/1] git-p4: close temporary file before removing","fromName":"Philip McGraw via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-08-01T00:36:21Z","receivedAt":"2019-08-01T00:37:19Z","isPatch":true,"sender":{"key":"philip.mcgraw@bentley.com","avatar":"https://avatars.githubusercontent.com/u/18532989?v=4"},"body":"python os.remove() throws exceptions on Windows platform when attempting to\nremove file while still open.\n\nAdd local allocateTempFileName() to clarify that only the name is being\nallocated by NamedTemporaryFile(); file and handle are closed (but not\ndeleted) when leave scope. Subsequent file deletion will succeed since file\nwas closed.\n\nAlso print error details after resulting IOError to make debugging cause of\nexception less mysterious when it has nothing to do with \"git version recent\nenough.\"\n\nPhilip.McGraw (1):\n  git-p4: close temporary file before removing\n\n git-p4.py | 21 ++++++++++++++-------\n 1 file changed, 14 insertions(+), 7 deletions(-)\n\n\nbase-commit: 026dd738a6e5f1e42ef0f390feacb5ed6acc4ee8\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-301%2Fphilip-mcgraw%2Fgit-p4-close-temporary-file-before-remove-v2-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-301/philip-mcgraw/git-p4-close-temporary-file-before-remove-v2-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/301\n-- \ngitgitgadget\n"},{"id":"379732","messageId":"2689051564623400@vla1-83cc2ae1c2ed.qloud-c.yandex.net","threadId":"51566","inReplyTo":"pull.301.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/1] git-p4: close temporary file before removing","fromName":"Andrey","fromEmail":"ahippo@yandex.ru","sentAt":"2019-08-01T01:36:40Z","receivedAt":"2019-08-01T01:36:46Z","isPatch":true,"sender":{"key":"ahippo@yandex.ru","avatar":null},"body":"\n\n31.07.2019, 20:36, \"Philip McGraw via GitGitGadget\" <gitgitgadget@gmail.com>:\n> python os.remove() throws exceptions on Windows platform when attempting to\n> remove file while still open.\n>\n> Add local allocateTempFileName() to clarify that only the name is being\n> allocated by NamedTemporaryFile(); file and handle are closed (but not\n> deleted) when leave scope. Subsequent file deletion will succeed since file\n> was closed.\n\nI would also mention that this avoids double-open issue on Windows.\n\n>\n> Also print error details after resulting IOError to make debugging cause of\n> exception less mysterious when it has nothing to do with \"git version recent\n> enough.\"\n>\n> Philip.McGraw (1):\n>   git-p4: close temporary file before removing\n>\n>  git-p4.py | 21 ++++++++++++++-------\n>  1 file changed, 14 insertions(+), 7 deletions(-)\n>\n> base-commit: 026dd738a6e5f1e42ef0f390feacb5ed6acc4ee8\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-301%2Fphilip-mcgraw%2Fgit-p4-close-temporary-file-before-remove-v2-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-301/philip-mcgraw/git-p4-close-temporary-file-before-remove-v2-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/301\n> --\n> gitgitgadget\n\nPlease, feel free to add\nReviewed-by: Andrey Mazo <ahippo@yandex.com>\n\nThank you,\nAndrey.\n\n"}]}