#21804: Add RFC 6856 (UTF8) support to poplib.

Patch by Milan Oberkirch.
This commit is contained in:
R David Murray 2015-05-16 15:05:53 -04:00
parent 8eb1f077c2
commit b8cd3e4e30
5 changed files with 41 additions and 0 deletions

View file

@ -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')