[Python-checkins] CVS: python/dist/src/Lib imaplib.py,1.17,1.18
Guido van Rossum
guido@cnri.reston.va.us
Mon, 28 Feb 2000 17:37:33 -0500 (EST)
Update of /projects/cvsroot/python/dist/src/Lib
In directory eric:/projects/python/develop/guido/src/Lib
Modified Files:
imaplib.py
Log Message:
Patch by Piers Lauder, who writes:
This patch is re: Lucas.Dejonge@awtpl.com.au: [Python-bugs-list] imaplib -
not complying with RFC (PR#218)
Lucas de Jonge reported that the code in imaplib that detects a read-write
to read-only change doesn't comply with RFC 2060.
Index: imaplib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/imaplib.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** imaplib.py 2000/02/28 15:12:25 1.17
--- imaplib.py 2000/02/28 22:37:30 1.18
***************
*** 16,20 ****
# Authentication code contributed by Donn Cave <donn@u.washington.edu> June 1998.
! __version__ = "2.32"
import binascii, re, socket, string, time, random, sys
--- 16,20 ----
# Authentication code contributed by Donn Cave <donn@u.washington.edu> June 1998.
! __version__ = "2.33"
import binascii, re, socket, string, time, random, sys
***************
*** 129,132 ****
--- 129,133 ----
self.untagged_responses = {} # {typ: [data, ...], ...}
self.continuation_response = '' # Last continuation response
+ self.is_readonly = None # READ-ONLY desired state
self.tagnum = 0
***************
*** 471,474 ****
--- 472,476 ----
# Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY')
self.untagged_responses = {} # Flush old responses.
+ self.is_readonly = readonly
if readonly:
name = 'EXAMINE'
***************
*** 480,484 ****
return typ, dat
self.state = 'SELECTED'
! if not self.untagged_responses.has_key('READ-WRITE') \
and not readonly:
if __debug__:
--- 482,486 ----
return typ, dat
self.state = 'SELECTED'
! if self.untagged_responses.has_key('READ-ONLY') \
and not readonly:
if __debug__:
***************
*** 595,601 ****
del self.untagged_responses[typ]
! if self.untagged_responses.has_key('READ-WRITE') \
! and self.untagged_responses.has_key('READ-ONLY'):
! del self.untagged_responses['READ-WRITE']
raise self.readonly('mailbox status changed to READ-ONLY')
--- 597,602 ----
del self.untagged_responses[typ]
! if self.untagged_responses.has_key('READ-ONLY') \
! and not self.is_readonly:
raise self.readonly('mailbox status changed to READ-ONLY')