By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,714 Members | 750 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,714 IT Pros & Developers. It's quick & easy.

The use of universal_newlines in subprocess

P: n/a
Hi list:

I have been working with the universal_newlines option that can be
specified while using the subprocess module. I'm calling an app that
uses sys.stdout.write('\r'+' '*80) to manage its stdout. The situation
that I encountered was that when I wanted to log this output into a file
it looked rather freaky, so I needed to change the way the output was
logged. I found the answer in the universal_newlines option (it
basically changed all the \r for \n, which is a good idea in my case).
When I read the documentation for the universal_newline it stated that
"Also, the newlines attribute of the file objects stdout, stdin and
stderr are not updated by the communicate() method.". So I did not use
the communicate method thinking that it could not be used for my
purpose. After some hours of trying to make it work without the
communicate method I decide to use it and to my surprise it worked. So
my question is what does " are not updated by the communicate() method "
mean in the documentation.

Thanx in advance.

May 22 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.