popen bufsize not allowed on windows

Discussion in 'Python' started by Jonathan Hudgins, Jul 24, 2004.

  1. When I try setting the bufsize on popen on windows I get the following error:

    output = os.popen( "ls", 'r', 1 )

    ValueError: popen() arg 3 must be -1

    The same is true for popen2, popen3 and popen4.

    Is this a known limitation? Intentional?
    Are there plans to fix this? (Or at least the documentation)

    Jonathan
     
    Jonathan Hudgins, Jul 24, 2004
    #1
    1. Advertising

  2. > When I try setting the bufsize on popen on windows I get the following error:
    >
    > output = os.popen( "ls", 'r', 1 )
    >
    > ValueError: popen() arg 3 must be -1


    setting the environment variable PYTHONUNBUFFERED *before* executing
    the parent python script does the trick. (Or supposedly using the -u
    option on command line when starting the parent script).

    Now I am trying to get this compiled into an exe using py2exe.
    Any thoughts on how to make py2exe call python unbuffered?


    Jonathan
     
    Jonathan Hudgins, Jul 25, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas =?ISO-8859-15?Q?G=FCttler?=

    Maxmium bufsize using open2?

    Thomas =?ISO-8859-15?Q?G=FCttler?=, Jul 10, 2003, in forum: Python
    Replies:
    2
    Views:
    357
    Piet van Oostrum
    Jul 12, 2003
  2. I. Myself
    Replies:
    2
    Views:
    505
    I. Myself
    Apr 30, 2006
  3. =?iso-8859-1?B?aWFuYXLp?=

    real time updating of popen, bufsize=0 problems

    =?iso-8859-1?B?aWFuYXLp?=, Apr 6, 2007, in forum: Python
    Replies:
    4
    Views:
    587
    =?iso-8859-1?B?aWFuYXLp?=
    Apr 6, 2007
  4. Steve Holden
    Replies:
    0
    Views:
    811
    Steve Holden
    Feb 8, 2009
  5. bufsize in subprocess

    , Jan 22, 2012, in forum: Python
    Replies:
    3
    Views:
    675
Loading...

Share This Page