Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo in os.popen4 documentation #40646

Closed
chen23 mannequin opened this issue Jul 26, 2004 · 3 comments
Closed

typo in os.popen4 documentation #40646

chen23 mannequin opened this issue Jul 26, 2004 · 3 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@chen23
Copy link
Mannequin

chen23 mannequin commented Jul 26, 2004

BPO 998066
Nosy @akuchling, @terryjreedy

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/akuchling'
closed_at = <Date 2004-08-07.17:29:18.000>
created_at = <Date 2004-07-26.14:04:04.000>
labels = ['docs']
title = 'typo in os.popen4 documentation'
updated_at = <Date 2004-08-07.17:29:18.000>
user = 'https://bugs.python.org/chen23'

bugs.python.org fields:

activity = <Date 2004-08-07.17:29:18.000>
actor = 'akuchling'
assignee = 'akuchling'
closed = True
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2004-07-26.14:04:04.000>
creator = 'chen23'
dependencies = []
files = []
hgrepos = []
issue_num = 998066
keywords = []
message_count = 3.0
messages = ['21815', '21816', '21817']
nosy_count = 3.0
nosy_names = ['akuchling', 'terry.reedy', 'chen23']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue998066'
versions = ['Python 2.3']

@chen23
Copy link
Mannequin Author

chen23 mannequin commented Jul 26, 2004

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)

@chen23 chen23 mannequin closed this as completed Jul 26, 2004
@chen23 chen23 mannequin assigned akuchling Jul 26, 2004
@chen23 chen23 mannequin added the docs Documentation in the Doc dir label Jul 26, 2004
@chen23 chen23 mannequin closed this as completed Jul 26, 2004
@chen23 chen23 mannequin assigned akuchling Jul 26, 2004
@chen23 chen23 mannequin added the docs Documentation in the Doc dir label Jul 26, 2004
@terryjreedy
Copy link
Member

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.

@akuchling
Copy link
Member

Logged In: YES
user_id=11375

I've added a note to the popen2 docs about this.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants