]> granicus.if.org Git - python/commitdiff
Merge: #17443: Fix buffering in IMAP4_stream.
authorR David Murray <rdmurray@bitdance.com>
Tue, 19 Mar 2013 17:56:01 +0000 (13:56 -0400)
committerR David Murray <rdmurray@bitdance.com>
Tue, 19 Mar 2013 17:56:01 +0000 (13:56 -0400)
In Python2 Popen uses *FILE objects, which wind up buffering even though
subprocess defaults to no buffering.  In Python3, subprocess streams really
are unbuffered by default, but the imaplib code assumes read is buffered.  This
patch uses the default buffer size from the io module to get buffered streams
from Popen.

Much debugging work and patch by Diane Trout.

The imap protocol is too complicated to write a test for this simple
change with our current level of test infrastructure.

1  2 
Lib/imaplib.py
Misc/ACKS
Misc/NEWS

diff --cc Lib/imaplib.py
index f8c7ffdb921344b8ec31fa51b16e43f0b505a401,e2a05818fa617053c5f5c513aff4b49907135f4f..724f9d13a0454f1b0f5606bc8ddcf77de5c4434f
@@@ -23,7 -23,8 +23,9 @@@ Public functions:       Internaldate2tu
  __version__ = "2.58"
  
  import binascii, errno, random, re, socket, subprocess, sys, time, calendar
 +from datetime import datetime, timezone, timedelta
+ from io import DEFAULT_BUFFER_SIZE
  try:
      import ssl
      HAVE_SSL = True
diff --cc Misc/ACKS
index e2455ae812b43a3de8de18e904549aa214b22b42,6ea3f78d76ceb3d3659baebdb6cd3f29e8ac3e84..2d29e9942feb5775bac593fbee5c6f2c3009ae69
+++ b/Misc/ACKS
@@@ -1209,13 -1095,10 +1209,14 @@@ Stephen Tonki
  Matias Torchinsky
  Sandro Tosi
  Richard Townsend
 +David Townshend
  Nathan Trapuzzano
  Laurence Tratt
 +Alberto Trevino
 +Matthias Troffaes
 +Tom Tromey
  John Tromp
+ Diane Trout
  Jason Trowbridge
  Brent Tubbs
  Anthony Tuininga
diff --cc Misc/NEWS
Simple merge