Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > popen bufsize not allowed on windows

Reply
Thread Tools

popen bufsize not allowed on windows

 
 
Jonathan Hudgins
Guest
Posts: n/a
 
      07-24-2004
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
 
Reply With Quote
 
 
 
 
Jonathan Hudgins
Guest
Posts: n/a
 
      07-25-2004
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bufsize in subprocess yves@zioup.com Python 3 01-22-2012 05:05 PM
Re: Quetion about flags of socket.recv(bufsize, [flags]) Steve Holden Python 0 02-08-2009 04:09 PM
real time updating of popen, bufsize=0 problems =?iso-8859-1?B?aWFuYXLp?= Python 4 04-06-2007 08:07 PM
Why does bufsize=1 not work in subprocess.Popen ? I. Myself Python 2 04-29-2006 11:05 PM
Maxmium bufsize using open2? Thomas =?ISO-8859-15?Q?G=FCttler?= Python 2 07-12-2003 11:00 AM



Advertisments