summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Galindo <pablogsal@gmail.com>2022-10-24 19:29:24 (GMT)
committerPablo Galindo <pablogsal@gmail.com>2022-10-24 19:29:24 (GMT)
commit69b6b56d857440183e227ca0b10c84bca4239985 (patch)
tree176b9344de6ce39a88bd8f130270cfc5685a65ef
parentcdbfce121fb046153e282bfe7e37cba49444b07b (diff)
parentdeaf509e8fc6e0363bd6f26d52ad42f976ec42f2 (diff)
downloadcpython-69b6b56d857440183e227ca0b10c84bca4239985.zip
cpython-69b6b56d857440183e227ca0b10c84bca4239985.tar.gz
cpython-69b6b56d857440183e227ca0b10c84bca4239985.tar.bz2
Merge tag 'v3.11.0' into 3.11
Python 3.11.0
-rw-r--r--Doc/library/venv.rst13
-rw-r--r--Doc/whatsnew/3.11.rst7
-rw-r--r--Include/patchlevel.h4
-rw-r--r--Lib/pydoc_data/topics.py304
-rw-r--r--Lib/test/test_frame.py64
-rw-r--r--Misc/NEWS.d/3.11.0.rst255
-rw-r--r--README.rst4
7 files changed, 519 insertions, 132 deletions
diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst
index adc6cd3..e0f2f2b 100644
--- a/Doc/library/venv.rst
+++ b/Doc/library/venv.rst
@@ -129,6 +129,19 @@ You can deactivate a virtual environment by typing ``deactivate`` in your shell.
The exact mechanism is platform-specific and is an internal implementation
detail (typically, a script or shell function will be used).
+.. warning:: Because scripts installed in environments should not expect the
+ environment to be activated, their shebang lines contain the absolute paths
+ to their environment's interpreters. Because of this, environments are
+ inherently non-portable, in the general case. You should always have a
+ simple means of recreating an environment (for example, if you have a
+ requirements file ``requirements.txt``, you can invoke ``pip install -r
+ requirements.txt`` using the environment's ``pip`` to install all of the
+ packages needed by the environment). If for any reason you need to move the
+ environment to a new location, you should recreate it at the desired
+ location and delete the one at the old location. If you move an environment
+ because you moved a parent directory of it, you should recreate the
+ environment in its new location. Otherwise, software installed into the
+ environment may not work as expected.
.. _venv-api:
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 7aa071c..b42c652 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -1593,6 +1593,10 @@ Changed/removed opcodes
.. _whatsnew311-deprecated:
.. _whatsnew311-python-api-deprecated:
+
+.. _whatsnew311-deprecated:
+.. _whatsnew311-python-api-deprecated:
+
Deprecated
==========
@@ -1768,6 +1772,9 @@ Standard Library
.. _whatsnew311-pending-removal:
.. _whatsnew311-python-api-pending-removal:
+.. _whatsnew311-pending-removal:
+.. _whatsnew311-python-api-pending-removal:
+
Pending Removal in Python 3.12
==============================
diff --git a/Include/patchlevel.h b/Include/patchlevel.h
index a54a2ce..c62cdf1 100644
--- a/Include/patchlevel.h
+++ b/Include/patchlevel.h
@@ -19,8 +19,8 @@
#define PY_MAJOR_VERSION 3
#define PY_MINOR_VERSION 11
#define PY_MICRO_VERSION 0
-#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA
-#define PY_RELEASE_SERIAL 2
+#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
+#define PY_RELEASE_SERIAL 0
/* Version as a string */
#define PY_VERSION "3.11.0rc2+"
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index 14c6dc2..7bba5cb 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Sun Sep 11 20:22:13 2022
+# Autogenerated by Sphinx on Mon Oct 24 18:35:07 2022
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
'\n'
@@ -1671,10 +1671,26 @@ topics = {'assert': 'The "assert" statement\n'
'If the syntax "**expression" appears in the function call,\n'
'"expression" must evaluate to a *mapping*, the contents of which '
'are\n'
- 'treated as additional keyword arguments. If a keyword is already\n'
- 'present (as an explicit keyword argument, or from another '
- 'unpacking),\n'
- 'a "TypeError" exception is raised.\n'
+ 'treated as additional keyword arguments. If a parameter matching a '
+ 'key\n'
+ 'has already been given a value (by an explicit keyword argument, '
+ 'or\n'
+ 'from another unpacking), a "TypeError" exception is raised.\n'
+ '\n'
+ 'When "**expression" is used, each key in this mapping must be a\n'
+ 'string. Each value from the mapping is assigned to the first '
+ 'formal\n'
+ 'parameter eligible for keyword assignment whose name is equal to '
+ 'the\n'
+ 'key. A key need not be a Python identifier (e.g. ""max-temp °F"" '
+ 'is\n'
+ 'acceptable, although it will not match any formal parameter that '
+ 'could\n'
+ 'be declared). If there is no match to a formal parameter the '
+ 'key-value\n'
+ 'pair is collected by the "**" parameter, if there is one, or if '
+ 'there\n'
+ 'is not, a "TypeError" exception is raised.\n'
'\n'
'Formal parameters using the syntax "*identifier" or "**identifier"\n'
'cannot be used as positional argument slots or as keyword argument\n'
@@ -2022,7 +2038,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'* Mappings (instances of "dict") compare equal if and only if '
'they\n'
- ' have equal *(key, value)* pairs. Equality comparison of the '
+ ' have equal "(key, value)" pairs. Equality comparison of the '
'keys and\n'
' values enforces reflexivity.\n'
'\n'
@@ -2398,35 +2414,43 @@ topics = {'assert': 'The "assert" statement\n'
' try3_stmt ::= "try" ":" suite\n'
' "finally" ":" suite\n'
'\n'
+ 'Additional information on exceptions can be found in section\n'
+ 'Exceptions, and information on using the "raise" statement to '
+ 'generate\n'
+ 'exceptions may be found in section The raise statement.\n'
+ '\n'
+ '\n'
+ '"except" clause\n'
+ '---------------\n'
+ '\n'
'The "except" clause(s) specify one or more exception handlers. '
'When no\n'
'exception occurs in the "try" clause, no exception handler is\n'
'executed. When an exception occurs in the "try" suite, a search '
'for an\n'
- 'exception handler is started. This search inspects the except '
- 'clauses\n'
- 'in turn until one is found that matches the exception. An '
- 'expression-\n'
- 'less except clause, if present, must be last; it matches any\n'
- 'exception. For an except clause with an expression, that '
- 'expression\n'
- 'is evaluated, and the clause matches the exception if the '
- 'resulting\n'
- 'object is “compatible” with the exception. An object is '
- 'compatible\n'
- 'with an exception if the object is the class or a *non-virtual '
- 'base\n'
- 'class* of the exception object, or a tuple containing an item '
- 'that is\n'
- 'the class or a non-virtual base class of the exception object.\n'
- '\n'
- 'If no except clause matches the exception, the search for an '
+ 'exception handler is started. This search inspects the "except"\n'
+ 'clauses in turn until one is found that matches the exception. '
+ 'An\n'
+ 'expression-less "except" clause, if present, must be last; it '
+ 'matches\n'
+ 'any exception. For an "except" clause with an expression, that\n'
+ 'expression is evaluated, and the clause matches the exception if '
+ 'the\n'
+ 'resulting object is “compatible” with the exception. An object '
+ 'is\n'
+ 'compatible with an exception if the object is the class or a '
+ '*non-\n'
+ 'virtual base class* of the exception object, or a tuple '
+ 'containing an\n'
+ 'item that is the class or a non-virtual base class of the '
'exception\n'
- 'handler continues in the surrounding code and on the invocation '
- 'stack.\n'
- '[1]\n'
+ 'object.\n'
+ '\n'
+ 'If no "except" clause matches the exception, the search for an\n'
+ 'exception handler continues in the surrounding code and on the\n'
+ 'invocation stack. [1]\n'
'\n'
- 'If the evaluation of an expression in the header of an except '
+ 'If the evaluation of an expression in the header of an "except" '
'clause\n'
'raises an exception, the original search for a handler is '
'canceled and\n'
@@ -2436,24 +2460,24 @@ topics = {'assert': 'The "assert" statement\n'
'raised\n'
'the exception).\n'
'\n'
- 'When a matching except clause is found, the exception is '
+ 'When a matching "except" clause is found, the exception is '
'assigned to\n'
- 'the target specified after the "as" keyword in that except '
- 'clause, if\n'
- 'present, and the except clause’s suite is executed. All except\n'
- 'clauses must have an executable block. When the end of this '
+ 'the target specified after the "as" keyword in that "except" '
+ 'clause,\n'
+ 'if present, and the "except" clause’s suite is executed. All '
+ '"except"\n'
+ 'clauses must have an executable block. When the end of this '
'block is\n'
- 'reached, execution continues normally after the entire try '
- 'statement.\n'
- '(This means that if two nested handlers exist for the same '
- 'exception,\n'
- 'and the exception occurs in the try clause of the inner handler, '
- 'the\n'
- 'outer handler will not handle the exception.)\n'
+ 'reached, execution continues normally after the entire "try"\n'
+ 'statement. (This means that if two nested handlers exist for the '
+ 'same\n'
+ 'exception, and the exception occurs in the "try" clause of the '
+ 'inner\n'
+ 'handler, the outer handler will not handle the exception.)\n'
'\n'
'When an exception has been assigned using "as target", it is '
'cleared\n'
- 'at the end of the except clause. This is as if\n'
+ 'at the end of the "except" clause. This is as if\n'
'\n'
' except E as N:\n'
' foo\n'
@@ -2468,7 +2492,7 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'This means the exception must be assigned to a different name to '
'be\n'
- 'able to refer to it after the except clause. Exceptions are '
+ 'able to refer to it after the "except" clause. Exceptions are '
'cleared\n'
'because with the traceback attached to them, they form a '
'reference\n'
@@ -2476,7 +2500,8 @@ topics = {'assert': 'The "assert" statement\n'
'alive\n'
'until the next garbage collection occurs.\n'
'\n'
- 'Before an except clause’s suite is executed, details about the\n'
+ 'Before an "except" clause’s suite is executed, details about '
+ 'the\n'
'exception are stored in the "sys" module and can be accessed '
'via\n'
'"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting '
@@ -2512,6 +2537,10 @@ topics = {'assert': 'The "assert" statement\n'
' >>> print(sys.exc_info())\n'
' (None, None, None)\n'
'\n'
+ '\n'
+ '"except*" clause\n'
+ '----------------\n'
+ '\n'
'The "except*" clause(s) are used for handling "ExceptionGroup"s. '
'The\n'
'exception type for matching is interpreted as in the case of '
@@ -2520,12 +2549,13 @@ topics = {'assert': 'The "assert" statement\n'
'when\n'
'the type matches some of the exceptions in the group. This means '
'that\n'
- 'multiple except* clauses can execute, each handling part of the\n'
+ 'multiple "except*" clauses can execute, each handling part of '
+ 'the\n'
'exception group. Each clause executes once and handles an '
'exception\n'
'group of all matching exceptions. Each exception in the group '
'is\n'
- 'handled by at most one except* clause, the first that matches '
+ 'handled by at most one "except*" clause, the first that matches '
'it.\n'
'\n'
' >>> try:\n'
@@ -2548,22 +2578,26 @@ topics = {'assert': 'The "assert" statement\n'
' +-+---------------- 1 ----------------\n'
' | ValueError: 1\n'
' +------------------------------------\n'
- ' >>>\n'
'\n'
- ' Any remaining exceptions that were not handled by any except* '
- 'clause\n'
- ' are re-raised at the end, combined into an exception group '
- 'along with\n'
- ' all exceptions that were raised from within except* clauses.\n'
- '\n'
- ' An except* clause must have a matching type, and this type '
- 'cannot be a\n'
- ' subclass of :exc:`BaseExceptionGroup`. It is not possible to '
- 'mix except\n'
- ' and except* in the same :keyword:`try`. :keyword:`break`,\n'
- ' :keyword:`continue` and :keyword:`return` cannot appear in an '
- 'except*\n'
- ' clause.\n'
+ ' Any remaining exceptions that were not handled by any '
+ ':keyword:`!except*`\n'
+ ' clause are re-raised at the end, combined into an exception '
+ 'group along with\n'
+ ' all exceptions that were raised from within '
+ ':keyword:`!except*` clauses.\n'
+ '\n'
+ ' An :keyword:`!except*` clause must have a matching type,\n'
+ ' and this type cannot be a subclass of '
+ ':exc:`BaseExceptionGroup`.\n'
+ ' It is not possible to mix :keyword:`except` and '
+ ':keyword:`!except*`\n'
+ ' in the same :keyword:`try`.\n'
+ ' :keyword:`break`, :keyword:`continue` and :keyword:`return`\n'
+ ' cannot appear in an :keyword:`!except*` clause.\n'
+ '\n'
+ '\n'
+ '"else" clause\n'
+ '-------------\n'
'\n'
'The optional "else" clause is executed if the control flow '
'leaves the\n'
@@ -2573,6 +2607,10 @@ topics = {'assert': 'The "assert" statement\n'
'are\n'
'not handled by the preceding "except" clauses.\n'
'\n'
+ '\n'
+ '"finally" clause\n'
+ '----------------\n'
+ '\n'
'If "finally" is present, it specifies a ‘cleanup’ handler. The '
'"try"\n'
'clause is executed, including any "except" and "else" clauses. '
@@ -2626,11 +2664,6 @@ topics = {'assert': 'The "assert" statement\n'
' >>> foo()\n'
" 'finally'\n"
'\n'
- 'Additional information on exceptions can be found in section\n'
- 'Exceptions, and information on using the "raise" statement to '
- 'generate\n'
- 'exceptions may be found in section The raise statement.\n'
- '\n'
'Changed in version 3.8: Prior to Python 3.8, a "continue" '
'statement\n'
'was illegal in the "finally" clause due to a problem with the\n'
@@ -5540,9 +5573,10 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' * "for" loop header,\n'
'\n'
- ' * after "as" in a "with" statement, "except" clause or in the '
- 'as-\n'
- ' pattern in structural pattern matching,\n'
+ ' * after "as" in a "with" statement, "except" clause, '
+ '"except*"\n'
+ ' clause, or in the as-pattern in structural pattern '
+ 'matching,\n'
'\n'
' * in a capture pattern in structural pattern matching\n'
'\n'
@@ -7657,9 +7691,8 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' * "for" loop header,\n'
'\n'
- ' * after "as" in a "with" statement, "except" clause or in the '
- 'as-\n'
- ' pattern in structural pattern matching,\n'
+ ' * after "as" in a "with" statement, "except" clause, "except*"\n'
+ ' clause, or in the as-pattern in structural pattern matching,\n'
'\n'
' * in a capture pattern in structural pattern matching\n'
'\n'
@@ -8232,8 +8265,9 @@ topics = {'assert': 'The "assert" statement\n'
'the syntax is explicitly given, operators are binary. '
'Operators in\n'
'the same box group left to right (except for '
- 'exponentiation, which\n'
- 'groups from right to left).\n'
+ 'exponentiation and\n'
+ 'conditional expressions, which group from right to '
+ 'left).\n'
'\n'
'Note that comparisons, membership tests, and identity '
'tests, all have\n'
@@ -12500,31 +12534,39 @@ topics = {'assert': 'The "assert" statement\n'
' try3_stmt ::= "try" ":" suite\n'
' "finally" ":" suite\n'
'\n'
+ 'Additional information on exceptions can be found in section\n'
+ 'Exceptions, and information on using the "raise" statement to '
+ 'generate\n'
+ 'exceptions may be found in section The raise statement.\n'
+ '\n'
+ '\n'
+ '"except" clause\n'
+ '===============\n'
+ '\n'
'The "except" clause(s) specify one or more exception handlers. When '
'no\n'
'exception occurs in the "try" clause, no exception handler is\n'
'executed. When an exception occurs in the "try" suite, a search for '
'an\n'
- 'exception handler is started. This search inspects the except '
- 'clauses\n'
- 'in turn until one is found that matches the exception. An '
- 'expression-\n'
- 'less except clause, if present, must be last; it matches any\n'
- 'exception. For an except clause with an expression, that expression\n'
- 'is evaluated, and the clause matches the exception if the resulting\n'
- 'object is “compatible” with the exception. An object is compatible\n'
- 'with an exception if the object is the class or a *non-virtual base\n'
- 'class* of the exception object, or a tuple containing an item that '
- 'is\n'
- 'the class or a non-virtual base class of the exception object.\n'
+ 'exception handler is started. This search inspects the "except"\n'
+ 'clauses in turn until one is found that matches the exception. An\n'
+ 'expression-less "except" clause, if present, must be last; it '
+ 'matches\n'
+ 'any exception. For an "except" clause with an expression, that\n'
+ 'expression is evaluated, and the clause matches the exception if the\n'
+ 'resulting object is “compatible” with the exception. An object is\n'
+ 'compatible with an exception if the object is the class or a *non-\n'
+ 'virtual base class* of the exception object, or a tuple containing '
+ 'an\n'
+ 'item that is the class or a non-virtual base class of the exception\n'
+ 'object.\n'
'\n'
- 'If no except clause matches the exception, the search for an '
- 'exception\n'
- 'handler continues in the surrounding code and on the invocation '
- 'stack.\n'
- '[1]\n'
+ 'If no "except" clause matches the exception, the search for an\n'
+ 'exception handler continues in the surrounding code and on the\n'
+ 'invocation stack. [1]\n'
'\n'
- 'If the evaluation of an expression in the header of an except clause\n'
+ 'If the evaluation of an expression in the header of an "except" '
+ 'clause\n'
'raises an exception, the original search for a handler is canceled '
'and\n'
'a search starts for the new exception in the surrounding code and on\n'
@@ -12532,21 +12574,20 @@ topics = {'assert': 'The "assert" statement\n'
'raised\n'
'the exception).\n'
'\n'
- 'When a matching except clause is found, the exception is assigned to\n'
- 'the target specified after the "as" keyword in that except clause, '
- 'if\n'
- 'present, and the except clause’s suite is executed. All except\n'
- 'clauses must have an executable block. When the end of this block '
- 'is\n'
- 'reached, execution continues normally after the entire try '
- 'statement.\n'
- '(This means that if two nested handlers exist for the same '
- 'exception,\n'
- 'and the exception occurs in the try clause of the inner handler, the\n'
- 'outer handler will not handle the exception.)\n'
+ 'When a matching "except" clause is found, the exception is assigned '
+ 'to\n'
+ 'the target specified after the "as" keyword in that "except" clause,\n'
+ 'if present, and the "except" clause’s suite is executed. All '
+ '"except"\n'
+ 'clauses must have an executable block. When the end of this block is\n'
+ 'reached, execution continues normally after the entire "try"\n'
+ 'statement. (This means that if two nested handlers exist for the '
+ 'same\n'
+ 'exception, and the exception occurs in the "try" clause of the inner\n'
+ 'handler, the outer handler will not handle the exception.)\n'
'\n'
'When an exception has been assigned using "as target", it is cleared\n'
- 'at the end of the except clause. This is as if\n'
+ 'at the end of the "except" clause. This is as if\n'
'\n'
' except E as N:\n'
' foo\n'
@@ -12560,12 +12601,13 @@ topics = {'assert': 'The "assert" statement\n'
' del N\n'
'\n'
'This means the exception must be assigned to a different name to be\n'
- 'able to refer to it after the except clause. Exceptions are cleared\n'
+ 'able to refer to it after the "except" clause. Exceptions are '
+ 'cleared\n'
'because with the traceback attached to them, they form a reference\n'
'cycle with the stack frame, keeping all locals in that frame alive\n'
'until the next garbage collection occurs.\n'
'\n'
- 'Before an except clause’s suite is executed, details about the\n'
+ 'Before an "except" clause’s suite is executed, details about the\n'
'exception are stored in the "sys" module and can be accessed via\n'
'"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of '
'the\n'
@@ -12597,16 +12639,20 @@ topics = {'assert': 'The "assert" statement\n'
' >>> print(sys.exc_info())\n'
' (None, None, None)\n'
'\n'
+ '\n'
+ '"except*" clause\n'
+ '================\n'
+ '\n'
'The "except*" clause(s) are used for handling "ExceptionGroup"s. The\n'
'exception type for matching is interpreted as in the case of '
'"except",\n'
'but in the case of exception groups we can have partial matches when\n'
'the type matches some of the exceptions in the group. This means '
'that\n'
- 'multiple except* clauses can execute, each handling part of the\n'
+ 'multiple "except*" clauses can execute, each handling part of the\n'
'exception group. Each clause executes once and handles an exception\n'
'group of all matching exceptions. Each exception in the group is\n'
- 'handled by at most one except* clause, the first that matches it.\n'
+ 'handled by at most one "except*" clause, the first that matches it.\n'
'\n'
' >>> try:\n'
' ... raise ExceptionGroup("eg",\n'
@@ -12626,22 +12672,25 @@ topics = {'assert': 'The "assert" statement\n'
' +-+---------------- 1 ----------------\n'
' | ValueError: 1\n'
' +------------------------------------\n'
- ' >>>\n'
'\n'
- ' Any remaining exceptions that were not handled by any except* '
- 'clause\n'
- ' are re-raised at the end, combined into an exception group along '
- 'with\n'
- ' all exceptions that were raised from within except* clauses.\n'
+ ' Any remaining exceptions that were not handled by any '
+ ':keyword:`!except*`\n'
+ ' clause are re-raised at the end, combined into an exception group '
+ 'along with\n'
+ ' all exceptions that were raised from within :keyword:`!except*` '
+ 'clauses.\n'
+ '\n'
+ ' An :keyword:`!except*` clause must have a matching type,\n'
+ ' and this type cannot be a subclass of :exc:`BaseExceptionGroup`.\n'
+ ' It is not possible to mix :keyword:`except` and '
+ ':keyword:`!except*`\n'
+ ' in the same :keyword:`try`.\n'
+ ' :keyword:`break`, :keyword:`continue` and :keyword:`return`\n'
+ ' cannot appear in an :keyword:`!except*` clause.\n'
+ '\n'
'\n'
- ' An except* clause must have a matching type, and this type cannot '
- 'be a\n'
- ' subclass of :exc:`BaseExceptionGroup`. It is not possible to mix '
- 'except\n'
- ' and except* in the same :keyword:`try`. :keyword:`break`,\n'
- ' :keyword:`continue` and :keyword:`return` cannot appear in an '
- 'except*\n'
- ' clause.\n'
+ '"else" clause\n'
+ '=============\n'
'\n'
'The optional "else" clause is executed if the control flow leaves '
'the\n'
@@ -12650,6 +12699,10 @@ topics = {'assert': 'The "assert" statement\n'
'"break" statement was executed. Exceptions in the "else" clause are\n'
'not handled by the preceding "except" clauses.\n'
'\n'
+ '\n'
+ '"finally" clause\n'
+ '================\n'
+ '\n'
'If "finally" is present, it specifies a ‘cleanup’ handler. The '
'"try"\n'
'clause is executed, including any "except" and "else" clauses. If '
@@ -12697,11 +12750,6 @@ topics = {'assert': 'The "assert" statement\n'
' >>> foo()\n'
" 'finally'\n"
'\n'
- 'Additional information on exceptions can be found in section\n'
- 'Exceptions, and information on using the "raise" statement to '
- 'generate\n'
- 'exceptions may be found in section The raise statement.\n'
- '\n'
'Changed in version 3.8: Prior to Python 3.8, a "continue" statement\n'
'was illegal in the "finally" clause due to a problem with the\n'
'implementation.\n',
@@ -12901,7 +12949,7 @@ topics = {'assert': 'The "assert" statement\n'
' points. All the code points in the range "U+0000 - '
'U+10FFFF"\n'
' can be represented in a string. Python doesn’t have a '
- '*char*\n'
+ 'char\n'
' type; instead, every code point in the string is '
'represented\n'
' as a string object with length "1". The built-in '
diff --git a/Lib/test/test_frame.py b/Lib/test/test_frame.py
index 4b86a60..2222ad6 100644
--- a/Lib/test/test_frame.py
+++ b/Lib/test/test_frame.py
@@ -326,5 +326,69 @@ class TestIncompleteFrameAreInvisible(unittest.TestCase):
gc.enable()
+ @support.cpython_only
+ def test_sneaky_frame_object(self):
+
+ def trace(frame, event, arg):
+ """
+ Don't actually do anything, just force a frame object to be created.
+ """
+
+ def callback(phase, info):
+ """
+ Yo dawg, I heard you like frames, so I'm allocating a frame while
+ you're allocating a frame, so you can have a frame while you have a
+ frame!
+ """
+ nonlocal sneaky_frame_object
+ sneaky_frame_object = sys._getframe().f_back
+ # We're done here:
+ gc.callbacks.remove(callback)
+
+ def f():
+ while True:
+ yield
+
+ old_threshold = gc.get_threshold()
+ old_callbacks = gc.callbacks[:]
+ old_enabled = gc.isenabled()
+ old_trace = sys.gettrace()
+ try:
+ # Stop the GC for a second while we set things up:
+ gc.disable()
+ # Create a paused generator:
+ g = f()
+ next(g)
+ # Move all objects to the oldest generation, and tell the GC to run
+ # on the *very next* allocation:
+ gc.collect()
+ gc.set_threshold(1, 0, 0)
+ # Okay, so here's the nightmare scenario:
+ # - We're tracing the resumption of a generator, which creates a new
+ # frame object.
+ # - The allocation of this frame object triggers a collection
+ # *before* the frame object is actually created.
+ # - During the collection, we request the exact same frame object.
+ # This test does it with a GC callback, but in real code it would
+ # likely be a trace function, weakref callback, or finalizer.
+ # - The collection finishes, and the original frame object is
+ # created. We now have two frame objects fighting over ownership
+ # of the same interpreter frame!
+ sys.settrace(trace)
+ gc.callbacks.append(callback)
+ sneaky_frame_object = None
+ gc.enable()
+ next(g)
+ # g.gi_frame should be the the frame object from the callback (the
+ # one that was *requested* second, but *created* first):
+ self.assertIs(g.gi_frame, sneaky_frame_object)
+ finally:
+ gc.set_threshold(*old_threshold)
+ gc.callbacks[:] = old_callbacks
+ sys.settrace(old_trace)
+ if old_enabled:
+ gc.enable()
+
+
if __name__ == "__main__":
unittest.main()
diff --git a/Misc/NEWS.d/3.11.0.rst b/Misc/NEWS.d/3.11.0.rst
new file mode 100644
index 0000000..2e1c49d
--- /dev/null
+++ b/Misc/NEWS.d/3.11.0.rst
@@ -0,0 +1,255 @@
+.. date: 2022-09-28-17-09-37
+.. gh-issue: 97616
+.. nonce: K1e3Xs
+.. release date: 2022-10-24
+.. section: Security
+
+Fix multiplying a list by an integer (``list *= int``): detect the integer
+overflow when the new allocated length is close to the maximum size. Issue
+reported by Jordan Limor. Patch by Victor Stinner.
+
+..
+
+.. date: 2022-09-07-10-42-00
+.. gh-issue: 97514
+.. nonce: Yggdsl
+.. section: Security
+
+On Linux the :mod:`multiprocessing` module returns to using filesystem
+backed unix domain sockets for communication with the *forkserver* process
+instead of the Linux abstract socket namespace. Only code that chooses to
+use the :ref:`"forkserver" start method <multiprocessing-start-methods>` is
+affected.
+
+Abstract sockets have no permissions and could allow any user on the system
+in the same `network namespace
+<https://man7.org/linux/man-pages/man7/network_namespaces.7.html>`_ (often
+the whole system) to inject code into the multiprocessing *forkserver*
+process. This was a potential privilege escalation. Filesystem based socket
+permissions restrict this to the *forkserver* process user as was the
+default in Python 3.8 and earlier.
+
+This prevents Linux `CVE-2022-42919
+<https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-42919>`_.
+
+..
+
+.. date: 2022-10-06-02-11-34
+.. gh-issue: 97002
+.. nonce: Zvsk71
+.. section: Core and Builtins
+
+Fix an issue where several frame objects could be backed by the same
+interpreter frame, possibly leading to corrupted memory and hard crashes of
+the interpreter.
+
+..
+
+.. date: 2022-10-03-13-35-48
+.. gh-issue: 97752
+.. nonce: 0xTjJY
+.. section: Core and Builtins
+
+Fix possible data corruption or crashes when accessing the ``f_back`` member
+of newly-created generator or coroutine frames.
+
+..
+
+.. date: 2022-09-21-16-06-37
+.. gh-issue: 96975
+.. nonce: BmE0XY
+.. section: Core and Builtins
+
+Fix a crash occurring when :c:func:`PyEval_GetFrame` is called while the
+topmost Python frame is in a partially-initialized state.
+
+..
+
+.. date: 2022-09-21-14-38-31
+.. gh-issue: 96848
+.. nonce: WuoLzU
+.. section: Core and Builtins
+
+Fix command line parsing: reject :option:`-X int_max_str_digits <-X>` option
+with no value (invalid) when the :envvar:`PYTHONINTMAXSTRDIGITS` environment
+variable is set to a valid limit. Patch by Victor Stinner.
+
+..
+
+.. date: 2022-09-18-08-47-40
+.. gh-issue: 96821
+.. nonce: Co2iOq
+.. section: Core and Builtins
+
+Fix undefined behaviour in ``_testcapimodule.c``.
+
+..
+
+.. date: 2022-09-16-19-02-40
+.. gh-issue: 95778
+.. nonce: cJmnst
+.. section: Core and Builtins
+
+When :exc:`ValueError` is raised if an integer is larger than the limit,
+mention the :func:`sys.set_int_max_str_digits` function in the error
+message. Patch by Victor Stinner.
+
+..
+
+.. date: 2022-09-05-19-20-44
+.. gh-issue: 96587
+.. nonce: bVxhX2
+.. section: Core and Builtins
+
+Correctly raise ``SyntaxError`` on exception groups (:pep:`654`) on python
+versions prior to 3.11
+
+..
+
+.. bpo: 42316
+.. date: 2020-11-15-02-08-43
+.. nonce: LqdkWK
+.. section: Core and Builtins
+
+Document some places where an assignment expression needs parentheses.
+
+..
+
+.. date: 2022-10-16-15-31-50
+.. gh-issue: 98331
+.. nonce: Y5kPOX
+.. section: Library
+
+Update the bundled copies of pip and setuptools to versions 22.3 and 65.5.0
+respectively.
+
+..
+
+.. date: 2022-10-06-23-42-00
+.. gh-issue: 90985
+.. nonce: s280JY
+.. section: Library
+
+Earlier in 3.11 we deprecated ``asyncio.Task.cancel("message")``. We
+realized we were too harsh, and have undeprecated it.
+
+..
+
+.. date: 2022-09-25-23-24-52
+.. gh-issue: 97545
+.. nonce: HZLSNt
+.. section: Library
+
+Make Semaphore run faster.
+
+..
+
+.. date: 2022-09-24-18-56-23
+.. gh-issue: 96865
+.. nonce: o9WUkW
+.. section: Library
+
+fix Flag to use boundary CONFORM
+
+This restores previous Flag behavior of allowing flags with non-sequential
+values to be combined; e.g.
+
+class Skip(Flag): TWO = 2 EIGHT = 8
+
+Skip.TWO | Skip.EIGHT -> <Skip.TWO|EIGHT: 10>
+
+..
+
+.. date: 2022-05-25-15-57-39
+.. gh-issue: 90155
+.. nonce: YMstB5
+.. section: Library
+
+Fix broken :class:`asyncio.Semaphore` when acquire is cancelled.
+
+..
+
+.. date: 2022-10-02-10-58-52
+.. gh-issue: 97741
+.. nonce: 39l023
+.. section: Documentation
+
+Fix ``!`` in c domain ref target syntax via a ``conf.py`` patch, so it works
+as intended to disable ref target resolution.
+
+..
+
+.. date: 2022-05-20-18-42-10
+.. gh-issue: 93031
+.. nonce: c2RdJe
+.. section: Documentation
+
+Update tutorial introduction output to use 3.10+ SyntaxError invalid range.
+
+..
+
+.. date: 2022-10-20-17-49-50
+.. gh-issue: 95027
+.. nonce: viRpJB
+.. section: Tests
+
+On Windows, when the Python test suite is run with the ``-jN`` option, the
+ANSI code page is now used as the encoding for the stdout temporary file,
+rather than using UTF-8 which can lead to decoding errors. Patch by Victor
+Stinner.
+
+..
+
+.. date: 2022-09-11-14-23-49
+.. gh-issue: 96729
+.. nonce: W4uBWL
+.. section: Build
+
+Ensure that Windows releases built with ``Tools\msi\buildrelease.bat`` are
+upgradable to and from official Python releases.
+
+..
+
+.. date: 2022-10-19-20-00-28
+.. gh-issue: 98360
+.. nonce: O2m6YG
+.. section: Windows
+
+Fixes :mod:`multiprocessing` spawning child processes on Windows from a
+virtual environment to ensure that child processes that also use
+:mod:`multiprocessing` to spawn more children will recognize that they are
+in a virtual environment.
+
+..
+
+.. date: 2022-10-19-19-35-37
+.. gh-issue: 98414
+.. nonce: FbHZuS
+.. section: Windows
+
+Fix :file:`py.exe` launcher handling of ``-V:<company>/`` option when
+default preferences have been set in environment variables or configuration
+files.
+
+..
+
+.. date: 2022-09-29-23-08-49
+.. gh-issue: 90989
+.. nonce: no89Q2
+.. section: Windows
+
+Clarify some text in the Windows installer.
+
+..
+
+.. date: 2022-10-05-15-26-58
+.. gh-issue: 97897
+.. nonce: Rf-C6u
+.. section: macOS
+
+The macOS 13 SDK includes support for the ``mkfifoat`` and ``mknodat``
+system calls. Using the ``dir_fd`` option with either :func:`os.mkfifo` or
+:func:`os.mknod` could result in a segfault if cpython is built with the
+macOS 13 SDK but run on an earlier version of macOS. Prevent this by adding
+runtime support for detection of these system calls ("weaklinking") as is
+done for other newer syscalls on macOS.
diff --git a/README.rst b/README.rst
index 2623978..3350419 100644
--- a/README.rst
+++ b/README.rst
@@ -1,5 +1,5 @@
-This is Python version 3.11.0 release candidate 2
-=================================================
+This is Python version 3.11.0
+=============================
.. image:: https://github.com/python/cpython/workflows/Tests/badge.svg
:alt: CPython build status on GitHub Actions