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.

Author skip.montanaro
Recipients LambertDW, georg.brandl, sameerd, skip.montanaro, wplappert
Date 2008-10-25.14:11:32
SpamBayes Score 0.00033240937
Marked as misclassified No
Message-id <1224943894.12.0.925612464665.issue4194@psf.upfronthosting.co.za>
In-reply-to
Content
>> Using a nonzero bufsize parameter makes all the difference in the
    >> world:
    ...

In fact, looking at posix_popen in posixmodule.c it appears the default
value for bufsize there is -1, implying that I/O is fully buffered.

Even if the default bufsize value for subprocess.Popen is not changed its
documentation should be corrected to reflect the different default values
for bufsize between os.popen and subprocess.Popen:

    Replacing os.popen*
    -------------------
    pipe = os.popen(cmd, mode='r', [bufsize])
    ==>
    pipe = Popen(cmd, shell=True, bufsize=bufsize, stdout=PIPE).stdout

    If you use the default bufsize with os.popen you must set bufsize to -1
    when creating a Popen object.  Otherwise your I/O will be unbuffered and
    you will be disappointed at the I/O performance.
History
Date User Action Args
2008-10-25 14:11:34skip.montanarosetrecipients: + skip.montanaro, georg.brandl, LambertDW, wplappert, sameerd
2008-10-25 14:11:34skip.montanarosetmessageid: <1224943894.12.0.925612464665.issue4194@psf.upfronthosting.co.za>
2008-10-25 14:11:32skip.montanarolinkissue4194 messages
2008-10-25 14:11:32skip.montanarocreate