mirror of
https://github.com/python/cpython.git
synced 2025-11-13 15:40:05 +00:00
Fix Bug #125891 - os.popen2,3 and 4 leaked file objects on Windows.
This commit is contained in:
parent
1ff31f9534
commit
64aae6695f
1 changed files with 5 additions and 0 deletions
|
|
@ -2518,6 +2518,8 @@ _PyPopen(char *cmdstring, int mode, int n)
|
||||||
CloseHandle(hChildStderrRdDup);
|
CloseHandle(hChildStderrRdDup);
|
||||||
|
|
||||||
f = Py_BuildValue("OO",p1,p2);
|
f = Py_BuildValue("OO",p1,p2);
|
||||||
|
Py_XDECREF(p1);
|
||||||
|
Py_XDECREF(p2);
|
||||||
file_count = 2;
|
file_count = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -2548,6 +2550,9 @@ _PyPopen(char *cmdstring, int mode, int n)
|
||||||
PyFile_SetBufSize(p2, 0);
|
PyFile_SetBufSize(p2, 0);
|
||||||
PyFile_SetBufSize(p3, 0);
|
PyFile_SetBufSize(p3, 0);
|
||||||
f = Py_BuildValue("OOO",p1,p2,p3);
|
f = Py_BuildValue("OOO",p1,p2,p3);
|
||||||
|
Py_XDECREF(p1);
|
||||||
|
Py_XDECREF(p2);
|
||||||
|
Py_XDECREF(p3);
|
||||||
file_count = 3;
|
file_count = 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue