This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author juj
Recipients akira, juj, vstinner
Date 2014-09-20.08:51:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411203066.38.0.0836982332771.issue22442@psf.upfronthosting.co.za>
In-reply-to
Content
Very good question akira. In one codebase where I have fixed this kind of bug, see

https://github.com/kripken/emscripten/commit/1b2badd84bc6f54a3125a494fa38a51f9dbb5877
https://github.com/kripken/emscripten/commit/2f048a4e452f5bacdb8fa31481c55487fd64d92a

the intended usage by the original author had certainly been to throw in a PIPE just to mute both stdout and stderr output, and there was no intent to capture the results or anything. I think passing PIPE to those is meaningless, since they effectively behave as "throw the results away", since they are not returned.

Throwing an exception might be nice, but perhaps that would break existing codebases and therefore is not good to add(?). Therefore I think the best course of action would be to do what is behaviorally as developer intends: "please treat as if stdout and stderr had been captured to a pipe, and throw those pipes away, since they aren't returned.", so your third option, while inconsistent with direct Popen(), sounds most correct in practice. What do you think?

I am not currently aware of other such cases, although it would be useful to go through the docs and recheck the commit history of when that documentation note was added in to see if there was more related discussions that occurred.
History
Date User Action Args
2014-09-20 08:51:06jujsetrecipients: + juj, vstinner, akira
2014-09-20 08:51:06jujsetmessageid: <1411203066.38.0.0836982332771.issue22442@psf.upfronthosting.co.za>
2014-09-20 08:51:06jujlinkissue22442 messages
2014-09-20 08:51:05jujcreate