popen2 questions

Daniel Klein danielk at aracnet.com
Thu Feb 1 16:00:57 CET 2001


The documentation for the 'popen2' module states:

"""
... if bufsize is specified, it specifies the buffer size for the I/O pipes...
"""

however, on Windows, if I set this to anything but '-1', I get

Traceback (most recent call last):
  File "po.py", line 2, in ?
    fin,fout = popen2.popen2("XTEST",128,'t')
  File "c:\python20\lib\popen2.py", line 120, in popen2
    w, r = os.popen2(cmd, mode, bufsize)
ValueError: bufsize must be -1

Is 'bufsize' supported on Windows?

What does the '-1' setting change?

The bottom line what I'm trying to accomplish is to squeeze any optimizations
out of popen2 that I can so I thought to play with the 'bufsize' parameter.

I'm running Python 2.0 on Win2k.

Advanced thanks,
Daniel Klein
Portland,OR USA



More information about the Python-list mailing list