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 Cornelius Diekmann
Recipients Alex.Willmer, Cornelius Diekmann, chris.torek, martin.panter, vstinner
Date 2017-01-09.12:27:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Dear Martin, now I understand your intention. I merged my test suite with Chris's fix and documented our insights. SmallPtyTests contains regression tests for this issue.

While testing, I found a subtle change in behavior introduced by Chris's patch: It is no longer possible to get a broken pipe easily. I made a small adjustment to preserve this existing behavior:  In the _copy loop, I changed the order in which master_fd and STDIN_FILENO are copied to preserve the BrokenPipeError.

I tuned the slow tests, the complete test suite now needs less than 1 second on my system. I updated the documentation to note that the module is no longer supposed to be Linux-only.

> I realized that PtyWhiteBoxIntegrationTermiosTest is a reasonable test for the termios module, so it is beneficial. Though it may have been simpler to write it using pty.openpty(), avoiding an extra thread that just copies data between other threads.

I agree completely. However, pty.openpty() does not depend on the _copy() loop which is modified by Chris's patch. To add higher test coverage for the changes we introduce by merging Chris's fix, I decided to stick to pty.spawn().

I tested on Linux 4.4, Linux 3.13, FreeBSD 11, MacOS 10.11.6 and all tests are green. If anything goes wrong on the testbot army, here is the fallback strategy:
[I don't expect anything to go wrong, but I'm rather prepared than sorry]
If the test_pty does not finish within one minute on a system, please kill it. It would be nice to know on which platform it failed, so we can whitelist the module in the tests and the documentation for only the supported platforms.
Date User Action Args
2017-01-09 12:27:22Cornelius Diekmannsetrecipients: + Cornelius Diekmann, vstinner, martin.panter, Alex.Willmer, chris.torek
2017-01-09 12:27:20Cornelius Diekmannsetmessageid: <>
2017-01-09 12:27:20Cornelius Diekmannlinkissue29070 messages
2017-01-09 12:27:20Cornelius Diekmanncreate