mirror of
https://github.com/python/cpython.git
synced 2025-11-24 04:17:38 +00:00
[3.14] gh-78319: Fix implementation of IMAP APPEND UTF8 (GH-9436) (GH-139406)
Make UTF8 support for the IMAP APPEND command RFC 6855 compliant.
(cherry picked from commit 408154d64a)
Co-authored-by: Gordon Messmer <gordon.messmer@gmail.com>
This commit is contained in:
parent
f0f0566292
commit
89a7b05f23
3 changed files with 26 additions and 12 deletions
|
|
@ -497,8 +497,6 @@ class IMAP4:
|
|||
else:
|
||||
date_time = None
|
||||
literal = MapCRLF.sub(CRLF, message)
|
||||
if self.utf8_enabled:
|
||||
literal = b'UTF8 (' + literal + b')'
|
||||
self.literal = literal
|
||||
return self._simple_command(name, mailbox, flags, date_time)
|
||||
|
||||
|
|
@ -1119,7 +1117,11 @@ class IMAP4:
|
|||
literator = literal
|
||||
else:
|
||||
literator = None
|
||||
data = data + bytes(' {%s}' % len(literal), self._encoding)
|
||||
if self.utf8_enabled:
|
||||
data = data + bytes(' UTF8 (~{%s}' % len(literal), self._encoding)
|
||||
literal = literal + b')'
|
||||
else:
|
||||
data = data + bytes(' {%s}' % len(literal), self._encoding)
|
||||
|
||||
if __debug__:
|
||||
if self.debug >= 4:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue