Re: Is there a limit to os.popen()?
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: >If you are seeing alot of error messages you shoudl really redirect the >standard error to a file to avoid them cluttering up your console. Surely a better technique would be to fix the errors causing the messages. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a limit to os.popen()?
Carl J. Van Arsdall wrote: > I'm not sure the proper way to phrase the question, but let me try. > > Basically, I'm working with a script where someone wrote: > > kr = string.strip(os.popen('make kernelrelease').read()) > > > And then searches kr to match a regular expression. > > This seems to have been working, however lately when this line executes > I get a number of messages to stderr after several minutes of execution: > > cat: write error: Broken pipe > cat: write error: Broken pipe > cat: write error: Broken pipe > > > I know the output from this make has been growing (make applies some > patches and the patch list is growing). Does os.popen() have some kind > of read buffer limit that i'm hitting which is causing things to break? > > > > While I can't tell you where the error is, I *can* tell you that the message is caused when some proces that's writing to a pipe sees the pipeline's reader close the pipe while the writer is still sending data. If you are seeing alot of error messages you shoudl really redirect the standard error to a file to avoid them cluttering up your console. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a limit to os.popen()?
In article <[EMAIL PROTECTED]>, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >Lawrence D'Oliveiro wrote: >> In article <[EMAIL PROTECTED]>, >> "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >> >> >>> Well, running the make on the command line seems to work just fine, no >>> errors at all. >>> >> >> What about running it as >> >> make kernelrelease | cat >> >> This way the output goes to a pipe, which is what happens when it's >> called from your script. Do you see those "broken pipe" messages after a >> few minutes in this case? >> >Alright, so I tried that line in the interpreter and got the same >problem. No, I wanted you to try it from a bash command prompt, to try to simulate the environment when the make command on its own is invoked via popen. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a limit to os.popen()?
Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: > > >> Well, running the make on the command line seems to work just fine, no >> errors at all. >> > > What about running it as > > make kernelrelease | cat > > This way the output goes to a pipe, which is what happens when it's > called from your script. Do you see those "broken pipe" messages after a > few minutes in this case? > Alright, so I tried that line in the interpreter and got the same problem. So let me quickly state what I know, and what I'm starting to infer. Anyhow, running make on the command line gives me no problems. There are cats all over the makefile, I checked, but I don't seem to have any problems on the command line. Now, when attempting to run this make in python things seem to go alright, except I get tons of errors dumped to the screen, its very confusing. I don't know too much about pipes though or how exactly to go about debugging this. Could it be something like, make's output is piped correctly but pipes used by cat within the makefile get screwed up inside python somehow? -c -- Carl J. Van Arsdall [EMAIL PROTECTED] Build and Release MontaVista Software -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a limit to os.popen()?
In article <[EMAIL PROTECTED]>, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >Well, running the make on the command line seems to work just fine, no >errors at all. What about running it as make kernelrelease | cat This way the output goes to a pipe, which is what happens when it's called from your script. Do you see those "broken pipe" messages after a few minutes in this case? -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a limit to os.popen()?
> kr = string.strip(os.popen('make kernelrelease').read()) If make is being executed, I presume that the python script has rw access to the location. How about x=os.system("make kernelrelease > my_report 2>&1 ") kr=open("my_report").read() Just a blind throw. Good luck sree -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a limit to os.popen()?
cdecarlo wrote: > Hello, > > I'm not 100% sure on this but to me it looks like there is a problem in > your make file. I would look in there first, see where 'cat' is > executed, I bet your problem will be around there. > > Hope this helps, > > Colin > > Well, running the make on the command line seems to work just fine, no errors at all. I, in fact, get the results I expect with no error messages printed out. I thought maybe something might have used cat as a utility, thanks, i'll keep on it. -c -- Carl J. Van Arsdall [EMAIL PROTECTED] Build and Release MontaVista Software -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a limit to os.popen()?
Hello, I'm not 100% sure on this but to me it looks like there is a problem in your make file. I would look in there first, see where 'cat' is executed, I bet your problem will be around there. Hope this helps, Colin Carl J. Van Arsdall wrote: > I'm not sure the proper way to phrase the question, but let me try. > > Basically, I'm working with a script where someone wrote: > > kr = string.strip(os.popen('make kernelrelease').read()) > > > And then searches kr to match a regular expression. > > This seems to have been working, however lately when this line executes > I get a number of messages to stderr after several minutes of execution: > > cat: write error: Broken pipe > cat: write error: Broken pipe > cat: write error: Broken pipe > > > I know the output from this make has been growing (make applies some > patches and the patch list is growing). Does os.popen() have some kind > of read buffer limit that i'm hitting which is causing things to break? > > > > > -- > > Carl J. Van Arsdall > [EMAIL PROTECTED] > Build and Release > MontaVista Software -- http://mail.python.org/mailman/listinfo/python-list
Is there a limit to os.popen()?
I'm not sure the proper way to phrase the question, but let me try. Basically, I'm working with a script where someone wrote: kr = string.strip(os.popen('make kernelrelease').read()) And then searches kr to match a regular expression. This seems to have been working, however lately when this line executes I get a number of messages to stderr after several minutes of execution: cat: write error: Broken pipe cat: write error: Broken pipe cat: write error: Broken pipe I know the output from this make has been growing (make applies some patches and the patch list is growing). Does os.popen() have some kind of read buffer limit that i'm hitting which is causing things to break? -- Carl J. Van Arsdall [EMAIL PROTECTED] Build and Release MontaVista Software -- http://mail.python.org/mailman/listinfo/python-list