473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

popen bufsize not allowed on windows

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
Jul 18 '05 #1
1 1824
> 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
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: I. Myself | last post by:
I read in the docs that "bufsize=1" causes line buffering. (for subprocess.Popen) The following tiny program launches an executable file and then receives its output. That works, but I want to...
2
by: Greg Ercolano | last post by:
When I use os.popen(cmd,'w'), I find that under windows, the stdout of the child process disappears, instead of appearing in the DOS window the script is invoked from. eg: C:\type foo.py import...
2
by: Dmitry Teslenko | last post by:
Hello! I'm using os.popen to perform lengthy operation such as building some project from source. It looks like this: def execute_and_save_output( command, out_file, err_file): import os ...
1
by: Mark Shewfelt | last post by:
Hello, I am attempting to use Popen() in a Windows service. I have a small Win32 .exe that I normally run through the os.popen2() function. I've written a class to work with the input and output...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.