NB: mailbox is locked by server from here to 'quit()'
"""
- secret = bytes(secret, self.encoding)
+ secret = bytes(password, self.encoding)
m = self.timestamp.match(self.welcome)
if not m:
raise error_proto('-ERR APOP not supported by server')
asynchat.async_chat.__init__(self, conn)
self.set_terminator(b"\r\n")
self.in_buffer = []
- self.push('+OK dummy pop3 server ready.')
+ self.push('+OK dummy pop3 server ready. <timestamp>')
def collect_incoming_data(self, data):
self.in_buffer.append(data)
def cmd_rpop(self, arg):
self.push('+OK done nothing.')
+ def cmd_apop(self, arg):
+ self.push('+OK done nothing.')
+
class DummyPOP3Server(asyncore.dispatcher, threading.Thread):
self.server.stop()
def test_getwelcome(self):
- self.assertEqual(self.client.getwelcome(), b'+OK dummy pop3 server ready.')
+ self.assertEqual(self.client.getwelcome(),
+ b'+OK dummy pop3 server ready. <timestamp>')
def test_exceptions(self):
self.assertRaises(poplib.error_proto, self.client._shortcmd, 'echo -err')
def test_rpop(self):
self.assertOK(self.client.rpop('foo'))
+ def test_apop(self):
+ self.assertOK(self.client.apop('foo', 'dummypassword'))
+
def test_top(self):
expected = (b'+OK 116 bytes',
[b'From: postmaster@python.org', b'Content-Type: text/plain',
self.set_socket(ssl_socket)
self.set_terminator(b"\r\n")
self.in_buffer = []
- self.push('+OK dummy pop3 server ready.')
+ self.push('+OK dummy pop3 server ready. <timestamp>')
class TestPOP3_SSLClass(TestPOP3Class):
# repeat previous tests by using poplib.POP3_SSL
Library
-------
+- Issue #6622: Fix "local variable 'secret' referenced before
+ assignment" bug in POP3.apop.
+
- Issue #6637: defaultdict.copy() did not work when the default factory
was left unspecified. Also, the eval/repr round-trip would fail when
the default_factory was None.