summaryrefslogtreecommitdiff
path: root/Lib/poplib.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2015-05-16 15:05:53 -0400
committerR David Murray <rdmurray@bitdance.com>2015-05-16 15:05:53 -0400
commitb8cd3e4e30d3219ecf00ce7f114a15746561ea87 (patch)
tree062ec0ea886b1015e47f932d4676ee2dced7c85d /Lib/poplib.py
parent8eb1f077c2be03f72ef31ddd2cfe805ffbfbd524 (diff)
downloadcpython-git-b8cd3e4e30d3219ecf00ce7f114a15746561ea87.tar.gz
#21804: Add RFC 6856 (UTF8) support to poplib.
Patch by Milan Oberkirch.
Diffstat (limited to 'Lib/poplib.py')
-rw-r--r--Lib/poplib.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/poplib.py b/Lib/poplib.py
index 4915628b03..f6723904e8 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -71,6 +71,7 @@ class POP3:
UIDL [msg] uidl(msg = None)
CAPA capa()
STLS stls()
+ UTF8 utf8()
Raises one exception: 'error_proto'.
@@ -348,6 +349,12 @@ class POP3:
return self._longcmd('UIDL')
+ def utf8(self):
+ """Try to enter UTF-8 mode (see RFC 6856). Returns server response.
+ """
+ return self._shortcmd('UTF8')
+
+
def capa(self):
"""Return server capabilities (RFC 2449) as a dictionary
>>> c=poplib.POP3('localhost')