[Python-Dev] test_quopri, test_wait3, and test_popen2 (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Thu Mar 23 23:40:17 CET 2006


I have been looking into the (seemingly random) test_popen2 failures today, and found that it fails when the tests are run in the order given in the subject.

Here is what happens:

So here is what I did to address these:

It turned out that this broke the Windows builds, which, in turn, resolves as a hidden bug/feature of quopri command line mode. When "python -mquopri <foo.txt" is invoked, the output will contain CRLF even if the input doesn't, this is likely because stdout is in text mode on Windows. Now, subprocess.py is not in text mode (unlike os.popen2), so when reading the results, we see CRLF on Windows, but LF elsewhere.

I fixed this by making the result check line-ending-independent, because I think using CRLF in quoted-unreadable is compliant with the relevant RFC. Alternatively, the quopri.py command line mode could be put into binary mode, so that it produces identical outputs on all systems.

Regards, Martin



More information about the Python-Dev mailing list