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. Advertisements

  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. Advertisements

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:
    442
    Piet van Oostrum
    Jul 12, 2003
  2. I. Myself
    Replies:
    2
    Views:
    597
    I. Myself
    Apr 30, 2006
  3. =?Utf-8?B?QW5qYW5h?=

    not allowed to access the registry of windows vista

    =?Utf-8?B?QW5qYW5h?=, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,141
    Mark Rae
    Feb 19, 2007
  4. =?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:
    737
    =?iso-8859-1?B?aWFuYXLp?=
    Apr 6, 2007
  5. bufsize in subprocess

    , Jan 22, 2012, in forum: Python
    Replies:
    3
    Views:
    1,037
  6. File.popen/IO.popen

    , May 20, 2006, in forum: Ruby
    Replies:
    1
    Views:
    482
    Robert Klemme
    May 20, 2006
  7. Iñaki Baz Castillo
    Replies:
    13
    Views:
    761
    Iñaki Baz Castillo
    May 1, 2011
  8. Replies:
    2
    Views:
    205
    Jürgen Exner
    May 10, 2005
Loading...