python/dist/src/Modules posixmodule.c, 2.306, 2.307
Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv12379/Modules Modified Files: posixmodule.c Log Message: Patch #788404: ignore "b" and "t" mode modifiers in posix_popen. Fixes #703198. Backported to 2.3. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.306 retrieving revision 2.307 diff -C2 -d -r2.306 -r2.307 *** posixmodule.c 20 Oct 2003 14:01:53 -0000 2.306 --- posixmodule.c 31 Oct 2003 10:01:53 -0000 2.307 *************** *** 4349,4352 **** --- 4349,4357 ---- if (!PyArg_ParseTuple(args, "s|si:popen", &name, &mode, &bufsize)) return NULL; + /* Strip mode of binary or text modifiers */ + if (strcmp(mode, "rb") == 0 || strcmp(mode, "rt") == 0) + mode = "r"; + else if (strcmp(mode, "wb") == 0 || strcmp(mode, "wt") == 0) + mode = "w"; Py_BEGIN_ALLOW_THREADS fp = popen(name, mode);
participants (1)
-
loewis@users.sourceforge.net