popen bufsize not allowed on windows

J

Jonathan Hudgins

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
 
J

Jonathan Hudgins

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top