From 506d6d91b43467f343cb47c7bcd791413c7e2614 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Mon, 19 Aug 2002 00:43:06 +0000 Subject: [PATCH] SF bug 595919: popenN return only text mode pipes popen2() and popen3() created text-mode pipes even when binary mode was asked for. This was specific to Windows. --- Misc/NEWS | 4 ++++ Modules/posixmodule.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index c0edcf48a900..a823bce79bc9 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -67,6 +67,10 @@ C API Windows +- SF bug 595919: popenN return only text mode pipes + popen2() and popen3() created text-mode pipes even when binary mode + was asked for. This was specific to Windows. + - Sometimes the uninstall executable (UNWISE.EXE) vanishes. One cause of that has been fixed in the installer (disabled Wise's "delete in- use files" uninstall option). diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 38754e59decc..e2d511410f6a 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2790,7 +2790,7 @@ _PyPopen(char *cmdstring, int mode, int n) char *m1, *m2; PyObject *p1, *p2; - if (mode && _O_TEXT) { + if (mode & _O_TEXT) { m1 = "r"; m2 = "w"; } else { @@ -2822,7 +2822,7 @@ _PyPopen(char *cmdstring, int mode, int n) char *m1, *m2; PyObject *p1, *p2, *p3; - if (mode && _O_TEXT) { + if (mode & _O_TEXT) { m1 = "r"; m2 = "w"; } else { -- 2.47.3