[issue17443] imaplib.IMAP4_stream subprocess is opened unbuffered but ignores short reads
Changes by Diane Trout : -- nosy: +detrout ___ Python tracker <http://bugs.python.org/issue17443> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17443] imaplib.IMAP4_stream subprocess is opened unbuffered but ignores short reads
Diane Trout added the comment: So as a first stab at fixing this. I modified imaplib to wrap the process.stdin / process.stdout from with io.BufferedWriter / io.BufferedReader. I didn't use the TextIOWrapper as the imaplib wanted to work with the raw \r\n. The change seems to have fixed the problem I was having, I also checked out 82724:ef8ea052bcc4 and tried running "./python -m test -j3 " before and after the buffer wrapping and it didn't seem to trigger any test case failures. -- keywords: +patch Added file: http://bugs.python.org/file29434/imaplib-buff.patch ___ Python tracker <http://bugs.python.org/issue17443> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17443] imaplib.IMAP4_stream subprocess is opened unbuffered but ignores short reads
Diane Trout added the comment: After bumping into r.david.murray in the elevator I got the impression setting the bufsize argument to the Popen call would be a better idea. I found that BufferedReader/Writer were using a DEFAULT_BUFFER_SIZE set somewhere in the c part of io. To cut down on magic numbers, this imaplib patch imports that constant and uses it on the Popen call. It doesn't seem to introduce test failures and still fixes the imap desynchronization problem seen at the porting clinic. -- Added file: http://bugs.python.org/file29473/imaplib-bufsize.patch ___ Python tracker <http://bugs.python.org/issue17443> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com