Message76325
Victor> About Python3, os.popen() is more than two times faster (0.20
Victor> sec vs 0.50 sec) than subprocess.Popen()! It's amazing because
Victor> popen() opens the standard output as unicode file whereas
Victor> Popen() creates a binary file! Another funny thing: os.popen()
Victor> calls subprocess.Popen() :-) The difference is just this
Victor> instruction:
Victor> stdout = io.TextIOWrapper(stdout)
This is a known issue. The default for bufsize in os.popen is -1 (fully
buffered? line buffered?). The default for bufsize in subprocess.Popen is 0
(unbuffered). I think it should have been changed but was voted down. I
think the best you can do at this point is document the change, perhaps in
the "Replacing os.popen" section.
Skip |
|
Date |
User |
Action |
Args |
2008-11-24 15:11:57 | skip.montanaro | set | recipients:
+ skip.montanaro, georg.brandl, gregory.p.smith, vstinner, giampaolo.rodola, LambertDW, wplappert, sameerd, bgh |
2008-11-24 15:11:56 | skip.montanaro | link | issue4194 messages |
2008-11-24 15:11:55 | skip.montanaro | create | |
|