[issue17443] imaplib.IMAP4_stream subprocess is opened unbuffered but ignores short reads

Gregory P. Smith report at bugs.python.org
Sun Mar 17 06:37:15 CET 2013


Gregory P. Smith added the comment:

The error does not happen when running the same code under 2.7, despite the same default bufsize=0 subprocess behavior.  This is likely due to differences in the Python 2.x old style io library when os.fdopen(fd, 'rb', bufsize) is used vs 3.x when io.open(fd, 'rb', bufsize) is used for  Popen.stdout.

One workaround is to add a non-zero bufsize to the subprocess.Popen call in imaplib.IMAP4_stream.

I'm not sure if subprocess should be updated or if subprocess's docs on what it means for a pipe to be unbuffered (read(n) is a single syscall rather than a loop until n bytes or EOF) should be updated.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17443>
_______________________________________


More information about the Python-bugs-list mailing list