aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/email.header.rst34
-rw-r--r--Doc/library/sys.rst7
-rw-r--r--Doc/reference/expressions.rst5
-rw-r--r--Doc/whatsnew/3.14.rst8
4 files changed, 47 insertions, 7 deletions
diff --git a/Doc/library/email.header.rst b/Doc/library/email.header.rst
index 219fad0d2f6..c3392a62b8e 100644
--- a/Doc/library/email.header.rst
+++ b/Doc/library/email.header.rst
@@ -178,16 +178,36 @@ The :mod:`email.header` module also provides the following convenient functions.
Decode a message header value without converting the character set. The header
value is in *header*.
- This function returns a list of ``(decoded_string, charset)`` pairs containing
- each of the decoded parts of the header. *charset* is ``None`` for non-encoded
- parts of the header, otherwise a lower case string containing the name of the
- character set specified in the encoded string.
+ For historical reasons, this function may return either:
- Here's an example::
+ 1. A list of pairs containing each of the decoded parts of the header,
+ ``(decoded_bytes, charset)``, where *decoded_bytes* is always an instance of
+ :class:`bytes`, and *charset* is either:
+
+ - A lower case string containing the name of the character set specified.
+
+ - ``None`` for non-encoded parts of the header.
+
+ 2. A list of length 1 containing a pair ``(string, None)``, where
+ *string* is always an instance of :class:`str`.
+
+ An :exc:`email.errors.HeaderParseError` may be raised when certain decoding
+ errors occur (e.g. a base64 decoding exception).
+
+ Here are examples:
>>> from email.header import decode_header
>>> decode_header('=?iso-8859-1?q?p=F6stal?=')
[(b'p\xf6stal', 'iso-8859-1')]
+ >>> decode_header('unencoded_string')
+ [('unencoded_string', None)]
+ >>> decode_header('bar =?utf-8?B?ZsOzbw==?=')
+ [(b'bar ', None), (b'f\xc3\xb3o', 'utf-8')]
+
+ .. note::
+
+ This function exists for for backwards compatibility only. For
+ new code, we recommend using :class:`email.headerregistry.HeaderRegistry`.
.. function:: make_header(decoded_seq, maxlinelen=None, header_name=None, continuation_ws=' ')
@@ -203,3 +223,7 @@ The :mod:`email.header` module also provides the following convenient functions.
:class:`Header` instance. Optional *maxlinelen*, *header_name*, and
*continuation_ws* are as in the :class:`Header` constructor.
+ .. note::
+
+ This function exists for for backwards compatibility only, and is
+ not recommended for use in new code.
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 55e442b20ff..71f9999464a 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -1933,6 +1933,13 @@ always available. Unless explicitly noted otherwise, all variables are read-only
interpreter is pre-release (alpha, beta, or release candidate) then the
local and remote interpreters must be the same exact version.
+ .. audit-event:: remote_debugger_script script_path
+
+ When the script is executed in the remote process, an
+ :ref:`auditing event <auditing>`
+ ``sys.remote_debugger_script`` is raised
+ with the path in the remote process.
+
.. availability:: Unix, Windows.
.. versionadded:: 3.14
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 2a550b504ca..3d3bf1d9840 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -406,8 +406,9 @@ brackets or curly braces.
Variables used in the generator expression are evaluated lazily when the
:meth:`~generator.__next__` method is called for the generator object (in the same
fashion as normal generators). However, the iterable expression in the
-leftmost :keyword:`!for` clause is immediately evaluated, so that an error
-produced by it will be emitted at the point where the generator expression
+leftmost :keyword:`!for` clause is immediately evaluated, and the
+:term:`iterator` is immediately created for that iterable, so that an error
+produced while creating the iterator will be emitted at the point where the generator expression
is defined, rather than at the point where the first value is retrieved.
Subsequent :keyword:`!for` clauses and any filter condition in the leftmost
:keyword:`!for` clause cannot be evaluated in the enclosing scope as they may
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst
index 705bf46d603..895446e2721 100644
--- a/Doc/whatsnew/3.14.rst
+++ b/Doc/whatsnew/3.14.rst
@@ -1259,6 +1259,14 @@ concurrent.futures
buffer.
(Contributed by Enzo Bonnal and Josh Rosenberg in :gh:`74028`.)
+configparser
+------------
+
+* Security fix: will no longer write config files it cannot read. Attempting
+ to :meth:`configparser.ConfigParser.write` keys containing delimiters or
+ beginning with the section header pattern will raise a
+ :class:`configparser.InvalidWriteError`.
+ (Contributed by Jacob Lincoln in :gh:`129270`)
contextvars
-----------