[Python-checkins] CVS: python/dist/src/Lib poplib.py,1.11,1.12
Moshe Zadka
moshez@users.sourceforge.net
Fri, 19 Jan 2001 11:56:29 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv1432
Modified Files:
poplib.py
Log Message:
OK, checking in patch 103329.
Please check it against your nearest pop server --
mine doesn't support APOP (I checked I'm getting the same error
message, though)
Index: poplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/poplib.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** poplib.py 2001/01/15 00:50:52 1.11
--- poplib.py 2001/01/19 19:56:27 1.12
***************
*** 16,20 ****
# Imports
! import regex, socket, string
# Exception raised when an error or invalid response is received:
--- 16,20 ----
# Imports
! import re, socket, string
# Exception raised when an error or invalid response is received:
***************
*** 264,268 ****
! timestamp = regex.compile('\+OK.*\(<[^>]+>\)')
def apop(self, user, secret):
--- 264,268 ----
! timestamp = re.compile(r'\+OK.*(<[^>]+>)')
def apop(self, user, secret):
***************
*** 277,284 ****
NB: mailbox is locked by server from here to 'quit()'
"""
! if self.timestamp.match(self.welcome) <= 0:
raise error_proto('-ERR APOP not supported by server')
import md5
! digest = md5.new(self.timestamp.group(1)+secret).digest()
digest = string.join(map(lambda x:'%02x'%ord(x), digest), '')
return self._shortcmd('APOP %s %s' % (user, digest))
--- 277,285 ----
NB: mailbox is locked by server from here to 'quit()'
"""
! m = self.timestamp.match(self.welcome)
! if not m:
raise error_proto('-ERR APOP not supported by server')
import md5
! digest = md5.new(m.group(1)+secret).digest()
digest = string.join(map(lambda x:'%02x'%ord(x), digest), '')
return self._shortcmd('APOP %s %s' % (user, digest))