summaryrefslogtreecommitdiffstats
path: root/PC/bdist_wininst/install.c
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2004-12-22 16:49:05 (GMT)
committerThomas Heller <theller@ctypes.org>2004-12-22 16:49:05 (GMT)
commite1796984191719b6e96a75018653e82758900e0b (patch)
treeb96dc8d465241df9348a4439f578311d227b7460 /PC/bdist_wininst/install.c
parent21b112869ede04dd2b3ff64a25f790b965ee64b0 (diff)
downloadcpython-e1796984191719b6e96a75018653e82758900e0b.zip
cpython-e1796984191719b6e96a75018653e82758900e0b.tar.gz
cpython-e1796984191719b6e96a75018653e82758900e0b.tar.bz2
Close stdout and stderr, which are redirected into a temp file, before
trying to remove this file - the file was never removed before. Fixes [ 1067732 ] wininst --install-script leaves residual files
Diffstat (limited to 'PC/bdist_wininst/install.c')
-rw-r--r--PC/bdist_wininst/install.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c
index f927019..44a6e0e 100644
--- a/PC/bdist_wininst/install.c
+++ b/PC/bdist_wininst/install.c
@@ -760,7 +760,9 @@ static int run_simple_script(char *script)
rc = do_run_simple_script(hPython, script);
FreeLibrary(hPython);
fflush(stderr);
+ fclose(stderr);
fflush(stdout);
+ fclose(stdout);
/* We only care about the output when we fail. If the script works
OK, then we discard it
*/
@@ -1951,7 +1953,9 @@ FinishedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
fprintf(stderr, "*** Could not load Python ***");
}
fflush(stderr);
+ fclose(stderr);
fflush(stdout);
+ fclose(stdout);
fp = fopen(tempname, "rb");
n = fread(buffer, 1, sizeof(buffer), fp);
@@ -2299,7 +2303,9 @@ BOOL Run_RemoveScript(char *line)
}
fflush(stderr);
+ fclose(stderr);
fflush(stdout);
+ fclose(stdout);
fp = fopen(tempname, "rb");
n = fread(buffer, 1, sizeof(buffer), fp);