summaryrefslogtreecommitdiffstats
path: root/Lib/poplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/poplib.py')
-rw-r--r--Lib/poplib.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/poplib.py b/Lib/poplib.py
index c14b8b7..1475bdc 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -100,14 +100,14 @@ class POP3:
def _putline(self, line):
- if self._debugging > 1: print '*put*', `line`
+ if self._debugging > 1: print '*put*', repr(line)
self.sock.sendall('%s%s' % (line, CRLF))
# Internal: send one command to the server (through _putline())
def _putcmd(self, line):
- if self._debugging: print '*cmd*', `line`
+ if self._debugging: print '*cmd*', repr(line)
self._putline(line)
@@ -117,7 +117,7 @@ class POP3:
def _getline(self):
line = self.file.readline()
- if self._debugging > 1: print '*get*', `line`
+ if self._debugging > 1: print '*get*', repr(line)
if not line: raise error_proto('-ERR EOF')
octets = len(line)
# server can send any combination of CR & LF
@@ -135,7 +135,7 @@ class POP3:
def _getresp(self):
resp, o = self._getline()
- if self._debugging > 1: print '*resp*', `resp`
+ if self._debugging > 1: print '*resp*', repr(resp)
c = resp[:1]
if c != '+':
raise error_proto(resp)
@@ -209,7 +209,7 @@ class POP3:
"""
retval = self._shortcmd('STAT')
rets = retval.split()
- if self._debugging: print '*stat*', `rets`
+ if self._debugging: print '*stat*', repr(rets)
numMessages = int(rets[1])
sizeMessages = int(rets[2])
return (numMessages, sizeMessages)
@@ -375,7 +375,7 @@ class POP3_SSL(POP3):
match = renewline.match(self.buffer)
line = match.group(0)
self.buffer = renewline.sub('' ,self.buffer, 1)
- if self._debugging > 1: print '*get*', `line`
+ if self._debugging > 1: print '*get*', repr(line)
octets = len(line)
if line[-2:] == CRLF:
@@ -385,7 +385,7 @@ class POP3_SSL(POP3):
return line[:-1], octets
def _putline(self, line):
- if self._debugging > 1: print '*put*', `line`
+ if self._debugging > 1: print '*put*', repr(line)
line += CRLF
bytes = len(line)
while bytes > 0:
@@ -416,7 +416,7 @@ if __name__ == "__main__":
(numMsgs, totalSize) = a.stat()
for i in range(1, numMsgs + 1):
(header, msg, octets) = a.retr(i)
- print "Message ", `i`, ':'
+ print "Message %d:" % i
for line in msg:
print ' ' + line
print '-----------------------'