Skip to content

Commit 806f3f1

Browse files
authored
Merge branch 'main' into ssl-rc-ft-49
2 parents 63d7bab + 5775aa8 commit 806f3f1

35 files changed

Lines changed: 452 additions & 57 deletions

Doc/deprecations/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Deprecations
1313

1414
.. include:: pending-removal-in-3.20.rst
1515

16+
.. include:: pending-removal-in-3.21.rst
17+
1618
.. include:: pending-removal-in-future.rst
1719

1820
.. include:: soft-deprecations.rst
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Pending removal in Python 3.21
2+
------------------------------
3+
4+
* :mod:`ast`:
5+
6+
* Classes ``slice``, ``Index``, ``ExtSlice``, ``Suite``, ``Param``,
7+
``AugLoad`` and ``AugStore``, will be removed in Python 3.21. These types
8+
are not generated by the parser or accepted by the code generator.
9+
* The ``dims`` property of ``ast.Tuple`` will be removed in Python 3.21. Use
10+
the ``ast.Tuple.elts`` property instead.

Doc/library/os.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5062,6 +5062,18 @@ written in Python, such as a mail server's external command delivery program.
50625062
.. availability:: Linux >= 5.10
50635063
.. versionadded:: 3.12
50645064

5065+
.. function:: pidfd_getfd(pidfd, targetfd, *, flags=0)
5066+
5067+
Duplicate *targetfd* from the process referred to by the process file
5068+
descriptor *pidfd*, into the calling process. The returned file descriptor
5069+
is :ref:`non-inheritable <fd_inheritance>`.
5070+
5071+
*flags* is reserved, and currently must be ``0``.
5072+
5073+
See the :manpage:`pidfd_getfd(2)` man page for more details.
5074+
5075+
.. availability:: Linux >= 5.6, Android >= :func:`build-time <sys.getandroidapilevel>` API level 31
5076+
.. versionadded:: next
50655077

50665078
.. function:: plock(op, /)
50675079

Doc/library/ssl.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,7 +2076,7 @@ to speed up repeated connections from the same clients.
20762076
:attr:`~SSLContext.minimum_version` and
20772077
:attr:`SSLContext.options` all affect the supported SSL
20782078
and TLS versions of the context. The implementation does not prevent
2079-
invalid combination. For example a context with
2079+
invalid combinations. For example a context with
20802080
:attr:`OP_NO_TLSv1_2` in :attr:`~SSLContext.options` and
20812081
:attr:`~SSLContext.maximum_version` set to :attr:`TLSVersion.TLSv1_2`
20822082
will not be able to establish a TLS 1.2 connection.
@@ -2891,11 +2891,11 @@ disabled by default.
28912891
::
28922892

28932893
>>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
2894-
>>> client_context.minimum_version = ssl.TLSVersion.TLSv1_3
2894+
>>> client_context.minimum_version = ssl.TLSVersion.TLSv1_2
28952895
>>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3
28962896

28972897

2898-
The SSL context created above will only allow TLSv1.3 and later (if
2898+
The SSL client context created above will only allow TLSv1.2 and TLSv1.3 (if
28992899
supported by your system) connections to a server. :const:`PROTOCOL_TLS_CLIENT`
29002900
implies certificate validation and hostname checks by default. You have to
29012901
load certificates into the context.

Doc/whatsnew/3.16.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ New modules
8686
Improved modules
8787
================
8888

89-
module_name
90-
-----------
89+
os
90+
--
9191

92-
* TODO
92+
* Add :func:`os.pidfd_getfd` for duplicating a file descriptor from another
93+
process via a pidfd. Available on Linux 5.6+.
94+
(Contributed by Maurycy Pawłowski-Wieroński in :gh:`149464`.)
9395

9496
.. Add improved modules above alphabetically, not here at the end.
9597
@@ -182,9 +184,16 @@ tarfile
182184
Deprecated
183185
==========
184186

185-
* module_name:
186-
TODO
187+
* :mod:`ast`:
187188

189+
* Classes ``slice``, ``Index``, ``ExtSlice``, ``Suite``, ``Param``,
190+
``AugLoad`` and ``AugStore``, deprecated since Python 3.9, are no longer
191+
imported by ``from ast import *`` and issue a deprecation warning on
192+
use. The classes are slated for removal in Python 3.21. These types are not
193+
generated by the parser or accepted by the code generator.
194+
* The ``dims`` property of ``ast.Tuple`` objects, deprecated since Python
195+
3.9, now issues a deprecation warning on use. This property is slated for
196+
removal in 3.21. Use ``ast.Tuple.elts`` instead.
188197

189198
.. Add deprecations above alphabetically, not here at the end.
190199

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ struct _Py_global_strings {
713713
STRUCT_FOR_ID(person)
714714
STRUCT_FOR_ID(pi_factory)
715715
STRUCT_FOR_ID(pid)
716+
STRUCT_FOR_ID(pidfd)
716717
STRUCT_FOR_ID(pointer_bits)
717718
STRUCT_FOR_ID(policy)
718719
STRUCT_FOR_ID(pos)
@@ -831,6 +832,7 @@ struct _Py_global_strings {
831832
STRUCT_FOR_ID(take_bytes)
832833
STRUCT_FOR_ID(target)
833834
STRUCT_FOR_ID(target_is_directory)
835+
STRUCT_FOR_ID(targetfd)
834836
STRUCT_FOR_ID(task)
835837
STRUCT_FOR_ID(tb_frame)
836838
STRUCT_FOR_ID(tb_lasti)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject_generated.h

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/ast.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
:license: Python License.
2222
"""
2323
from _ast import *
24-
24+
lazy import warnings
2525

2626
def parse(source, filename='<unknown>', mode='exec', *,
2727
type_comments=False, feature_version=None, optimize=-1, module=None):
@@ -630,9 +630,11 @@ def __new__(cls, dims=(), **kwargs):
630630

631631
def _dims_getter(self):
632632
"""Deprecated. Use elts instead."""
633+
warnings._deprecated(f"ast.Tuple.dims", remove=(3, 21))
633634
return self.elts
634635

635636
def _dims_setter(self, value):
637+
warnings._deprecated(f"ast.Tuple.dims", remove=(3, 21))
636638
self.elts = value
637639

638640
Tuple.dims = property(_dims_getter, _dims_setter)
@@ -714,5 +716,23 @@ def main(args=None):
714716
color=can_colorize(file=sys.stdout),
715717
indent=args.indent, show_empty=args.show_empty))
716718

719+
_deprecated = {
720+
'slice': globals().pop("slice"),
721+
'Index': globals().pop("Index"),
722+
'ExtSlice': globals().pop("ExtSlice"),
723+
'Suite': globals().pop("Suite"),
724+
'AugLoad': globals().pop("AugLoad"),
725+
'AugStore': globals().pop("AugStore"),
726+
'Param': globals().pop("Param")
727+
}
728+
729+
def __getattr__(attr):
730+
try:
731+
val = _deprecated[attr]
732+
except KeyError:
733+
raise AttributeError(f"module 'ast' has no attribute {attr!r}") from None
734+
warnings._deprecated(f"ast.{attr}", remove=(3, 21))
735+
return val
736+
717737
if __name__ == '__main__':
718738
main()

0 commit comments

Comments
 (0)