[Python-bugs-list] [ python-Bugs-595919 ] popenN return only text mode pipes

noreply@sourceforge.net noreply@sourceforge.net
Sat, 17 Aug 2002 10:10:48 -0700


Bugs item #595919, was opened at 2002-08-16 11:25
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=595919&group_id=5470

Category: Python Library
Group: Python 2.1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Boyan Boyadjiev (bbboyadjiev)
>Assigned to: Neal Norwitz (nnorwitz)
Summary: popenN return only text mode pipes

Initial Comment:
The functions popen2, popen3 & popen 4 (module 
win32pipe) will return only text mode pipes even 
if the parameter mode is 'b'.

In the file win32popen.cpp on lines 363 
(popen2&popen4) and 398 (popen3) can be found 
the following code:
if (mode && _O_TEXT)
    {
      m1="r";
      m2="w";
    }
      else
    {
      m1="rb";
      m2="wb";
    }
The following change solves the problem :
if (mode & _O_TEXT)
    { ....



----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-08-17 19:10

Message:
Logged In: YES 
user_id=21627

That change looks fine; please implement it.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-08-17 18:03

Message:
Logged In: YES 
user_id=33168

win32popen.cpp is not in python.  The code you mention is in
posixmodule.c:3479 and 3511 in _PyPopen() for current cvs. 
Changing && -> & seems correct to me.  However, I don't
believe this can be tested on Unix.  

Martin, can you add anything?  Assign to me if you want me
to make the change.

----------------------------------------------------------------------

Comment By: Boyan Boyadjiev (bbboyadjiev)
Date: 2002-08-16 13:03

Message:
Logged In: YES 
user_id=595971

The same code (if (mode && _O_TEXT) ...) is used also in the function _PyPopen of the posix module 
(posixmodule.c).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=595919&group_id=5470