mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
#19063: fix set_payload handling of non-ASCII string input.
This version of the fix raises an error instead of accepting the invalid input (ie: if a non-ASCII string is used but no charset is specified).
This commit is contained in:
parent
34bd9fc59a
commit
50bfbb9903
6 changed files with 85 additions and 38 deletions
|
|
@ -196,7 +196,13 @@ Here are the methods of the :class:`Message` class:
|
|||
|
||||
Set the entire message object's payload to *payload*. It is the client's
|
||||
responsibility to ensure the payload invariants. Optional *charset* sets
|
||||
the message's default character set; see :meth:`set_charset` for details.
|
||||
the message's character set; see :meth:`set_charset` for details. If
|
||||
*payload* is a string containing non-ASCII characters, *charset* is
|
||||
required.
|
||||
|
||||
.. versionchanged:: 3.4
|
||||
Previous to 3.4 *charset* was not required when *payload* was a
|
||||
non-ASCII string, but omitting it produced nonsense results.
|
||||
|
||||
.. method:: set_charset(charset)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue