[Python-checkins] python/dist/src/Modules posixmodule.c, 2.300.8.3,
2.300.8.4
loewis at users.sourceforge.net
loewis at users.sourceforge.net
Fri Oct 31 05:01:40 EST 2003
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv12180/Modules
Modified Files:
Tag: release23-maint
posixmodule.c
Log Message:
Patch #788404: ignore "b" and "t" mode modifiers in posix_popen.
Fixes #703198.
Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.300.8.3
retrieving revision 2.300.8.4
diff -C2 -d -r2.300.8.3 -r2.300.8.4
*** posixmodule.c 20 Oct 2003 14:34:47 -0000 2.300.8.3
--- posixmodule.c 31 Oct 2003 10:01:37 -0000 2.300.8.4
***************
*** 4331,4334 ****
--- 4331,4339 ----
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);
More information about the Python-checkins
mailing list