This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: typo in os.popen4 documentation
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, chen23, terry.reedy
Priority: normal Keywords:

Created on 2004-07-26 14:04 by chen23, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg21815 - (view) Author: Eric Chen (chen23) Date: 2004-07-26 14:04
on the page:

http://www.python.org/doc/2.3.4/lib/module-popen2.html

it lists os.popen4 return as:

Returns the file objects (child_stdout_and_stderr, child_stdin)

in practice it would appear to be (Solaris):

Returns the file objects (child_stdin,child_stdout_and_stderr)

msg21816 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2004-07-30 00:39
Logged In: YES 
user_id=593130

You (understandably) confused two nearly identical but 
different functions with two different return conventions 
(reversed from each other). 

>>> from os import popen4
>>> popen4
<built-in function popen4>
>>> popen2.popen4
<function popen4 at 0x00898768>

Module-popen2.html talks about popen2.popen4 and not 
os.popen4.

 Module popen2 has 3 functions popen2/3/4 which 
consistently return the read and write pipes in that order 
(well, popen3 is more complicated, but never mind).

  The os module also has functions of the same name but 
with reversed return order -- in/out -- as documented:
"This functionality is also available in the popen2 module using 
functions of the same names, but the return values of those 
functions have a different order."

Why ther reversal?  No idea.

The same hint/warning currently does NOT appear in the 
popen2 doc nor in its doc string (as accessed via help()) and 
I agree it should be.

Suggestion to doc fixer: in Lib Ref 6.8 popen2, end of 4th 
paragraph, ending in " or the equivalent functions in the os 
module." --
Add "(with reversed return tuples)" before the period.  
Without this caveat, they are not really equivalent, as Chen 
tripped over.


msg21817 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2004-08-07 17:29
Logged In: YES 
user_id=11375

I've added a note to the popen2 docs about this.
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40646
2004-07-26 14:04:04chen23create