From: R David Murray <rdmurray@bitdance.com> Date: Tue, 19 Mar 2013 17:56:01 +0000 (-0400) Subject: Merge: #17443: Fix buffering in IMAP4_stream. X-Git-Tag: v3.4.0a1~1161^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7889944b83cf04cefb45cd658644298218eac5db;p=python Merge: #17443: Fix buffering in IMAP4_stream. 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. --- 7889944b83cf04cefb45cd658644298218eac5db diff --cc Lib/imaplib.py index f8c7ffdb92,e2a05818fa..724f9d13a0 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@@ -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 e2455ae812,6ea3f78d76..2d29e9942f --- a/Misc/ACKS +++ 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