summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2020-10-19 15:50:36 +0100
committerGitHub <noreply@github.com>2020-10-19 15:50:36 +0100
commitc82f10450c547eb94a04ee17b7c816ff31948297 (patch)
treead305c05c5745e1a5e7c136545bec7eefa741e32
parenteee6bb50c69d94280f43b47390ea9d1b5f42930c (diff)
parentb580ed1d9d55461d8dde027411b90be26cae131e (diff)
downloadcpython-git-bpo-39107.tar.gz
Merge branch 'master' into bpo-39107bpo-39107
-rw-r--r--Doc/c-api/codec.rst8
-rw-r--r--Doc/c-api/decimal.rst6
-rw-r--r--Doc/c-api/dict.rst10
-rw-r--r--Doc/c-api/gen.rst15
-rw-r--r--Doc/c-api/iter.rst18
-rw-r--r--Doc/data/refcounts.dat10
-rw-r--r--Doc/faq/programming.rst41
-rw-r--r--Doc/glossary.rst10
-rw-r--r--Doc/howto/urllib2.rst2
-rw-r--r--Doc/library/abc.rst26
-rw-r--r--Doc/library/array.rst5
-rw-r--r--Doc/library/ast.rst33
-rw-r--r--Doc/library/bisect.rst2
-rw-r--r--Doc/library/codecs.rst11
-rw-r--r--Doc/library/collections.abc.rst2
-rw-r--r--Doc/library/collections.rst4
-rw-r--r--Doc/library/dataclasses.rst4
-rw-r--r--Doc/library/difflib.rst2
-rw-r--r--Doc/library/functions.rst45
-rw-r--r--Doc/library/functools.rst7
-rw-r--r--Doc/library/math.rst4
-rw-r--r--Doc/library/optparse.rst2
-rw-r--r--Doc/library/pathlib.rst8
-rw-r--r--Doc/library/random.rst67
-rw-r--r--Doc/library/secrets.rst2
-rw-r--r--Doc/library/shelve.rst2
-rw-r--r--Doc/library/shutil.rst2
-rw-r--r--Doc/library/site.rst4
-rw-r--r--Doc/library/stdtypes.rst124
-rw-r--r--Doc/library/sys.rst2
-rw-r--r--Doc/library/test.rst2
-rw-r--r--Doc/library/types.rst5
-rw-r--r--Doc/library/typing.rst105
-rw-r--r--Doc/library/unittest.rst3
-rw-r--r--Doc/library/xml.etree.elementtree.rst6
-rw-r--r--Doc/reference/compound_stmts.rst19
-rw-r--r--Doc/reference/datamodel.rst15
-rw-r--r--Doc/tutorial/floatingpoint.rst2
-rw-r--r--Doc/tutorial/whatnow.rst2
-rw-r--r--Doc/whatsnew/3.10.rst99
-rw-r--r--Doc/whatsnew/3.2.rst4
-rw-r--r--Doc/whatsnew/3.9.rst56
-rw-r--r--Grammar/python.gram2
-rw-r--r--Include/abstract.h18
-rw-r--r--Include/ceval.h8
-rw-r--r--Include/codecs.h8
-rw-r--r--Include/cpython/fileobject.h10
-rw-r--r--Include/cpython/listobject.h2
-rw-r--r--Include/cpython/object.h1
-rw-r--r--Include/cpython/pystate.h2
-rw-r--r--Include/fileobject.h7
-rw-r--r--Include/genobject.h17
-rw-r--r--Include/internal/pycore_fileutils.h2
-rw-r--r--Include/patchlevel.h4
-rw-r--r--Include/pymacro.h4
-rw-r--r--Include/unicodeobject.h5
-rw-r--r--Lib/abc.py38
-rw-r--r--Lib/ast.py2
-rwxr-xr-xLib/cProfile.py5
-rw-r--r--Lib/collections/__init__.py2
-rw-r--r--Lib/ctypes/test/test_find.py12
-rw-r--r--Lib/ctypes/util.py30
-rw-r--r--Lib/dataclasses.py16
-rw-r--r--Lib/datetime.py8
-rw-r--r--Lib/email/message.py4
-rw-r--r--Lib/encodings/__init__.py3
-rw-r--r--Lib/ensurepip/__init__.py31
-rw-r--r--Lib/ensurepip/_bundled/pip-20.2.3-py2.py3-none-any.whl (renamed from Lib/ensurepip/_bundled/pip-20.1.1-py2.py3-none-any.whl)bin1490666 -> 1503696 bytes
-rw-r--r--Lib/graphlib.py7
-rw-r--r--Lib/heapq.py2
-rw-r--r--Lib/importlib/_bootstrap_external.py3
-rw-r--r--Lib/inspect.py19
-rw-r--r--Lib/logging/__init__.py9
-rw-r--r--Lib/pathlib.py19
-rwxr-xr-xLib/profile.py5
-rw-r--r--Lib/pydoc_data/topics.py1134
-rw-r--r--Lib/random.py4
-rw-r--r--Lib/sched.py20
-rw-r--r--Lib/symtable.py19
-rw-r--r--Lib/test/dataclass_module_1.py6
-rw-r--r--Lib/test/dataclass_module_1_str.py32
-rw-r--r--Lib/test/dataclass_module_2.py6
-rw-r--r--Lib/test/dataclass_module_2_str.py32
-rw-r--r--Lib/test/dataclass_textanno.py2
-rw-r--r--Lib/test/datetimetester.py3
-rw-r--r--Lib/test/multibytecodec_support.py22
-rw-r--r--Lib/test/test_abc.py149
-rw-r--r--Lib/test/test_annotations.py228
-rw-r--r--Lib/test/test_ast.py6
-rw-r--r--Lib/test/test_charmapcodec.py7
-rw-r--r--Lib/test/test_codecs.py86
-rw-r--r--Lib/test/test_complex.py62
-rw-r--r--Lib/test/test_coroutines.py8
-rw-r--r--Lib/test/test_dataclasses.py116
-rw-r--r--Lib/test/test_dis.py38
-rw-r--r--Lib/test/test_finalization.py23
-rw-r--r--Lib/test/test_float.py3
-rw-r--r--Lib/test/test_functools.py4
-rw-r--r--Lib/test/test_gc.py6
-rw-r--r--Lib/test/test_genericalias.py4
-rw-r--r--Lib/test/test_grammar.py56
-rw-r--r--Lib/test/test_inspect.py44
-rw-r--r--Lib/test/test_io.py7
-rw-r--r--Lib/test/test_isinstance.py10
-rw-r--r--Lib/test/test_lib2to3.py3
-rw-r--r--Lib/test/test_logging.py54
-rw-r--r--Lib/test/test_math.py2
-rw-r--r--Lib/test/test_opcodes.py2
-rw-r--r--Lib/test/test_peg_generator/test_c_parser.py33
-rw-r--r--Lib/test/test_positional_only_arg.py17
-rw-r--r--Lib/test/test_profile.py16
-rw-r--r--Lib/test/test_pydoc.py4
-rw-r--r--Lib/test/test_random.py16
-rw-r--r--Lib/test/test_sched.py11
-rw-r--r--Lib/test/test_site.py4
-rw-r--r--Lib/test/test_symtable.py18
-rw-r--r--Lib/test/test_syntax.py17
-rw-r--r--Lib/test/test_sys_settrace.py17
-rw-r--r--Lib/test/test_textwrap.py72
-rw-r--r--Lib/test/test_types.py4
-rw-r--r--Lib/test/test_typing.py64
-rw-r--r--Lib/test/test_ucn.py3
-rw-r--r--Lib/test/test_unicode.py5
-rw-r--r--Lib/test/test_with.py8
-rw-r--r--Lib/test/test_xml_etree.py8
-rw-r--r--Lib/test/test_zipfile.py36
-rw-r--r--Lib/textwrap.py12
-rw-r--r--Lib/tkinter/__init__.py5
-rw-r--r--Lib/tkinter/font.py4
-rw-r--r--Lib/tkinter/test/test_tkinter/test_font.py6
-rw-r--r--Lib/tkinter/test/test_tkinter/test_misc.py48
-rw-r--r--Lib/typing.py24
-rw-r--r--Lib/xml/etree/ElementTree.py5
-rw-r--r--Lib/zipfile.py25
-rwxr-xr-xMac/BuildScript/build-installer.py6
-rw-r--r--Misc/ACKS5
-rw-r--r--Misc/NEWS.d/3.10.0a1.rst3509
-rw-r--r--Misc/NEWS.d/3.9.0a2.rst2
-rw-r--r--Misc/NEWS.d/next/Build/2020-05-19-10-54-08.bpo-40683.W8JHrr.rst2
-rw-r--r--Misc/NEWS.d/next/Build/2020-06-08-19-57-05.bpo-40684.WIY2-i.rst2
-rw-r--r--Misc/NEWS.d/next/Build/2020-06-15-22-14-25.bpo-36020.wbiv0P.rst2
-rw-r--r--Misc/NEWS.d/next/Build/2020-06-25-06-59-13.bpo-40204.GpD04D.rst1
-rw-r--r--Misc/NEWS.d/next/Build/2020-08-24-18-34-01.bpo-41617.sKKXz7.rst2
-rw-r--r--Misc/NEWS.d/next/C API/2020-02-08-08-01-35.bpo-39583.qURKSl.rst1
-rw-r--r--Misc/NEWS.d/next/C API/2020-05-20-19-11-12.bpo-40703.qQXfW8.rst2
-rw-r--r--Misc/NEWS.d/next/C API/2020-05-26-16-21-47.bpo-39573.depAgq.rst5
-rw-r--r--Misc/NEWS.d/next/C API/2020-05-27-11-02-15.bpo-40792.pBw2Bb.rst2
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-01-16-12-37.bpo-40826.zQzFoK.rst2
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-01-20-47-49.bpo-40839.bAi52Z.rst2
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-03-17-48-13.bpo-40679.3sgWma.rst1
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-04-08-01-23.bpo-40724.qIIdSi.rst1
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-08-15-59-06.bpo-40910.L56oI0.rst3
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-10-18-37-26.bpo-40943.i4q7rK.rst5
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-15-16-46-01.bpo-36020.djI6jw.rst2
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-15-23-17-51.bpo-40989.tlzG3r.rst3
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-17-11-24-00.bpo-36346.fTMr3S.rst4
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-17-20-31-12.bpo-36346.mwIyxi.rst2
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-24-22-57-07.bpo-41103.doojgE.rst4
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-26-13-29-25.bpo-41123.bRa1oy.rst1
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-28-11-39-22.bpo-41123.sjJWjQ.rst1
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-29-11-33-49.bpo-41123.qFevek.rst1
-rw-r--r--Misc/NEWS.d/next/C API/2020-06-29-15-49-36.bpo-41123.wYY4E1.rst1
-rw-r--r--Misc/NEWS.d/next/C API/2020-07-08-10-14-52.bpo-40170.N6Qx1i.rst4
-rw-r--r--Misc/NEWS.d/next/C API/2020-07-26-19-39-45.bpo-30155.rHZRJ_.rst3
-rw-r--r--Misc/NEWS.d/next/C API/2020-08-10-16-05-08.bpo-41324.waZD35.rst3
-rw-r--r--Misc/NEWS.d/next/C API/2020-08-12-17-09-06.bpo-41524.u6Xfr2.rst2
-rw-r--r--Misc/NEWS.d/next/C API/2020-09-01-23-39-45.bpo-41689.zxHbLB.rst2
-rw-r--r--Misc/NEWS.d/next/C API/2020-09-22-14-47-12.bpo-41834.nrOrDU.rst3
-rw-r--r--Misc/NEWS.d/next/C API/2020-09-28-14-31-07.bpo-41756.ZZ5wJG.rst3
-rw-r--r--Misc/NEWS.d/next/C API/2020-10-09-22-50-46.bpo-41986.JUPE59.rst2
-rw-r--r--Misc/NEWS.d/next/C API/2020-10-10-14-05-24.bpo-40422.sh8IDY.rst1
-rw-r--r--Misc/NEWS.d/next/C API/2020-10-11-19-17-44.bpo-40423.GsmgEj.rst3
-rw-r--r--Misc/NEWS.d/next/C API/2020-10-12-20-13-58.bpo-42015.X4H2_V.rst3
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2018-08-29-15-57-07.bpo-19569.RGu2Kb.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2019-05-25-05-27-39.bpo-36982.0UHgfB.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2019-06-02-11-29-15.bpo-29882.AkRzjb.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2019-09-01-14-26-02.bpo-37999.XPl6dn.rst5
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-04-05-02-35-08.bpo-1635741.Kfe9fT.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-04-10-23-54-57.bpo-1635741.ZURqoN.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-04-11-13-07-49.bpo-4022.Ctpn_F.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-03-22-26-00.bpo-29590.aRz3l7.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-19-19-39-49.bpo-40679.SVzz9p.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-20-01-17-34.bpo-40521.wvAehI.rst9
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-21-01-54-00.bpo-40696.u3n8Wx.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-22-00-34-34.bpo-39573.QO2QHj.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-23-01-15-51.bpo-40217.jZsHTc.rst4
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-24-02-42-26.bpo-40750.ZmO9Ev.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-25-21-49-11.bpo-38964.lrml90.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-26-17-43-58.bpo-40780.3Ckdgm.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-27-16-08-16.bpo-38605.rcs2uK.rst3
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-27-22-37-58.bpo-40792.WEDqqU.rst3
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-30-14-37-18.bpo-40824.XR3V5s.rst4
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-30-23-18-35.bpo-19468.S-TA7p.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-05-30-23-23-35.bpo-1635741.0D-laM.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-01-20-31-07.bpo-40826.XCI4M2.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-03-13-53-24.bpo-40854.O6vfQU.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-05-12-48-28.bpo-40870.9cd2sk.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-05-23-25-00.bpo-40883.M6sQ-Q.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-06-00-23-19.bpo-40880.fjdzSh.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-07-22-50-10.bpo-40903.7dWejS.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-08-01-08-57.bpo-40904.76qQzo.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-08-22-46-33.bpo-40889.vIBl-W.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-09-00-20-13.bpo-40890.LoRV-g.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-09-23-52-32.bpo-40847.4XAACw.rst4
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-10-11-27-15.bpo-40939.DO-wAI.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-11-16-06-49.bpo-40947.72cZcR.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-12-00-12-28.bpo-40950.tzMy7m.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-12-12-21-54.bpo-40957.Z8n6I6.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-12-22-56-17.bpo-1635741.mmlp3Q.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-15-01-20-44.bpo-40958.7O2Wh1.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-15-16-29-55.bpo-40985.IIN_xX.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-17-00-52-21.bpo-1635741.61iyYh.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-17-10-27-17.bpo-40636.MYaCIe.rst3
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-18-00-07-09.bpo-41006.H-wN-d.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-18-19-04-30.bpo-40077._yI-ax.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-20-16-59-02.bpo-40939.6810Ak.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-20-17-00-44.bpo-35975.UDHCHp.rst3
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-20-19-27-47.bpo-40939.jxJ4yn.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-20-22-46-18.bpo-41052.46MPeF.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-21-10-54-02.bpo-41061.AHf9MU.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-21-19-53-33.bpo-41056.IDu_EK.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-22-13-22-30.bpo-41076.eWYw2N.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-23-07-35-11.bpo-40521.dMNA6k.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-23-15-10-19.bpo-41084.pt3y7F.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-23-23-26-42.bpo-41094.zEIJse.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-01-20-17-38.bpo-1635741.-AtPYu.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-03-23-10-02.bpo-1635741.F5coWe.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst4
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-06-18-36-33.bpo-41215.vFGFIz.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-06-20-43-19.bpo-1635741.LYhsni.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-07-16-10-52.bpo-1635741.zU-H_n.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-17-11-31-54.bpo-41323.ChbZHh.rst3
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-18-08-15-32.bpo-41295.pu8Ezo.rst3
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-18-18-01-10.bpo-41334.t5xMGp.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-19-15-40-52.bpo-41342.RRk_m_.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-20-17-01-17.bpo-38156.ptcdRy.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-27-01-50-06.bpo-41340.pZXfcF.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-07-28-22-43-27.bpo-41428.FM6xsI.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-02-15-53-12.bpo-41431.TblUBT.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-10-16-11-32.bpo-1635741.O0d3ym.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-12-07-35-07.bpo-41525.d9q3XL.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-12-19-32-15.bpo-41531.WgPzjT.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-12-20-29-57.bpo-41533.4pcVAc.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-13-07-18-05.bpo-1635741.FC13e7.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-13-07-19-21.bpo-1653741.fubBkb.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-25-22-43-33.bpo-40077.vcxSUa.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-26-11-23-31.bpo-41631.3jZcd9.rst5
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-28-20-54-04.bpo-1635741.7ijlcI.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-30-20-38-33.bpo-41654.HtnhAM.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-31-14-53-17.bpo-41675.VSoqWU.rst3
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-08-31-17-49-02.bpo-41681.3-VJiH.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-06-02.bpo-1635741.5jZymK.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-08-07.bpo-1635741.X9CZgo.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-22-35.bpo-1635741.CnRME3.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-02-12-00-57.bpo-41690.Ny-Sfy.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-07-09-45-47.bpo-1635741.QuDIut.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-07-11-35-02.bpo-1635741.rvIexb.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-08-20-39-43.bpo-1635741.jiXmyT.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-08-21-58-47.bpo-1635741.vdjSLH.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-12-12-55-45.bpo-41756.1h0tbV.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-12-18-34-34.bpo-1635741.lh335O.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-09-15-23-29-49.bpo-41780.bOBUIH.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-10-02-11-35-33.bpo-41894.ffmtOt.rst3
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-10-08-09-58-19.bpo-41974.8B-q8O.rst4
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-10-09-10-55-50.bpo-41979.ImXIk2.rst1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-10-10-13-53-52.bpo-41993.YMzixQ.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-10-14-16-19-43.bpo-41984.SEtKMr.rst2
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-10-15-21-55-32.bpo-42030.PmU2CA.rst3
-rw-r--r--Misc/NEWS.d/next/Documentation/2019-08-16-20-25-42.bpo-37703.Qm_l_H.rst2
-rw-r--r--Misc/NEWS.d/next/Documentation/2020-03-07-03-53-39.bpo-39883.1tnb4-.rst1
-rw-r--r--Misc/NEWS.d/next/Documentation/2020-05-09-12-10-31.bpo-40552._0uB73.rst2
-rw-r--r--Misc/NEWS.d/next/Documentation/2020-07-21-15-23-30.bpo-40979.pLA8rO.rst1
-rw-r--r--Misc/NEWS.d/next/Documentation/2020-07-25-14-20-00.bpo-41314.yrjko0.rst1
-rw-r--r--Misc/NEWS.d/next/Documentation/2020-07-27-20-46-17.bpo-41045.GFF6Ul.rst1
-rw-r--r--Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst3
-rw-r--r--Misc/NEWS.d/next/Documentation/2020-08-25-15-11-23.bpo-41624.ddjJlN.rst1
-rw-r--r--Misc/NEWS.d/next/Documentation/2020-09-08-16-57-09.bpo-41726.g0UXrn.rst1
-rw-r--r--Misc/NEWS.d/next/Documentation/2020-09-10-07-48-02.bpo-37149.VD0rCv.rst1
-rw-r--r--Misc/NEWS.d/next/Documentation/2020-09-12-17-37-13.bpo-35293._cOwPD.rst1
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-05-24-06-19-43.bpo-40723.AJLd4U.rst1
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-05-29-18-21-58.bpo-39885.zB_-bN.rst2
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-06-27-17-02-00.bpo-41144.JoFGIX.rst1
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-06-29-14-51-15.bpo-41152.d6mV0C.rst2
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst2
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-07-16-17-39-06.bpo-41300.wRixNb.rst2
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-07-24-17-49-58.bpo-41373.YQIPu_.rst3
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-08-09-13-42-55.bpo-41468.zkP0_Y.rst1
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-09-22-00-45-40.bpo-40181.hhQi3z.rst2
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-09-22-11-13-45.bpo-35764.VoNa8y.rst1
-rw-r--r--Misc/NEWS.d/next/IDLE/2020-09-24-14-31-16.bpo-41775.sB8Vre.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2018-06-07-22-04-01.bpo-28557.ViNJnK.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2018-06-12-23-30-41.bpo-33660.AdDn5Z.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2018-07-29-12-14-54.bpo-34226.BE7zbu.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2018-07-30-12-48-17.bpo-31844.0_GKsD.rst4
-rw-r--r--Misc/NEWS.d/next/Library/2018-08-21-16-20-33.bpo-29620.xxx666.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2018-10-27-09-37-03.bpo-35078.kweA3R.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2019-03-01-01-56-23.bpo-33944.-82Pkt.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2019-03-17-19-01-53.bpo-36290.7VXo_K.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2019-05-31-23-54-28.bpo-12178.N6FLCZ.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2019-08-11-16-28-03.bpo-26543.X-TJZO.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2019-09-12-21-34-03.bpo-38144.8uQCdd.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2019-10-25-23-45-49.bpo-35714.fw3xb7.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2019-11-13-07-37-11.bpo-38731.9qmcSx.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2019-12-15-18-47-20.bpo-39040.tKa0Qs.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-02-23-15-09-47.bpo-39244.aBK5IM.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-02-24-10-58-34.bpo-39728.kOOaHn.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-03-11-07-44-06.bpo-31122.zIQ80l.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-03-29-21-32-00.bpo-40084.MCYwcv.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-04-18-14-16-02.bpo-40318.K2UdRx.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-04-20-22-08-36.bpo-23082.iX90Id.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-04-23-18-21-19.bpo-39385.MIAyS7.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-04-12-16-00.bpo-40492.ONk9Na.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-06-02-01-25.bpo-13097.Wh5xSK.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-07-22-00-12.bpo-39881.E1xsNv.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-13-16-28-33.bpo-40611.ZCk0_c.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-15-21-14-45.bpo-36543.Jt-eSX.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-17-02-03-09.bpo-32309.KM9psl.rst4
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-18-15-26-31.bpo-40671.NeZ9Cy.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-18-15-38-25.bpo-25920.PxrLY8.rst7
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-18-17-29-30.bpo-40626.NeZufF.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-18-22-41-02.bpo-40614.8j3kmq.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-20-12-53-20.bpo-9216.ps7Yf1.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-20-13-03-28.bpo-40695.lr4aIS.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-20-14-38-04.bpo-40698.zwl5Hc.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-22-12-45-58.bpo-40726.7oBdMw.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-23-00-22-11.bpo-40737.iph-CM.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-23-04-18-00.bpo-37129.YoYoYo.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-24-11-06-37.bpo-40756.7ZH83z.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-24-23-52-35.bpo-40759.DdZdaw.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-25-11-52-23.bpo-30064.6CICsH.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-25-22-18-38.bpo-30008.CKC3td.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-27-00-09-52.bpo-16995.4niOT7.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-27-17-00-18.bpo-40795.eZSnHA.rst4
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-27-18-04-52.bpo-40791.IzpNor.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-27-21-27-01.bpo-40767.L5MnVV.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-27-22-19-42.bpo-40792.87Yx01.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-28-16-51-00.bpo-38488.hFQNgA.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-28-17-32-29.bpo-40777.1kJU6N.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-30-08-10-23.bpo-40744.jKURVV.rst4
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-30-14-19-47.bpo-26407.MjWLO1.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-30-18-48-58.bpo-40755.IyOe2J.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-31-15-52-18.bpo-40834.MO9_hb.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-05-31-23-32-36.bpo-17005.JlRUGB.rst4
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-01-02-16-29.bpo-39314.0T9hlA.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-02-02-16-02.bpo-39791.StCJlA.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-02-23-49-07.bpo-32604.ZN4V4l.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-04-16-25-15.bpo-40807.yYyLWx.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-05-19-29-10.bpo-39791._CcO3d.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-05-20-00-18.bpo-40876.zDhiZj.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-06-02-42-26.bpo-40884.n7fOwS.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-06-14-09-55.bpo-33689.EFUDH7.rst4
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-08-18-59-16.bpo-23427.ilg1Cz.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-11-11-07-10.bpo-40939.-D5Asl.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-12-10-44-15.bpo-40855.jSot83.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-12-11-55-30.bpo-40955.huixCg.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-13-12-04-50.bpo-40924.SM_luS.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-15-00-13-57.bpo-40967._dx3OO.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-15-12-22-53.bpo-40448.1dk8Bu.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-17-17-26-24.bpo-41002.NPBItE.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-17-23-49-45.bpo-35018.NP5_Qk.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-18-10-34-59.bpo-41025.elf_nz.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-20-10-16-57.bpo-41048.hEXB-B.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-20-18-33-03.bpo-41056.gTH4Bq.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-20-18-35-43.bpo-41056.Garcle.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-20-18-37-29.bpo-41056.d9v_uL.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-20-21-03-55.bpo-41058.gztdZy.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-22-10-25-39.bpo-41068._bX2BW.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-22-20-08-40.bpo-31938.EVuko9.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-23-06-09-59.bpo-40521.HUfxP7.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-25-10-11-47.bpo-31082.HsgDkx.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-27-13-51-36.bpo-41138.bIpf7g.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-28-21-16-51.bpo-40874.YImvzA.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-30-20-50-51.bpo-41161.QTdJjz.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-01-17-33-50.bpo-41182.FPFI0N.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst4
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-02-15-03-04.bpo-41195.cEnpO3.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-03-13-15-08.bpo-41194.djrKjs.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-04-21-56-46.bpo-39168.DQWsXj.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-05-19-16-02.bpo-29727.Q6Z2rg.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-06-16-58-53.bpo-41207.Emw7Nk.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-11-00-15-01.bpo-41273.SVrsJh.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-18-18-07-40.bpo-41333.upkHIm.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-20-13-27-48.bpo-41344.iKipNd.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-20-19-13-17.bpo-41341.wqrj8C.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-21-16-20-55.bpo-35328.jXovHb.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-21-21-45-55.bpo-41364.5O-k7A.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-23-01-18-34.bpo-41317.O17Z6x.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-26-21-18-43.bpo-41384.MlzIgV.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-28-12-08-58.bpo-41316.bSCbK4.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-07-30-14-56-58.bpo-41440.rju34k.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-01-00-51-15.bpo-41421.dHKRVB.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-03-01-59-48.bpo-41425.KJo6zF.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-04-00-20-30.bpo-41467.Z8DgTL.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-07-15-18-16.bpo-41503.IYftcu.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-09-18-16-05.bpo-41513.e6K6EK.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-12-07-43-31.bpo-41528.bu83oD.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-15-15-21-40.bpo-37658.f9nivB.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-15-15-50-12.bpo-32751.85je5X.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-15-18-17-21.bpo-39994.dOgPOh.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-21-15-51-15.bpo-41609.JmiUKG.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-23-14-23-18.bpo-41513.DGqc_I.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-29-16-07-36.bpo-41662.Mn79zh.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-29-16-45-12.bpo-41638.iZfW5N.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-30-10-24-26.bpo-39010._mzXJW.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-08-30-21-38-57.bpo-41662.6e9iZn.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-01-15-57-51.bpo-41687.m1b1KA.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-03-01-35-32.bpo-41696.zkYGre.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-04-20-45-38.bpo-41720.PW9MzZ.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-06-20-27-10.bpo-41732.1SKv26.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-08-13-51-16.bpo-1635741.wkPeoT.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-08-13-55-34.bpo-1635741.56MLP-.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-11-12-38-55.bpo-39651.JMp9l2.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-12-16-18-42.bpo-32218.IpYkEe.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-13-02-02-18.bpo-39337.L3NXTt.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-14-19-27-46.bpo-41789.pI_uZQ.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-15-07-55-35.bpo-41792.qMpSlU.rst6
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-15-14-56-13.bpo-39587.69xzuh.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-15-22-43-30.bpo-41517.sLBH7g.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-19-12-22-08.bpo-41816.ynynXJ.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-19-23-14-54.bpo-41815.RNpuX3.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-20-15-14-05.bpo-41810.7l8lyV.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-22-00-23-30.bpo-41817.bnh-VG.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-22-11-07-50.bpo-41831.k-Eop_.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-22-13-51-14.bpo-41833.6HVDjT.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-22-14-55-34.bpo-40670.R5sm68.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-09-29-16-23-54.bpo-41876.QicdDU.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-10-01-21-11-03.bpo-41905._JpjR4.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-10-03-23-14-50.bpo-41923.Buonw9.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst3
-rw-r--r--Misc/NEWS.d/next/Library/2020-10-12-21-21-24.bpo-42021.8yv_8-.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-10-16-16-08-04.bpo-28660.eX9pvD.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2020-10-16-22-48-01.bpo-19270.jd_gkA.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-10-17-07-52-53.bpo-41966.gwEQRZ.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2020-10-17-23-17-18.bpo-42065.85BsRA.rst3
-rw-r--r--Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst2
-rw-r--r--Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst1
-rw-r--r--Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst2
-rw-r--r--Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst1
-rw-r--r--Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst1
-rw-r--r--Misc/NEWS.d/next/Tests/2018-08-20-09-38-52.bpo-34401.eGxMPm.rst1
-rw-r--r--Misc/NEWS.d/next/Tests/2019-09-14-13-20-27.bpo-38169.hurq4B.rst1
-rw-r--r--Misc/NEWS.d/next/Tests/2020-04-09-15-40-03.bpo-31904.TJ4k3d.rst1
-rw-r--r--Misc/NEWS.d/next/Tests/2020-05-26-07-53-31.bpo-17258.X_IKTQ.rst1
-rw-r--r--Misc/NEWS.d/next/Tests/2020-06-09-18-48-18.bpo-40927.67ylLg.rst2
-rw-r--r--Misc/NEWS.d/next/Tests/2020-06-12-20-46-23.bpo-40964.OBzf2c.rst2
-rw-r--r--Misc/NEWS.d/next/Tests/2020-06-17-15-07-14.bpo-41003.tiH_Fy.rst3
-rw-r--r--Misc/NEWS.d/next/Tests/2020-06-17-17-27-07.bpo-41009.Rvn6OQ.rst2
-rw-r--r--Misc/NEWS.d/next/Tests/2020-06-17-18-00-21.bpo-38377.jfg4TH.rst4
-rw-r--r--Misc/NEWS.d/next/Tests/2020-06-22-00-21-12.bpo-41069.bLZkX-.rst2
-rw-r--r--Misc/NEWS.d/next/Tests/2020-06-23-12-02-45.bpo-41085.JZKsyz.rst2
-rw-r--r--Misc/NEWS.d/next/Tests/2020-08-03-13-44-37.bpo-41306.VDoWXI.rst1
-rw-r--r--Misc/NEWS.d/next/Tests/2020-08-07-17-28-49.bpo-41477.GrFexU.rst1
-rw-r--r--Misc/NEWS.d/next/Tests/2020-08-11-14-59-13.bpo-41521.w2UYK7.rst2
-rw-r--r--Misc/NEWS.d/next/Tests/2020-08-25-19-25-36.bpo-41602.Z64s0I.rst1
-rw-r--r--Misc/NEWS.d/next/Tests/2020-09-11-19-12-31.bpo-41731.Ivxh4U.rst1
-rw-r--r--Misc/NEWS.d/next/Tests/2020-10-05-17-43-46.bpo-41944.rf1dYb.rst1
-rw-r--r--Misc/NEWS.d/next/Tests/2020-10-08-14-00-17.bpo-41970.aZ8QFf.rst2
-rw-r--r--Misc/NEWS.d/next/Tests/2020-10-12-00-11-47.bpo-41739.wSCc4K.rst2
-rw-r--r--Misc/NEWS.d/next/Windows/2019-07-11-06-11-09.bpo-37556.sygMUU.rst1
-rw-r--r--Misc/NEWS.d/next/Windows/2020-05-19-04-11-12.bpo-40677.qQbLW8.rst1
-rw-r--r--Misc/NEWS.d/next/Windows/2020-05-19-14-43-33.bpo-39631.Z5yXam.rst2
-rw-r--r--Misc/NEWS.d/next/Windows/2020-06-12-13-13-44.bpo-40164.SPrSn5.rst1
-rw-r--r--Misc/NEWS.d/next/Windows/2020-06-23-03-12-57.bpo-41039.0hgd0s.rst2
-rw-r--r--Misc/NEWS.d/next/Windows/2020-06-24-21-30-42.bpo-41074.gaQc3C.rst3
-rw-r--r--Misc/NEWS.d/next/Windows/2020-06-28-12-40-41.bpo-41142.jpZzzh.rst2
-rw-r--r--Misc/NEWS.d/next/Windows/2020-07-20-23-26-26.bpo-40741.C9sc_d.rst1
-rw-r--r--Misc/NEWS.d/next/Windows/2020-07-28-11-55-43.bpo-41412.ME20KB.rst2
-rw-r--r--Misc/NEWS.d/next/Windows/2020-07-28-12-39-32.bpo-40948.ISUFO6.rst1
-rw-r--r--Misc/NEWS.d/next/Windows/2020-08-06-16-59-10.bpo-41492.2FQ9cM.rst1
-rw-r--r--Misc/NEWS.d/next/Windows/2020-08-13-22-40-58.bpo-41526.-i2bwb.rst2
-rw-r--r--Misc/NEWS.d/next/Windows/2020-08-26-09-35-06.bpo-41557.vt00cQ.rst1
-rw-r--r--Misc/NEWS.d/next/Windows/2020-09-04-21-35-28.bpo-41627.sx2KN1.rst2
-rw-r--r--Misc/NEWS.d/next/Windows/2020-09-11-17-59-33.bpo-41744.e_ugDQ.rst1
-rw-r--r--Misc/NEWS.d/next/Windows/2020-10-18-18-43-45.bpo-38252.7Nlepg.rst1
-rw-r--r--Misc/NEWS.d/next/macOS/2020-06-07-20-10-56.bpo-40741.80A2BW.rst1
-rw-r--r--Misc/NEWS.d/next/macOS/2020-06-17-13-45-15.bpo-41005.zZegdV.rst1
-rw-r--r--Misc/NEWS.d/next/macOS/2020-06-19-14-19-08.bpo-40741.L7yTbm.rst1
-rw-r--r--Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst7
-rw-r--r--Misc/NEWS.d/next/macOS/2020-06-25-06-09-00.bpo-39580.N_vJ9h.rst2
-rw-r--r--Modules/Setup2
-rw-r--r--Modules/_asynciomodule.c9
-rw-r--r--Modules/_bisectmodule.c14
-rw-r--r--Modules/_codecsmodule.c42
-rw-r--r--Modules/_datetimemodule.c12
-rw-r--r--Modules/_posixsubprocess.c16
-rw-r--r--Modules/_sqlite/cache.c137
-rw-r--r--Modules/_sqlite/cache.h6
-rw-r--r--Modules/_sqlite/connection.c84
-rw-r--r--Modules/_sqlite/connection.h4
-rw-r--r--Modules/_sqlite/cursor.c78
-rw-r--r--Modules/_sqlite/cursor.h4
-rw-r--r--Modules/_sqlite/microprotocols.c13
-rw-r--r--Modules/_sqlite/microprotocols.h2
-rw-r--r--Modules/_sqlite/module.c234
-rw-r--r--Modules/_sqlite/prepare_protocol.c69
-rw-r--r--Modules/_sqlite/prepare_protocol.h4
-rw-r--r--Modules/_sqlite/row.c96
-rw-r--r--Modules/_sqlite/row.h4
-rw-r--r--Modules/_sqlite/statement.c75
-rw-r--r--Modules/_sqlite/statement.h4
-rw-r--r--Modules/_testcapimodule.c23
-rw-r--r--Modules/_tracemalloc.c2
-rw-r--r--Modules/clinic/_codecsmodule.c.h50
-rw-r--r--Modules/clinic/fcntlmodule.c.h10
-rw-r--r--Modules/clinic/posixmodule.c.h10
-rw-r--r--Modules/clinic/selectmodule.c.h20
-rw-r--r--Modules/clinic/termios.c.h225
-rw-r--r--Modules/fcntlmodule.c28
-rw-r--r--Modules/mathmodule.c2
-rw-r--r--Modules/posixmodule.c64
-rw-r--r--Modules/selectmodule.c19
-rw-r--r--Modules/termios.c212
-rw-r--r--Modules/unicodedata.c161
-rw-r--r--Objects/abstract.c13
-rw-r--r--Objects/boolobject.c25
-rw-r--r--Objects/bytes_methods.c20
-rw-r--r--Objects/bytesobject.c2
-rw-r--r--Objects/complexobject.c59
-rw-r--r--Objects/enumobject.c19
-rw-r--r--Objects/fileobject.c11
-rw-r--r--Objects/floatobject.c21
-rw-r--r--Objects/genericaliasobject.c2
-rw-r--r--Objects/genobject.c32
-rw-r--r--Objects/methodobject.c6
-rw-r--r--Objects/object.c13
-rw-r--r--Objects/stringlib/codecs.h30
-rw-r--r--Objects/stringlib/find_max_char.h20
-rw-r--r--Objects/typeobject.c22
-rw-r--r--Objects/unicodeobject.c49
-rw-r--r--Objects/unionobject.c19
-rw-r--r--PC/python3dll.c1
-rw-r--r--PCbuild/get_externals.bat2
-rw-r--r--PCbuild/python.props2
-rw-r--r--PCbuild/readme.txt2
-rwxr-xr-xParser/asdl_c.py42
-rw-r--r--Parser/parser.c15
-rw-r--r--Parser/pegen.c2
-rw-r--r--Python/ast.c14
-rw-r--r--Python/ast_opt.c24
-rw-r--r--Python/ceval.c28
-rw-r--r--Python/codecs.c50
-rw-r--r--Python/compile.c33
-rw-r--r--Python/dynload_aix.c184
-rw-r--r--Python/dynload_dl.c23
-rw-r--r--Python/dynload_hpux.c15
-rw-r--r--Python/dynload_shlib.c4
-rw-r--r--Python/errors.c19
-rw-r--r--Python/fileutils.c76
-rw-r--r--Python/future.c2
-rw-r--r--Python/import.c23
-rw-r--r--Python/importlib_external.h222
-rw-r--r--Python/pystate.c1
-rw-r--r--Python/pythonrun.c6
-rw-r--r--Python/sysmodule.c152
-rw-r--r--README.rst4
-rw-r--r--Tools/c-analyzer/c_analyzer/common/files.py4
-rwxr-xr-xTools/clinic/clinic.py13
-rw-r--r--Tools/peg_generator/pegen/sccutils.py4
-rwxr-xr-xconfigure10
-rw-r--r--configure.ac10
-rw-r--r--pyconfig.h.in3
-rw-r--r--setup.py13
575 files changed, 7584 insertions, 3478 deletions
diff --git a/Doc/c-api/codec.rst b/Doc/c-api/codec.rst
index 172dcb326a..235c77c945 100644
--- a/Doc/c-api/codec.rst
+++ b/Doc/c-api/codec.rst
@@ -10,6 +10,14 @@ Codec registry and support functions
As side effect, this tries to load the :mod:`encodings` package, if not yet
done, to make sure that it is always first in the list of search functions.
+.. c:function:: int PyCodec_Unregister(PyObject *search_function)
+
+ Unregister a codec search function and clear the registry's cache.
+ If the search function is not registered, do nothing.
+ Return 0 on success. Raise an exception and return -1 on error.
+
+ .. versionadded:: 3.10
+
.. c:function:: int PyCodec_KnownEncoding(const char *encoding)
Return ``1`` or ``0`` depending on whether there is a registered codec for
diff --git a/Doc/c-api/decimal.rst b/Doc/c-api/decimal.rst
index f530571eba..94cc4a7b84 100644
--- a/Doc/c-api/decimal.rst
+++ b/Doc/c-api/decimal.rst
@@ -16,7 +16,7 @@ Initialize
Typically, a C extension module that uses the decimal API will do these
steps in its init function:
-.. code-block::
+.. code-block:: c
#include "pydecimal.h"
@@ -88,7 +88,7 @@ Data structures
The conversion functions use the following status codes and data structures:
-.. code-block::
+.. code-block:: c
/* status cases for getting a triple */
enum mpd_triple_class {
@@ -126,7 +126,7 @@ Functions
For simplicity, the usage of the function and all special cases are
explained in code form and comments:
-.. code-block::
+.. code-block:: c
triple = PyDec_AsUint128Triple(dec);
switch (triple.tag) {
diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst
index 769484134e..8e0d684546 100644
--- a/Doc/c-api/dict.rst
+++ b/Doc/c-api/dict.rst
@@ -81,14 +81,16 @@ Dictionary Objects
.. c:function:: int PyDict_DelItem(PyObject *p, PyObject *key)
Remove the entry in dictionary *p* with key *key*. *key* must be hashable;
- if it isn't, :exc:`TypeError` is raised. Return ``0`` on success or ``-1``
- on failure.
+ if it isn't, :exc:`TypeError` is raised.
+ If *key* is not in the dictionary, :exc:`KeyError` is raised.
+ Return ``0`` on success or ``-1`` on failure.
.. c:function:: int PyDict_DelItemString(PyObject *p, const char *key)
- Remove the entry in dictionary *p* which has a key specified by the string
- *key*. Return ``0`` on success or ``-1`` on failure.
+ Remove the entry in dictionary *p* which has a key specified by the string *key*.
+ If *key* is not in the dictionary, :exc:`KeyError` is raised.
+ Return ``0`` on success or ``-1`` on failure.
.. c:function:: PyObject* PyDict_GetItem(PyObject *p, PyObject *key)
diff --git a/Doc/c-api/gen.rst b/Doc/c-api/gen.rst
index e098425e63..74410927bf 100644
--- a/Doc/c-api/gen.rst
+++ b/Doc/c-api/gen.rst
@@ -15,11 +15,6 @@ than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
The C structure used for generator objects.
-.. c:type:: PySendResult
-
- The enum value used to represent different results of :c:func:`PyGen_Send`.
-
-
.. c:var:: PyTypeObject PyGen_Type
The type object corresponding to generator objects.
@@ -47,13 +42,3 @@ than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
with ``__name__`` and ``__qualname__`` set to *name* and *qualname*.
A reference to *frame* is stolen by this function. The *frame* argument
must not be ``NULL``.
-
-.. c:function:: PySendResult PyGen_Send(PyGenObject *gen, PyObject *arg, PyObject **presult)
-
- Sends the *arg* value into the generator *gen*. Coroutine objects
- are also allowed to be as the *gen* argument but they need to be
- explicitly casted to PyGenObject*. Returns:
-
- - ``PYGEN_RETURN`` if generator returns. Return value is returned via *presult*.
- - ``PYGEN_NEXT`` if generator yields. Yielded value is returned via *presult*.
- - ``PYGEN_ERROR`` if generator has raised and exception. *presult* is set to ``NULL``.
diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst
index a2992b3452..68df6f6e89 100644
--- a/Doc/c-api/iter.rst
+++ b/Doc/c-api/iter.rst
@@ -44,3 +44,21 @@ something like this::
else {
/* continue doing useful work */
}
+
+
+.. c:type:: PySendResult
+
+ The enum value used to represent different results of :c:func:`PyIter_Send`.
+
+ .. versionadded:: 3.10
+
+
+.. c:function:: PySendResult PyIter_Send(PyObject *iter, PyObject *arg, PyObject **presult)
+
+ Sends the *arg* value into the iterator *iter*. Returns:
+
+ - ``PYGEN_RETURN`` if iterator returns. Return value is returned via *presult*.
+ - ``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*.
+ - ``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to ``NULL``.
+
+ .. versionadded:: 3.10
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
index 6b1bde3796..d01e99ca5e 100644
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -959,11 +959,6 @@ PyGen_NewWithQualName:PyFrameObject*:frame:0:
PyGen_NewWithQualName:PyObject*:name:0:
PyGen_NewWithQualName:PyObject*:qualname:0:
-PyGen_Send:int:::
-PyGen_Send:PyGenObject*:gen:0:
-PyGen_Send:PyObject*:arg:0:
-PyGen_Send:PyObject**:presult:+1:
-
PyCoro_CheckExact:int:::
PyCoro_CheckExact:PyObject*:ob:0:
@@ -1081,6 +1076,11 @@ PyIter_Check:PyObject*:o:0:
PyIter_Next:PyObject*::+1:
PyIter_Next:PyObject*:o:0:
+PyIter_Send:int:::
+PyIter_Send:PyObject*:iter:0:
+PyIter_Send:PyObject*:arg:0:
+PyIter_Send:PyObject**:presult:+1:
+
PyList_Append:int:::
PyList_Append:PyObject*:list:0:
PyList_Append:PyObject*:item:+1:
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index fd0adc378b..2d542cfb1d 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -942,7 +942,7 @@ There are various techniques.
f()
-* Use :func:`locals` or :func:`eval` to resolve the function name::
+* Use :func:`locals` to resolve the function name::
def myFunc():
print("hello")
@@ -952,12 +952,6 @@ There are various techniques.
f = locals()[fname]
f()
- f = eval(fname)
- f()
-
- Note: Using :func:`eval` is slow and dangerous. If you don't have absolute
- control over the contents of the string, someone could pass a string that
- resulted in an arbitrary function being executed.
Is there an equivalent to Perl's chomp() for removing trailing newlines from strings?
-------------------------------------------------------------------------------------
@@ -1141,7 +1135,7 @@ How do you remove duplicates from a list?
See the Python Cookbook for a long discussion of many ways to do this:
- https://github.com/ActiveState/code/tree/master/recipes/Python/52560_Remove_duplicates/recipe-52560.py
+ https://code.activestate.com/recipes/52560/
If you don't mind reordering the list, sort it and then scan from the end of the
list, deleting duplicates as you go::
@@ -1164,6 +1158,21 @@ This converts the list into a set, thereby removing duplicates, and then back
into a list.
+How do you remove multiple items from a list
+--------------------------------------------
+
+As with removing duplicates, explicitly iterating in reverse with a
+delete condition is one possibility. However, it is easier and faster
+to use slice replacement with an implicit or explicit forward iteration.
+Here are three variations.::
+
+ mylist[:] = filter(keep_function, mylist)
+ mylist[:] = (x for x in mylist if keep_condition)
+ mylist[:] = [x for x in mylist if keep_condition]
+
+The list comprehension may be fastest.
+
+
How do you make an array in Python?
-----------------------------------
@@ -1176,7 +1185,7 @@ difference is that a Python list can contain objects of many different types.
The ``array`` module also provides methods for creating arrays of fixed types
with compact representations, but they are slower to index than lists. Also
-note that the Numeric extensions and others define array-like structures with
+note that NumPy and other third party packages define array-like structures with
various characteristics as well.
To get Lisp-style linked lists, you can emulate cons cells using tuples::
@@ -1366,20 +1375,6 @@ out the element you want. ::
['else', 'sort', 'to', 'something']
-An alternative for the last step is::
-
- >>> result = []
- >>> for p in pairs: result.append(p[1])
-
-If you find this more legible, you might prefer to use this instead of the final
-list comprehension. However, it is almost twice as slow for long lists. Why?
-First, the ``append()`` operation has to reallocate memory, and while it uses
-some tricks to avoid doing that each time, it still has to do it occasionally,
-and that costs quite a bit. Second, the expression "result.append" requires an
-extra attribute lookup, and third, there's a speed reduction from having to make
-all those function calls.
-
-
Objects
=======
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index 7be755e411..9fdbdb1a83 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -1084,19 +1084,15 @@ Glossary
Type aliases are useful for simplifying :term:`type hints <type hint>`.
For example::
- from typing import List, Tuple
-
def remove_gray_shades(
- colors: List[Tuple[int, int, int]]) -> List[Tuple[int, int, int]]:
+ colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:
pass
could be made more readable like this::
- from typing import List, Tuple
-
- Color = Tuple[int, int, int]
+ Color = tuple[int, int, int]
- def remove_gray_shades(colors: List[Color]) -> List[Color]:
+ def remove_gray_shades(colors: list[Color]) -> list[Color]:
pass
See :mod:`typing` and :pep:`484`, which describe this functionality.
diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst
index 38623371fb..046a88af62 100644
--- a/Doc/howto/urllib2.rst
+++ b/Doc/howto/urllib2.rst
@@ -601,5 +601,5 @@ This document was reviewed and revised by John Lee.
scripts with a localhost server, I have to prevent urllib from using
the proxy.
.. [#] urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe
- <https://github.com/ActiveState/code/tree/master/recipes/Python/456195_urrlib2_opener_SSL_proxy_CONNECT/recipe-456195.py>`_.
+ <https://code.activestate.com/recipes/456195/>`_.
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst
index 424ae547d8..3a7414d735 100644
--- a/Doc/library/abc.rst
+++ b/Doc/library/abc.rst
@@ -174,10 +174,11 @@ The :mod:`abc` module also provides the following decorator:
to declare abstract methods for properties and descriptors.
Dynamically adding abstract methods to a class, or attempting to modify the
- abstraction status of a method or class once it is created, are not
- supported. The :func:`abstractmethod` only affects subclasses derived using
- regular inheritance; "virtual subclasses" registered with the ABC's
- :meth:`register` method are not affected.
+ abstraction status of a method or class once it is created, are only
+ supported using the :func:`update_abstractmethods` function. The
+ :func:`abstractmethod` only affects subclasses derived using regular
+ inheritance; "virtual subclasses" registered with the ABC's :meth:`register`
+ method are not affected.
When :func:`abstractmethod` is applied in combination with other method
descriptors, it should be applied as the innermost decorator, as shown in
@@ -235,7 +236,6 @@ The :mod:`abc` module also provides the following decorator:
super-call in a framework that uses cooperative
multiple-inheritance.
-
The :mod:`abc` module also supports the following legacy decorators:
.. decorator:: abstractclassmethod
@@ -335,6 +335,22 @@ The :mod:`abc` module also provides the following functions:
.. versionadded:: 3.4
+.. function:: update_abstractmethods(cls)
+ A function to recalculate an abstract class's abstraction status. This
+ function should be called if a class's abstract methods have been
+ implemented or changed after it was created. Usually, this function should
+ be called from within a class decorator.
+
+ Returns *cls*, to allow usage as a class decorator.
+
+ If *cls* is not an instance of ABCMeta, does nothing.
+
+ .. note::
+
+ This function assumes that *cls*'s superclasses are already updated.
+ It does not update any subclasses.
+
+ .. versionadded:: 3.10
.. rubric:: Footnotes
diff --git a/Doc/library/array.rst b/Doc/library/array.rst
index 78020738bf..ff3ec6b1fd 100644
--- a/Doc/library/array.rst
+++ b/Doc/library/array.rst
@@ -257,7 +257,6 @@ Examples::
Packing and unpacking of External Data Representation (XDR) data as used in some
remote procedure call systems.
- `The Numerical Python Documentation <https://docs.scipy.org/doc/>`_
- The Numeric Python extension (NumPy) defines another array type; see
- http://www.numpy.org/ for further information about Numerical Python.
+ `NumPy <https://numpy.org/>`_
+ The NumPy package defines another array type.
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index 755c60fba6..f95ee1d5c6 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -1586,6 +1586,9 @@ and classes for traversing abstract syntax trees:
.. versionchanged:: 3.9
Now supports creating empty sets with ``'set()'``.
+ .. versionchanged:: 3.10
+ For string inputs, leading spaces and tabs are now stripped.
+
.. function:: get_docstring(node, clean=True)
@@ -1753,6 +1756,34 @@ and classes for traversing abstract syntax trees:
Added the *indent* option.
+.. _ast-compiler-flags:
+
+Compiler Flags
+--------------
+
+The following flags may be passed to :func:`compile` in order to change
+effects on the compilation of a program:
+
+.. data:: PyCF_ALLOW_TOP_LEVEL_AWAIT
+
+ Enables support for top-level ``await``, ``async for``, ``async with``
+ and async comprehensions.
+
+ .. versionadded:: 3.8
+
+.. data:: PyCF_ONLY_AST
+
+ Generates and returns an abstract syntax tree instead of returning a
+ compiled code object.
+
+.. data:: PyCF_TYPE_COMMENTS
+
+ Enables support for :pep:`484` and :pep:`526` style type comments
+ (``# type: <type>``, ``# type: ignore <stuff>``).
+
+ .. versionadded:: 3.8
+
+
.. _ast-cli:
Command-Line Usage
@@ -1820,4 +1851,4 @@ to stdout. Otherwise, the content is read from stdin.
`Parso <https://parso.readthedocs.io>`_ is a Python parser that supports
error recovery and round-trip parsing for different Python versions (in
multiple Python versions). Parso is also able to list multiple syntax errors
- in your python file. \ No newline at end of file
+ in your python file.
diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst
index 6666d55abe..6bf7814b25 100644
--- a/Doc/library/bisect.rst
+++ b/Doc/library/bisect.rst
@@ -60,7 +60,7 @@ The following functions are provided:
.. seealso::
`SortedCollection recipe
- <https://github.com/ActiveState/code/tree/master/recipes/Python/577197_SortedCollection/recipe-577197.py>`_ that uses
+ <https://code.activestate.com/recipes/577197-sortedcollection/>`_ that uses
bisect to build a full-featured collection class with straight-forward search
methods and support for a key-function. The keys are precomputed to save
unnecessary calls to the key function during searches.
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index f071057293..a026513520 100644
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -163,11 +163,14 @@ function:
:class:`CodecInfo` object. In case a search function cannot find
a given encoding, it should return ``None``.
- .. note::
- Search function registration is not currently reversible,
- which may cause problems in some cases, such as unit testing or
- module reloading.
+.. function:: unregister(search_function)
+
+ Unregister a codec search function and clear the registry's cache.
+ If the search function is not registered, do nothing.
+
+ .. versionadded:: 3.10
+
While the builtin :func:`open` and the associated :mod:`io` module are the
recommended approach for working with encoded text files, this module
diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst
index a603809867..db0e25bb07 100644
--- a/Doc/library/collections.abc.rst
+++ b/Doc/library/collections.abc.rst
@@ -308,7 +308,7 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
.. seealso::
- * `OrderedSet recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/576694_OrderedSet/recipe-576694.py>`_ for an
+ * `OrderedSet recipe <https://code.activestate.com/recipes/576694/>`_ for an
example built on :class:`MutableSet`.
* For more about ABCs, see the :mod:`abc` module and :pep:`3119`.
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index a7d01b3f39..f538da5e1c 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -135,12 +135,12 @@ The class can be used to simulate nested scopes and is useful in templating.
:attr:`~collections.ChainMap.parents` property.
* The `Nested Contexts recipe
- <https://github.com/ActiveState/code/tree/master/recipes/Python/577434_Nested_contexts__chamapping/recipe-577434.py>`_ has options to control
+ <https://code.activestate.com/recipes/577434/>`_ has options to control
whether writes and other mutations apply only to the first mapping or to
any mapping in the chain.
* A `greatly simplified read-only version of Chainmap
- <https://github.com/ActiveState/code/tree/master/recipes/Python/305268_Chained_map_lookups/recipe-305268.py>`_.
+ <https://code.activestate.com/recipes/305268/>`_.
:class:`ChainMap` Examples and Recipes
diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst
index 6e74af062d..e706f7fcc5 100644
--- a/Doc/library/dataclasses.rst
+++ b/Doc/library/dataclasses.rst
@@ -188,7 +188,7 @@ Module-level decorators, classes, and functions
@dataclass
class C:
- mylist: List[int] = field(default_factory=list)
+ mylist: list[int] = field(default_factory=list)
c = C()
c.mylist += [1, 2, 3]
@@ -301,7 +301,7 @@ Module-level decorators, classes, and functions
@dataclass
class C:
- mylist: List[Point]
+ mylist: list[Point]
p = Point(10, 20)
assert asdict(p) == {'x': 10, 'y': 20}
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst
index 009b7976df..aa08988c8b 100644
--- a/Doc/library/difflib.rst
+++ b/Doc/library/difflib.rst
@@ -633,7 +633,7 @@ If you want to know how to change the first sequence into the second, use
work.
* `Simple version control recipe
- <https://github.com/ActiveState/code/tree/master/recipes/Python/576729_Simple_Version_Control/recipe-576729.py>`_ for a small application
+ <https://code.activestate.com/recipes/576729/>`_ for a small application
built with :class:`SequenceMatcher`.
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 7543fc4b10..a052e724c5 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -259,26 +259,24 @@ are always available. They are listed here in alphabetical order.
interactive statement (in the latter case, expression statements that
evaluate to something other than ``None`` will be printed).
- The optional arguments *flags* and *dont_inherit* control which :ref:`future
- statements <future>` affect the compilation of *source*. If neither
- is present (or both are zero) the code is compiled with those future
- statements that are in effect in the code that is calling :func:`compile`. If the
- *flags* argument is given and *dont_inherit* is not (or is zero) then the
- future statements specified by the *flags* argument are used in addition to
- those that would be used anyway. If *dont_inherit* is a non-zero integer then
- the *flags* argument is it -- the future statements in effect around the call
- to compile are ignored.
-
- Future statements are specified by bits which can be bitwise ORed together to
- specify multiple statements. The bitfield required to specify a given feature
- can be found as the :attr:`~__future__._Feature.compiler_flag` attribute on
- the :class:`~__future__._Feature` instance in the :mod:`__future__` module.
-
- The optional argument *flags* also controls whether the compiled source is
- allowed to contain top-level ``await``, ``async for`` and ``async with``.
- When the bit ``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` is set, the return code
- object has ``CO_COROUTINE`` set in ``co_code``, and can be interactively
- executed via ``await eval(code_object)``.
+ The optional argument *flags* and *dont_inherit* controls which
+ :ref:`compiler options <ast-compiler-flags>` should be activated
+ and which :ref:`future features <future>` should be allowed. If neither
+ is present (or both are zero) the code is compiled with the same flags that
+ affect the code that is calling :func:`compile`. If the *flags*
+ argument is given and *dont_inherit* is not (or is zero) then the compiler
+ options and the future statements specified by the *flags* argument are used
+ in addition to those that would be used anyway. If *dont_inherit* is a
+ non-zero integer then the *flags* argument is it -- the flags (future
+ features and compiler options) in the surrounding code are ignored.
+
+ Compiler options and future statements are specified by bits which can be
+ bitwise ORed together to specify multiple options. The bitfield required to
+ specify a given future feature can be found as the
+ :attr:`~__future__._Feature.compiler_flag` attribute on the
+ :class:`~__future__._Feature` instance in the :mod:`__future__` module.
+ :ref:`Compiler flags <ast-compiler-flags>` can be found in :mod:`ast`
+ module, with ``PyCF_`` prefix.
The argument *optimize* specifies the optimization level of the compiler; the
default value of ``-1`` selects the optimization level of the interpreter as
@@ -506,6 +504,9 @@ are always available. They are listed here in alphabetical order.
returns the current global and local dictionary, respectively, which may be
useful to pass around for use by :func:`eval` or :func:`exec`.
+ If the given source is a string, then leading and trailing spaces and tabs
+ are stripped.
+
See :func:`ast.literal_eval` for a function that can safely evaluate strings
with expressions containing only literals.
@@ -1512,14 +1513,12 @@ are always available. They are listed here in alphabetical order.
.. class:: slice(stop)
slice(start, stop[, step])
- .. index:: single: Numerical Python
-
Return a :term:`slice` object representing the set of indices specified by
``range(start, stop, step)``. The *start* and *step* arguments default to
``None``. Slice objects have read-only data attributes :attr:`~slice.start`,
:attr:`~slice.stop` and :attr:`~slice.step` which merely return the argument
values (or their default). They have no other explicit functionality;
- however they are used by Numerical Python and other third party extensions.
+ however they are used by NumPy and other third party packages.
Slice objects are also generated when extended indexing syntax is used. For
example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See
:func:`itertools.islice` for an alternate version that returns an iterator.
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 14aa184e2c..186cb4c381 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -254,6 +254,13 @@ The :mod:`functools` module defines the following functions:
application, implementing all six rich comparison methods instead is
likely to provide an easy speed boost.
+ .. note::
+
+ This decorator makes no attempt to override methods that have been
+ declared in the class *or its superclasses*. Meaning that if a
+ superclass defines a comparison operator, *total_ordering* will not
+ implement it again, even if the original method is abstract.
+
.. versionadded:: 3.2
.. versionchanged:: 3.4
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index f152c45a87..145bac4966 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -123,14 +123,14 @@ Number-theoretic and representation functions
For further discussion and two alternative approaches, see the `ASPN cookbook
recipes for accurate floating point summation
- <https://github.com/ActiveState/code/tree/master/recipes/Python/393090_Binary_floating_point_summatiaccurate_full/recipe-393090.py>`_\.
+ <https://code.activestate.com/recipes/393090/>`_\.
.. function:: gcd(*integers)
Return the greatest common divisor of the specified integer arguments.
If any of the arguments is nonzero, then the returned value is the largest
- positive integer that is a divisor af all arguments. If all arguments
+ positive integer that is a divisor of all arguments. If all arguments
are zero, then the returned value is ``0``. ``gcd()`` without arguments
returns ``0``.
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index c1a18e0147..b1094198f4 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -55,7 +55,7 @@ equivalent to the above example::
<yourscript> -q -foutfile
<yourscript> -qfoutfile
-Additionally, users can run one of ::
+Additionally, users can run one of the following ::
<yourscript> -h
<yourscript> --help
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index 23486b6250..9526a03b05 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -1008,6 +1008,10 @@ call fails (for example because the path doesn't exist).
>>> target.open().read()
'some text'
+ The target path may be absolute or relative. Relative paths are interpreted
+ relative to the current working directory, *not* the directory of the Path
+ object.
+
.. versionchanged:: 3.8
Added return value, return the new Path instance.
@@ -1018,6 +1022,10 @@ call fails (for example because the path doesn't exist).
instance pointing to *target*. If *target* points to an existing file or
directory, it will be unconditionally replaced.
+ The target path may be absolute or relative. Relative paths are interpreted
+ relative to the current working directory, *not* the directory of the Path
+ object.
+
.. versionchanged:: 3.8
Added return value, return the new Path instance.
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index 4e97b1dbad..5a9359484d 100644
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -57,7 +57,7 @@ from sources provided by the operating system.
`Complementary-Multiply-with-Carry recipe
- <https://github.com/ActiveState/code/tree/master/recipes/Python/576707_Long_period_random_number/recipe-576707.py>`_ for a compatible alternative
+ <https://code.activestate.com/recipes/576707/>`_ for a compatible alternative
random number generator with a long period and comparatively simple update
operations.
@@ -180,8 +180,8 @@ Functions for sequences
The *weights* or *cum_weights* can use any numeric type that interoperates
with the :class:`float` values returned by :func:`random` (that includes
- integers, floats, and fractions but excludes decimals). Behavior is
- undefined if any weight is negative. A :exc:`ValueError` is raised if all
+ integers, floats, and fractions but excludes decimals). Weights are assumed
+ to be non-negative and finite. A :exc:`ValueError` is raised if all
weights are zero.
For a given seed, the :func:`choices` function with equal weighting
@@ -253,6 +253,8 @@ Functions for sequences
order so that the sample is reproducible.
+.. _real-valued-distributions:
+
Real-valued distributions
-------------------------
@@ -391,8 +393,8 @@ change across Python versions, but two aspects are guaranteed not to change:
.. _random-examples:
-Examples and Recipes
---------------------
+Examples
+--------
Basic examples::
@@ -536,3 +538,58 @@ Simulation of arrival times and service deliveries for a multiserver queue::
a tutorial by `Peter Norvig <http://norvig.com/bio.html>`_ covering
the basics of probability theory, how to write simulations, and
how to perform data analysis using Python.
+
+
+Recipes
+-------
+
+The default :func:`.random` returns multiples of 2⁻⁵³ in the range
+*0.0 ≤ x < 1.0*. All such numbers are evenly spaced and are exactly
+representable as Python floats. However, many other representable
+floats in that interval are not possible selections. For example,
+``0.05954861408025609`` isn't an integer multiple of 2⁻⁵³.
+
+The following recipe takes a different approach. All floats in the
+interval are possible selections. The mantissa comes from a uniform
+distribution of integers in the range *2⁵² ≤ mantissa < 2⁵³*. The
+exponent comes from a geometric distribution where exponents smaller
+than *-53* occur half as often as the next larger exponent.
+
+::
+
+ from random import Random
+ from math import ldexp
+
+ class FullRandom(Random):
+
+ def random(self):
+ mantissa = 0x10_0000_0000_0000 | self.getrandbits(52)
+ exponent = -53
+ x = 0
+ while not x:
+ x = self.getrandbits(32)
+ exponent += x.bit_length() - 32
+ return ldexp(mantissa, exponent)
+
+All :ref:`real valued distributions <real-valued-distributions>`
+in the class will use the new method::
+
+ >>> fr = FullRandom()
+ >>> fr.random()
+ 0.05954861408025609
+ >>> fr.expovariate(0.25)
+ 8.87925541791544
+
+The recipe is conceptually equivalent to an algorithm that chooses from
+all the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such
+numbers are evenly spaced, but most have to be rounded down to the
+nearest representable Python float. (The value 2⁻¹⁰⁷⁴ is the smallest
+positive unnormalized float and is equal to ``math.ulp(0.0)``.)
+
+
+.. seealso::
+
+ `Generating Pseudo-random Floating-Point Values
+ <https://allendowney.com/research/rand/downey07randfloat.pdf>`_ a
+ paper by Allen B. Downey describing ways to generate more
+ fine-grained floats than normally generated by :func:`.random`.
diff --git a/Doc/library/secrets.rst b/Doc/library/secrets.rst
index bc4766da27..afa8e2d385 100644
--- a/Doc/library/secrets.rst
+++ b/Doc/library/secrets.rst
@@ -21,7 +21,7 @@ The :mod:`secrets` module is used for generating cryptographically strong
random numbers suitable for managing data such as passwords, account
authentication, security tokens, and related secrets.
-In particularly, :mod:`secrets` should be used in preference to the
+In particular, :mod:`secrets` should be used in preference to the
default pseudo-random number generator in the :mod:`random` module, which
is designed for modelling and simulation, not security or cryptography.
diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst
index a94255bbf6..f08c58179a 100644
--- a/Doc/library/shelve.rst
+++ b/Doc/library/shelve.rst
@@ -75,7 +75,7 @@ Two additional methods are supported:
.. seealso::
- `Persistent dictionary recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/576642_Persistent_dict_multiple_standard_file/recipe-576642.py>`_
+ `Persistent dictionary recipe <https://code.activestate.com/recipes/576642/>`_
with widely supported storage formats and having the speed of native
dictionaries.
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index ecc3309ed5..3f5122760e 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -349,7 +349,7 @@ Directory and files operations
will be created in or as *dst* and *src* will be removed.
If *copy_function* is given, it must be a callable that takes two arguments
- *src* and *dst*, and will be used to copy *src* to *dest* if
+ *src* and *dst*, and will be used to copy *src* to *dst* if
:func:`os.rename` cannot be used. If the source is a directory,
:func:`copytree` is called, passing it the :func:`copy_function`. The
default *copy_function* is :func:`copy2`. Using :func:`~shutil.copy` as the
diff --git a/Doc/library/site.rst b/Doc/library/site.rst
index b424e1ba34..2e3646f6a7 100644
--- a/Doc/library/site.rst
+++ b/Doc/library/site.rst
@@ -231,7 +231,9 @@ Module contents
Return the path of the user-specific site-packages directory,
:data:`USER_SITE`. If it is not initialized yet, this function will also set
- it, respecting :envvar:`PYTHONNOUSERSITE` and :data:`USER_BASE`.
+ it, respecting :data:`USER_BASE`. To determine if the user-specific
+ site-packages was added to ``sys.path`` :data:`ENABLE_USER_SITE` should be
+ used.
.. versionadded:: 3.2
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 2eee22c79a..5c6acc66bb 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1404,7 +1404,7 @@ objects that compare equal might have different :attr:`~range.start`,
.. seealso::
- * The `linspace recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/579000_Equallyspaced_numbers_linspace/recipe-579000.py>`_
+ * The `linspace recipe <http://code.activestate.com/recipes/579000/>`_
shows how to implement a lazy version of range suitable for floating
point applications.
@@ -4749,6 +4749,128 @@ define these methods must provide them as a normal Python accessible method.
Compared to the overhead of setting up the runtime context, the overhead of a
single class dictionary lookup is negligible.
+.. _types-union:
+
+Union Type
+==========
+
+.. index::
+ object: Union
+ pair: union; type
+
+A union object holds the value of the ``|`` (bitwise or) operation on
+multiple :ref:`type objects<bltin-type-objects>`. These types are intended
+primarily for type annotations. The union type expression enables cleaner
+type hinting syntax compared to :data:`typing.Union`.
+
+.. describe:: X | Y | ...
+
+ Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y``
+ means either X or Y. It is equivalent to ``typing.Union[X, Y]``.
+ Example::
+
+ def square(number: int | float) -> int | float:
+ return number ** 2
+
+.. describe:: union_object == other
+
+ Union objects can be tested for equality with other union objects. Details:
+
+ * Unions of unions are flattened, e.g.::
+
+ (int | str) | float == int | str | float
+
+ * Redundant types are removed, e.g.::
+
+ int | str | int == int | str
+
+ * When comparing unions, the order is ignored, e.g.::
+
+ int | str == str | int
+
+ * It is compatible with :data:`typing.Union`::
+
+ int | str == typing.Union[int, str]
+
+ * Optional types can be spelled as a union with ``None``::
+
+ str | None == typing.Optional[str]
+
+.. describe:: isinstance(obj, union_object)
+
+ Calls to :func:`isinstance` are also supported with a Union object::
+
+ >>> isinstance("", int | str)
+ True
+
+ ..
+ At the time of writing this, there is no documentation for parameterized
+ generics or PEP 585. Thus the link currently points to PEP 585 itself.
+ Please change the link for parameterized generics to reference the correct
+ documentation once documentation for PEP 585 becomes available.
+
+ However, union objects containing `parameterized generics
+ <https://www.python.org/dev/peps/pep-0585/>`_ cannot be used::
+
+ >>> isinstance(1, int | list[int])
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ TypeError: isinstance() argument 2 cannot contain a parameterized generic
+
+.. describe:: issubclass(obj, union_object)
+
+ Calls to :func:`issubclass` are also supported with a Union Object.::
+
+ >>> issubclass(bool, int | str)
+ True
+
+ ..
+ Once again, please change the link below for parameterized generics to
+ reference the correct documentation once documentation for PEP 585
+ becomes available.
+
+ However, union objects containing `parameterized generics
+ <https://www.python.org/dev/peps/pep-0585/>`_ cannot be used::
+
+ >>> issubclass(bool, bool | list[str])
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ TypeError: issubclass() argument 2 cannot contain a parameterized generic
+
+The type for the Union object is :data:`types.Union`. An object cannot be
+instantiated from the type::
+
+ >>> import types
+ >>> isinstance(int | str, types.Union)
+ True
+ >>> types.Union()
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ TypeError: cannot create 'types.Union' instances
+
+.. note::
+ The :meth:`__or__` method for type objects was added to support the syntax
+ ``X | Y``. If a metaclass implements :meth:`__or__`, the Union may
+ override it::
+
+ >>> class M(type):
+ ... def __or__(self, other):
+ ... return "Hello"
+ ...
+ >>> class C(metaclass=M):
+ ... pass
+ ...
+ >>> C | int
+ 'Hello'
+ >>> int | C
+ int | __main__.C
+
+.. seealso::
+
+ :pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type.
+
+.. versionadded:: 3.10
+
.. _typesother:
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index aa417ede40..d201d7061f 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -679,7 +679,7 @@ always available.
additional garbage collector overhead if the object is managed by the garbage
collector.
- See `recursive sizeof recipe <https://github.com/ActiveState/code/tree/master/recipes/Python/577504_Compute_Memory_footprint_object_its/recipe-577504.py>`_
+ See `recursive sizeof recipe <https://code.activestate.com/recipes/577504>`_
for an example of using :func:`getsizeof` recursively to find the size of
containers and all their contents.
diff --git a/Doc/library/test.rst b/Doc/library/test.rst
index 6495b48444..ce6b868458 100644
--- a/Doc/library/test.rst
+++ b/Doc/library/test.rst
@@ -1168,6 +1168,8 @@ script execution tests.
The :mod:`test.support.bytecode_helper` module provides support for testing
and inspecting bytecode generation.
+.. versionadded:: 3.9
+
The module defines the following class:
.. class:: BytecodeTestCase(unittest.TestCase)
diff --git a/Doc/library/types.rst b/Doc/library/types.rst
index 25fa750f2c..e4a8dec5cb 100644
--- a/Doc/library/types.rst
+++ b/Doc/library/types.rst
@@ -256,6 +256,11 @@ Standard names are defined for the following types:
.. versionadded:: 3.10
+.. data:: Union
+
+ The type of :ref:`union type expressions<types-union>`.
+
+ .. versionadded:: 3.10
.. class:: TracebackType(tb_next, tb_frame, tb_lasti, tb_lineno)
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index d31c65d38e..402dd24fde 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -18,7 +18,7 @@
--------------
This module provides runtime support for type hints as specified by
-:pep:`484`, :pep:`526`, :pep:`544`, :pep:`586`, :pep:`589`, and :pep:`591`.
+:pep:`484`, :pep:`526`, :pep:`544`, :pep:`586`, :pep:`589`, :pep:`591`, and :pep:`613`.
The most fundamental support consists of the types :data:`Any`, :data:`Union`,
:data:`Tuple`, :data:`Callable`, :class:`TypeVar`, and
:class:`Generic`. For full specification please see :pep:`484`. For
@@ -34,14 +34,15 @@ In the function ``greeting``, the argument ``name`` is expected to be of type
:class:`str` and the return type :class:`str`. Subtypes are accepted as
arguments.
+.. _type-aliases:
+
Type aliases
============
A type alias is defined by assigning the type to the alias. In this example,
-``Vector`` and ``List[float]`` will be treated as interchangeable synonyms::
+``Vector`` and ``list[float]`` will be treated as interchangeable synonyms::
- from typing import List
- Vector = List[float]
+ Vector = list[float]
def scale(scalar: float, vector: Vector) -> Vector:
return [scalar * num for num in vector]
@@ -51,11 +52,11 @@ A type alias is defined by assigning the type to the alias. In this example,
Type aliases are useful for simplifying complex type signatures. For example::
- from typing import Dict, Tuple, Sequence
+ from collections.abc import Sequence
- ConnectionOptions = Dict[str, str]
- Address = Tuple[str, int]
- Server = Tuple[Address, ConnectionOptions]
+ ConnectionOptions = dict[str, str]
+ Address = tuple[str, int]
+ Server = tuple[Address, ConnectionOptions]
def broadcast_message(message: str, servers: Sequence[Server]) -> None:
...
@@ -64,7 +65,7 @@ Type aliases are useful for simplifying complex type signatures. For example::
# being exactly equivalent to this one.
def broadcast_message(
message: str,
- servers: Sequence[Tuple[Tuple[str, int], Dict[str, str]]]) -> None:
+ servers: Sequence[tuple[tuple[str, int], dict[str, str]]]) -> None:
...
Note that ``None`` as a type hint is a special case and is replaced by
@@ -157,7 +158,7 @@ type hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``.
For example::
- from typing import Callable
+ from collections.abc import Callable
def feeder(get_next_item: Callable[[], str]) -> None:
# Body
@@ -181,7 +182,7 @@ subscription to denote expected types for container elements.
::
- from typing import Mapping, Sequence
+ from collections.abc import Mapping, Sequence
def notify_by_email(employees: Sequence[Employee],
overrides: Mapping[str, str]) -> None: ...
@@ -191,7 +192,8 @@ called :class:`TypeVar`.
::
- from typing import Sequence, TypeVar
+ from collections.abc import Sequence
+ from typing import TypeVar
T = TypeVar('T') # Declare type variable
@@ -235,7 +237,7 @@ class body.
The :class:`Generic` base class defines :meth:`__class_getitem__` so that
``LoggedVar[t]`` is valid as a type::
- from typing import Iterable
+ from collections.abc import Iterable
def zero_all_vars(vars: Iterable[LoggedVar[int]]) -> None:
for var in vars:
@@ -266,7 +268,8 @@ This is thus invalid::
You can use multiple inheritance with :class:`Generic`::
- from typing import TypeVar, Generic, Sized
+ from collections.abc import Sized
+ from typing import TypeVar, Generic
T = TypeVar('T')
@@ -275,7 +278,8 @@ You can use multiple inheritance with :class:`Generic`::
When inheriting from generic classes, some type variables could be fixed::
- from typing import TypeVar, Mapping
+ from collections.abc import Mapping
+ from typing import TypeVar
T = TypeVar('T')
@@ -288,13 +292,14 @@ Using a generic class without specifying type parameters assumes
:data:`Any` for each position. In the following example, ``MyIterable`` is
not generic but implicitly inherits from ``Iterable[Any]``::
- from typing import Iterable
+ from collections.abc import Iterable
class MyIterable(Iterable): # Same as Iterable[Any]
User defined generic type aliases are also supported. Examples::
- from typing import TypeVar, Iterable, Tuple, Union
+ from collections.abc import Iterable
+ from typing import TypeVar, Union
S = TypeVar('S')
Response = Union[Iterable[S], int]
@@ -303,9 +308,9 @@ User defined generic type aliases are also supported. Examples::
...
T = TypeVar('T', int, float, complex)
- Vec = Iterable[Tuple[T, T]]
+ Vec = Iterable[tuple[T, T]]
- def inproduct(v: Vec[T]) -> T: # Same as Iterable[Tuple[T, T]]
+ def inproduct(v: Vec[T]) -> T: # Same as Iterable[tuple[T, T]]
return sum(x*y for x, y in v)
.. versionchanged:: 3.7
@@ -403,12 +408,12 @@ Initially :pep:`484` defined Python static type system as using
a class ``B`` is expected if and only if ``A`` is a subclass of ``B``.
This requirement previously also applied to abstract base classes, such as
-:class:`Iterable`. The problem with this approach is that a class had
+:class:`~collections.abc.Iterable`. The problem with this approach is that a class had
to be explicitly marked to support them, which is unpythonic and unlike
what one would normally do in idiomatic dynamically typed Python code.
-For example, this conforms to the :pep:`484`::
+For example, this conforms to :pep:`484`::
- from typing import Sized, Iterable, Iterator
+ from collections.abc import Sized, Iterable, Iterator
class Bucket(Sized, Iterable[int]):
...
@@ -421,7 +426,7 @@ allowing ``Bucket`` to be implicitly considered a subtype of both ``Sized``
and ``Iterable[int]`` by static type checkers. This is known as
*structural subtyping* (or static duck-typing)::
- from typing import Iterator, Iterable
+ from collections.abc import Iterator, Iterable
class Bucket: # Note: no base classes
...
@@ -486,6 +491,19 @@ These can be used as types in annotations and do not support ``[]``.
.. versionadded:: 3.5.4
.. versionadded:: 3.6.2
+.. data:: TypeAlias
+
+ Special annotation for explicitly declaring a :ref:`type alias <type-aliases>`.
+ For example::
+
+ from typing import TypeAlias
+
+ Factors: TypeAlias = list[int]
+
+ See :pep:`613` for more details about explicit type aliases.
+
+ .. versionadded:: 3.10
+
Special forms
"""""""""""""
@@ -541,6 +559,10 @@ These can be used as types in annotations using ``[]``, each having a unique syn
.. versionchanged:: 3.7
Don't remove explicit subclasses from unions at runtime.
+ .. versionchanged:: 3.10
+ Unions can now be written as ``X | Y``. See
+ :ref:`union type expressions<types-union>`.
+
.. data:: Optional
Optional type.
@@ -658,7 +680,7 @@ These can be used as types in annotations using ``[]``, each having a unique syn
and should not be set on instances of that class. Usage::
class Starship:
- stats: ClassVar[Dict[str, int]] = {} # class variable
+ stats: ClassVar[dict[str, int]] = {} # class variable
damage: int = 10 # instance variable
:data:`ClassVar` accepts only types and cannot be further subscribed.
@@ -771,10 +793,10 @@ These can be used as types in annotations using ``[]``, each having a unique syn
* ``Annotated`` can be used with nested and generic aliases::
T = TypeVar('T')
- Vec = Annotated[List[Tuple[T, T]], MaxLen(10)]
+ Vec = Annotated[list[tuple[T, T]], MaxLen(10)]
V = Vec[int]
- V == Annotated[List[Tuple[int, int]], MaxLen(10)]
+ V == Annotated[list[tuple[int, int]], MaxLen(10)]
.. versionadded:: 3.9
@@ -900,7 +922,7 @@ These are not used in annotations. They are building blocks for creating generic
Such a protocol can be used with :func:`isinstance` and :func:`issubclass`.
This raises :exc:`TypeError` when applied to a non-protocol class. This
allows a simple-minded structural check, very similar to "one trick ponies"
- in :mod:`collections.abc` such as :class:`Iterable`. For example::
+ in :mod:`collections.abc` such as :class:`~collections.abc.Iterable`. For example::
@runtime_checkable
class Closable(Protocol):
@@ -1371,10 +1393,10 @@ Asynchronous programming
The variance and order of type variables
correspond to those of :class:`Generator`, for example::
- from typing import List, Coroutine
- c = None # type: Coroutine[List[str], str, int]
+ from collections.abc import Coroutine
+ c = None # type: Coroutine[list[str], str, int]
...
- x = c.send('hi') # type: List[str]
+ x = c.send('hi') # type: list[str]
async def bar() -> None:
x = await c # type: int
@@ -1458,7 +1480,7 @@ Context manager types
.. versionadded:: 3.6.0
.. deprecated:: 3.9
- :class:`collections.contextlib.AbstractContextManager` now supports ``[]``. See :pep:`585`.
+ :class:`contextlib.AbstractContextManager` now supports ``[]``. See :pep:`585`.
.. class:: AsyncContextManager(Generic[T_co])
@@ -1468,7 +1490,7 @@ Context manager types
.. versionadded:: 3.6.2
.. deprecated:: 3.9
- :class:`collections.contextlib.AbstractAsyncContextManager` now supports ``[]``. See :pep:`585`.
+ :class:`contextlib.AbstractAsyncContextManager` now supports ``[]``. See :pep:`585`.
Protocols
---------
@@ -1537,7 +1559,7 @@ Functions and decorators
def process(response: None) -> None:
...
@overload
- def process(response: int) -> Tuple[int, str]:
+ def process(response: int) -> tuple[int, str]:
...
@overload
def process(response: bytes) -> str:
@@ -1663,20 +1685,21 @@ Introspection helpers
Check if a type is a :class:`TypedDict`.
For example::
- class Film(TypedDict):
- title: str
- year: int
- is_typeddict(Film) # => True
- is_typeddict(Union[list, str]) # => False
+ class Film(TypedDict):
+ title: str
+ year: int
+
+ is_typeddict(Film) # => True
+ is_typeddict(Union[list, str]) # => False
.. versionadded:: 3.10
.. class:: ForwardRef
A class used for internal typing representation of string forward references.
- For example, ``List["SomeClass"]`` is implicitly transformed into
- ``List[ForwardRef("SomeClass")]``. This class should not be instantiated by
+ For example, ``list["SomeClass"]`` is implicitly transformed into
+ ``list[ForwardRef("SomeClass")]``. This class should not be instantiated by
a user, but may be used by introspection tools.
Constant
@@ -1702,7 +1725,7 @@ Constant
If ``from __future__ import annotations`` is used in Python 3.7 or later,
annotations are not evaluated at function definition time.
- Instead, the are stored as strings in ``__annotations__``,
+ Instead, they are stored as strings in ``__annotations__``,
This makes it unnecessary to use quotes around the annotation.
(see :pep:`563`).
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index a52df9ee01..f04ec91270 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -1091,7 +1091,8 @@ Test cases
If given, *logger* should be a :class:`logging.Logger` object or a
:class:`str` giving the name of a logger. The default is the root
- logger, which will catch all messages.
+ logger, which will catch all messages that were not blocked by a
+ non-propagating descendent logger.
If given, *level* should be either a numeric logging level or
its string equivalent (for example either ``"ERROR"`` or
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index 7725e4d158..f4bccf6609 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -251,12 +251,18 @@ We can remove elements using :meth:`Element.remove`. Let's say we want to
remove all countries with a rank higher than 50::
>>> for country in root.findall('country'):
+ ... # using root.findall() to avoid removal during traversal
... rank = int(country.find('rank').text)
... if rank > 50:
... root.remove(country)
...
>>> tree.write('output.xml')
+Note that concurrent modification while iterating can lead to problems,
+just like when iterating and modifying Python lists or dicts.
+Therefore, the example first collects all matching elements with
+``root.findall()``, and only then iterates over the list of matches.
+
Our XML now looks like this:
.. code-block:: xml
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 158d6a8f16..62986cb151 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -610,13 +610,9 @@ following the parameter name. Any parameter may have an annotation, even those
``*identifier`` or ``**identifier``. Functions may have "return" annotation of
the form "``-> expression``" after the parameter list. These annotations can be
any valid Python expression. The presence of annotations does not change the
-semantics of a function. The annotation values are available as values of
-a dictionary keyed by the parameters' names in the :attr:`__annotations__`
-attribute of the function object. If the ``annotations`` import from
-:mod:`__future__` is used, annotations are preserved as strings at runtime which
-enables postponed evaluation. Otherwise, they are evaluated when the function
-definition is executed. In this case annotations may be evaluated in
-a different order than they appear in the source code.
+semantics of a function. The annotation values are available as string values
+in a dictionary keyed by the parameters' names in the :attr:`__annotations__`
+attribute of the function object.
.. index:: pair: lambda; expression
@@ -772,10 +768,8 @@ Coroutine function definition
keyword: await
Execution of Python coroutines can be suspended and resumed at many points
-(see :term:`coroutine`). Inside the body of a coroutine function, ``await`` and
-``async`` identifiers become reserved keywords; :keyword:`await` expressions,
-:keyword:`async for` and :keyword:`async with` can only be used in
-coroutine function bodies.
+(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` and
+:keyword:`async with` can only be used in the body of a coroutine function.
Functions defined with ``async def`` syntax are always coroutine functions,
even if they do not contain ``await`` or ``async`` keywords.
@@ -789,6 +783,9 @@ An example of a coroutine function::
do_stuff()
await some_coroutine()
+.. versionchanged:: 3.7
+ ``await`` and ``async`` are now keywords; previously they were only
+ treated as such inside the body of a coroutine function.
.. index:: statement: async for
.. _`async for`:
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index a817408c3b..4396f1b9b7 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -2376,10 +2376,11 @@ left undefined.
.. note::
- If the right operand's type is a subclass of the left operand's type and that
- subclass provides the reflected method for the operation, this method will be
- called before the left operand's non-reflected method. This behavior allows
- subclasses to override their ancestors' operations.
+ If the right operand's type is a subclass of the left operand's type and
+ that subclass provides a different implementation of the reflected method
+ for the operation, this method will be called before the left operand's
+ non-reflected method. This behavior allows subclasses to override their
+ ancestors' operations.
.. method:: object.__iadd__(self, other)
@@ -2771,6 +2772,6 @@ An example of an asynchronous context manager class::
method—that will instead have the opposite effect of explicitly
*blocking* such fallback.
-.. [#] For operands of the same type, it is assumed that if the non-reflected method
- (such as :meth:`__add__`) fails the operation is not supported, which is why the
- reflected method is not called.
+.. [#] For operands of the same type, it is assumed that if the non-reflected
+ method -- such as :meth:`__add__` -- fails then the overall operation is not
+ supported, which is why the reflected method is not called.
diff --git a/Doc/tutorial/floatingpoint.rst b/Doc/tutorial/floatingpoint.rst
index 0c0eb526fa..b98de6e56a 100644
--- a/Doc/tutorial/floatingpoint.rst
+++ b/Doc/tutorial/floatingpoint.rst
@@ -158,7 +158,7 @@ which implements arithmetic based on rational numbers (so the numbers like
1/3 can be represented exactly).
If you are a heavy user of floating point operations you should take a look
-at the Numerical Python package and many other packages for mathematical and
+at the NumPy package and many other packages for mathematical and
statistical operations supplied by the SciPy project. See <https://scipy.org>.
Python provides tools that may help on those rare occasions when you really
diff --git a/Doc/tutorial/whatnow.rst b/Doc/tutorial/whatnow.rst
index 38ce9f0a90..3208201312 100644
--- a/Doc/tutorial/whatnow.rst
+++ b/Doc/tutorial/whatnow.rst
@@ -43,7 +43,7 @@ More Python resources:
for download. Once you begin releasing code, you can register it here so that
others can find it.
-* https://github.com/ActiveState/code/tree/master/recipes/Python: The Python Cookbook is a
+* https://code.activestate.com/recipes/langs/python/: The Python Cookbook is a
sizable collection of code examples, larger modules, and useful scripts.
Particularly notable contributions are collected in a book also titled Python
Cookbook (O'Reilly & Associates, ISBN 0-596-00797-3.)
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index 1228f26954..738ef974e7 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -70,6 +70,23 @@ Summary -- Release highlights
New Features
============
+.. _whatsnew310-pep563:
+
+PEP 563: Postponed Evaluation of Annotations Becomes Default
+------------------------------------------------------------
+
+In Python 3.7, postponed evaluation of annotations was added,
+to be enabled with a ``from __future__ import annotations``
+directive. In 3.10 this became the default behavior, even
+without that future directive. With this being default, all
+annotations stored in :attr:`__annotations__` will be strings.
+If needed, annotations can be resolved at runtime using
+:func:`typing.get_type_hints`. See :pep:`563` for a full
+description. Also, the :func:`inspect.signature` will try to
+resolve types from now on, and when it fails it will fall back to
+showing the string annotations. (Contributed by Batuhan Taskaya
+in :issue:`38605`.)
+
* The :class:`int` type has a new method :meth:`int.bit_count`, returning the
number of ones in the binary expansion of a given integer, also known
as the population count. (Contributed by Niklas Fiekas in :issue:`29882`.)
@@ -82,6 +99,50 @@ New Features
* :pep:`618`: The :func:`zip` function now has an optional ``strict`` flag, used
to require that all the iterables have an equal length.
+PEP 613: TypeAlias Annotation
+-----------------------------
+
+:pep:`484` introduced the concept of type aliases, only requiring them to be
+top-level unannotated assignments. This simplicity sometimes made it difficult
+for type checkers to distinguish between type aliases and ordinary assignments,
+especially when forward references or invalid types were involved. Compare::
+
+ StrCache = 'Cache[str]' # a type alias
+ LOG_PREFIX = 'LOG[DEBUG]' # a module constant
+
+Now the :mod:`typing` module has a special annotation :data:`TypeAlias` to
+declare type aliases more explicitly::
+
+ StrCache: TypeAlias = 'Cache[str]' # a type alias
+ LOG_PREFIX = 'LOG[DEBUG]' # a module constant
+
+See :pep:`613` for more details.
+
+(Contributed by Mikhail Golubev in :issue:`41923`.)
+
+PEP604: New Type Union Operator
+-------------------------------
+
+A new type union operator was introduced which enables the syntax ``X | Y``.
+This provides a cleaner way of expressing 'either type X or type Y' instead of
+using :data:`typing.Union`, especially in type hints (annotations).
+
+In previous versions of Python, to apply a type hint for functions accepting
+arguments of multiple types, :data:`typing.Union` was used::
+
+ def square(number: Union[int, float]) -> Union[int, float]:
+ return number ** 2
+
+
+Now, type hints can be written in a more succinct manner::
+
+ def square(number: int | float) -> int | float:
+ return number ** 2
+
+
+See :pep:`604` for more details.
+
+(Contributed by Maggie Moss and Philippe Prados in :issue:`41428`.)
Other Language Changes
======================
@@ -109,6 +170,12 @@ base64
Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` to support the
Base32 Encoding with Extended Hex Alphabet.
+codecs
+------
+
+Add a :func:`codecs.unregister` function to unregister a codec search function.
+(Contributed by Hai Shi in :issue:`41842`.)
+
curses
------
@@ -119,6 +186,11 @@ by :func:`curses.color_content`, :func:`curses.init_color`,
support is provided by the underlying ncurses library.
(Contributed by Jeffrey Kintscher and Hans Petter Jansson in :issue:`36982`.)
+encodings
+---------
+:func:`encodings.normalize_encoding` now ignores non-ASCII characters.
+(Contributed by Hai Shi in :issue:`39337`.)
+
glob
----
@@ -188,6 +260,12 @@ Deprecated
Removed
=======
+* Removed special methods ``__int__``, ``__float__``, ``__floordiv__``,
+ ``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and
+ ``__rdivmod__`` of the :class:`complex` class. They always raised
+ a :exc:`TypeError`.
+ (Contributed by Serhiy Storchaka in :issue:`41974`.)
+
* The ``ParserBase.error()`` method from the private and undocumented ``_markupbase``
module has been removed. :class:`html.parser.HTMLParser` is the only subclass of
``ParserBase`` and its ``error()`` implementation has already been removed in
@@ -237,6 +315,14 @@ New Features
:class:`datetime.time` objects.
(Contributed by Zackery Spytz in :issue:`30155`.)
+* Add a :c:func:`PyCodec_Unregister` function to unregister a codec
+ search function.
+ (Contributed by Hai Shi in :issue:`41842`.)
+
+* The :c:func:`PyIter_Send` function was added to allow
+ sending value into iterator without raising ``StopIteration`` exception.
+ (Contributed by Vladimir Matveev in :issue:`41756`.)
+
Porting to Python 3.10
----------------------
@@ -289,6 +375,14 @@ Porting to Python 3.10
Unicode object without initial data.
(Contributed by Inada Naoki in :issue:`36346`.)
+Deprecated
+----------
+
+* The ``PyUnicode_InternImmortal()`` function is now deprecated
+ and will be removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace`
+ instead.
+ (Contributed by Victor Stinner in :issue:`41692`.)
+
Removed
-------
@@ -324,3 +418,8 @@ Removed
* Removed ``_Py_CheckRecursionLimit`` variable: it has been replaced by
``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` structure.
(Contributed by Victor Stinner in :issue:`41834`.)
+
+* Removed undocumented macros ``Py_ALLOW_RECURSION`` and
+ ``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the
+ :c:type:`PyInterpreterState` structure.
+ (Contributed by Serhiy Storchaka in :issue:`41936`.)
diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst
index 37bae34ce7..06bee9966c 100644
--- a/Doc/whatsnew/3.2.rst
+++ b/Doc/whatsnew/3.2.rst
@@ -781,8 +781,8 @@ functools
(Contributed by Raymond Hettinger and incorporating design ideas from Jim
Baker, Miki Tebeka, and Nick Coghlan; see `recipe 498245
- <https://github.com/ActiveState/code/tree/master/recipes/Python/498245_LRU_and_LFU_cache_decorators/recipe-498245.py>`_\, `recipe 577479
- <https://github.com/ActiveState/code/tree/master/recipes/Python/577479_Simple_caching_decorator/recipe-577479.py>`_\, :issue:`10586`, and
+ <https://code.activestate.com/recipes/498245>`_\, `recipe 577479
+ <https://code.activestate.com/recipes/577479>`_\, :issue:`10586`, and
:issue:`10593`.)
* The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` attribute
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index 95188b7493..89017981f6 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -652,41 +652,41 @@ Here's a summary of performance improvements from Python 3.4 through Python 3.9:
-------------- --- --- --- --- --- ---
Variable and attribute read access:
- read_local 7.1 7.1 5.4 5.1 3.9 4.0
- read_nonlocal 7.1 8.1 5.8 5.4 4.4 4.8
- read_global 15.5 19.0 14.3 13.6 7.6 7.7
- read_builtin 21.1 21.6 18.5 19.0 7.5 7.7
- read_classvar_from_class 25.6 26.5 20.7 19.5 18.4 18.6
- read_classvar_from_instance 22.8 23.5 18.8 17.1 16.4 20.1
- read_instancevar 32.4 33.1 28.0 26.3 25.4 27.7
- read_instancevar_slots 27.8 31.3 20.8 20.8 20.2 24.5
- read_namedtuple 73.8 57.5 45.0 46.8 18.4 23.2
- read_boundmethod 37.6 37.9 29.6 26.9 27.7 45.9
+ read_local 7.1 7.1 5.4 5.1 3.9 3.9
+ read_nonlocal 7.1 8.1 5.8 5.4 4.4 4.5
+ read_global 15.5 19.0 14.3 13.6 7.6 7.8
+ read_builtin 21.1 21.6 18.5 19.0 7.5 7.8
+ read_classvar_from_class 25.6 26.5 20.7 19.5 18.4 17.9
+ read_classvar_from_instance 22.8 23.5 18.8 17.1 16.4 16.9
+ read_instancevar 32.4 33.1 28.0 26.3 25.4 25.3
+ read_instancevar_slots 27.8 31.3 20.8 20.8 20.2 20.5
+ read_namedtuple 73.8 57.5 45.0 46.8 18.4 18.7
+ read_boundmethod 37.6 37.9 29.6 26.9 27.7 41.1
Variable and attribute write access:
- write_local 8.7 9.3 5.5 5.3 4.3 4.2
- write_nonlocal 10.5 11.1 5.6 5.5 4.7 4.9
- write_global 19.7 21.2 18.0 18.0 15.8 17.2
- write_classvar 92.9 96.0 104.6 102.1 39.2 43.2
- write_instancevar 44.6 45.8 40.0 38.9 35.5 40.7
- write_instancevar_slots 35.6 36.1 27.3 26.6 25.7 27.7
+ write_local 8.7 9.3 5.5 5.3 4.3 4.3
+ write_nonlocal 10.5 11.1 5.6 5.5 4.7 4.8
+ write_global 19.7 21.2 18.0 18.0 15.8 16.7
+ write_classvar 92.9 96.0 104.6 102.1 39.2 39.8
+ write_instancevar 44.6 45.8 40.0 38.9 35.5 37.4
+ write_instancevar_slots 35.6 36.1 27.3 26.6 25.7 25.8
Data structure read access:
- read_list 24.2 24.5 20.8 20.8 19.0 21.1
- read_deque 24.7 25.5 20.2 20.6 19.8 21.6
- read_dict 24.3 25.7 22.3 23.0 21.0 22.5
- read_strdict 22.6 24.3 19.5 21.2 18.9 21.6
+ read_list 24.2 24.5 20.8 20.8 19.0 19.5
+ read_deque 24.7 25.5 20.2 20.6 19.8 20.2
+ read_dict 24.3 25.7 22.3 23.0 21.0 22.4
+ read_strdict 22.6 24.3 19.5 21.2 18.9 21.5
Data structure write access:
- write_list 27.1 28.5 22.5 21.6 20.0 21.6
- write_deque 28.7 30.1 22.7 21.8 23.5 23.2
- write_dict 31.4 33.3 29.3 29.2 24.7 27.8
- write_strdict 28.4 29.9 27.5 25.2 23.1 29.8
+ write_list 27.1 28.5 22.5 21.6 20.0 20.0
+ write_deque 28.7 30.1 22.7 21.8 23.5 21.7
+ write_dict 31.4 33.3 29.3 29.2 24.7 25.4
+ write_strdict 28.4 29.9 27.5 25.2 23.1 24.5
Stack (or queue) operations:
- list_append_pop 93.4 112.7 75.4 74.2 50.8 53.9
- deque_append_pop 43.5 57.0 49.4 49.2 42.5 45.5
- deque_append_popleft 43.7 57.3 49.7 49.7 42.8 45.5
+ list_append_pop 93.4 112.7 75.4 74.2 50.8 50.6
+ deque_append_pop 43.5 57.0 49.4 49.2 42.5 44.2
+ deque_append_popleft 43.7 57.3 49.7 49.7 42.8 46.4
Timing loop:
loop_overhead 0.5 0.6 0.4 0.3 0.3 0.3
@@ -766,7 +766,7 @@ Deprecated
and will be removed in future Python versions. ``value`` itself should be
used instead of ``Index(value)``. ``Tuple(slices, Load())`` should be
used instead of ``ExtSlice(slices)``.
- (Contributed by Serhiy Storchaka in :issue:`32892`.)
+ (Contributed by Serhiy Storchaka in :issue:`34822`.)
* :mod:`ast` classes ``Suite``, ``Param``, ``AugLoad`` and ``AugStore``
are considered deprecated and will be removed in future Python versions.
diff --git a/Grammar/python.gram b/Grammar/python.gram
index e4533b1a1b..2f52bd7f2f 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -182,7 +182,7 @@ with_stmt[stmt_ty]:
| ASYNC 'with' a[asdl_withitem_seq*]=','.with_item+ ':' tc=[TYPE_COMMENT] b=block {
CHECK_VERSION(5, "Async with statements are", _Py_AsyncWith(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA)) }
with_item[withitem_ty]:
- | e=expression 'as' t=target &(',' | ')' | ':') { _Py_withitem(e, t, p->arena) }
+ | e=expression 'as' t=star_target &(',' | ')' | ':') { _Py_withitem(e, t, p->arena) }
| invalid_with_item
| e=expression { _Py_withitem(e, NULL, p->arena) }
diff --git a/Include/abstract.h b/Include/abstract.h
index a23b7dc78f..28e576b929 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -338,6 +338,24 @@ PyAPI_FUNC(int) PyIter_Check(PyObject *);
NULL with an exception means an error occurred. */
PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *);
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
+typedef enum {
+ PYGEN_RETURN = 0,
+ PYGEN_ERROR = -1,
+ PYGEN_NEXT = 1,
+} PySendResult;
+
+/* Takes generator, coroutine or iterator object and sends the value into it.
+ Returns:
+ - PYGEN_RETURN (0) if generator has returned.
+ 'result' parameter is filled with return value
+ - PYGEN_ERROR (-1) if exception was raised.
+ 'result' parameter is NULL
+ - PYGEN_NEXT (1) if generator has yielded.
+ 'result' parameter is filled with yielded value. */
+PyAPI_FUNC(PySendResult) PyIter_Send(PyObject *, PyObject *, PyObject **);
+#endif
+
/* === Number Protocol ================================================== */
diff --git a/Include/ceval.h b/Include/ceval.h
index 0f372e2044..0f687666e2 100644
--- a/Include/ceval.h
+++ b/Include/ceval.h
@@ -67,14 +67,6 @@ PyAPI_FUNC(int) Py_GetRecursionLimit(void);
PyAPI_FUNC(int) Py_EnterRecursiveCall(const char *where);
PyAPI_FUNC(void) Py_LeaveRecursiveCall(void);
-#define Py_ALLOW_RECURSION \
- do { unsigned char _old = PyThreadState_GET()->recursion_critical;\
- PyThreadState_GET()->recursion_critical = 1;
-
-#define Py_END_ALLOW_RECURSION \
- PyThreadState_GET()->recursion_critical = _old; \
- } while(0);
-
PyAPI_FUNC(const char *) PyEval_GetFuncName(PyObject *);
PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *);
diff --git a/Include/codecs.h b/Include/codecs.h
index 3ad0f2b5aa..37ecfb4ab7 100644
--- a/Include/codecs.h
+++ b/Include/codecs.h
@@ -27,6 +27,14 @@ PyAPI_FUNC(int) PyCodec_Register(
PyObject *search_function
);
+/* Unregister a codec search function and clear the registry's cache.
+ If the search function is not registered, do nothing.
+ Return 0 on success. Raise an exception and return -1 on error. */
+
+PyAPI_FUNC(int) PyCodec_Unregister(
+ PyObject *search_function
+ );
+
/* Codec registry lookup API.
Looks up the given encoding and returns a CodecInfo object with
diff --git a/Include/cpython/fileobject.h b/Include/cpython/fileobject.h
index 4f2408c7e8..cff2243d62 100644
--- a/Include/cpython/fileobject.h
+++ b/Include/cpython/fileobject.h
@@ -4,14 +4,6 @@
PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
-PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors;
-#endif
-
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
-PyAPI_DATA(int) Py_UTF8Mode;
-#endif
-
/* The std printer acts as a preliminary sys.stderr until the new io
infrastructure is in place. */
PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
@@ -22,3 +14,5 @@ typedef PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *);
PyAPI_FUNC(PyObject *) PyFile_OpenCode(const char *utf8path);
PyAPI_FUNC(PyObject *) PyFile_OpenCodeObject(PyObject *path);
PyAPI_FUNC(int) PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction hook, void *userData);
+
+PyAPI_FUNC(int) _PyLong_FileDescriptor_Converter(PyObject *, void *);
diff --git a/Include/cpython/listobject.h b/Include/cpython/listobject.h
index 70b9d83d8a..e1b9462d5b 100644
--- a/Include/cpython/listobject.h
+++ b/Include/cpython/listobject.h
@@ -26,7 +26,7 @@ PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out);
/* Macro, trading safety for speed */
-/* Cast argument to PyTupleObject* type. */
+/* Cast argument to PyListObject* type. */
#define _PyList_CAST(op) (assert(PyList_Check(op)), (PyListObject *)(op))
#define PyList_GET_ITEM(op, i) (_PyList_CAST(op)->ob_item[i])
diff --git a/Include/cpython/object.h b/Include/cpython/object.h
index ae3920d450..875a600f79 100644
--- a/Include/cpython/object.h
+++ b/Include/cpython/object.h
@@ -306,7 +306,6 @@ PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);
PyAPI_FUNC(int) _PyObject_IsAbstract(PyObject *);
PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, struct _Py_Identifier *);
PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, struct _Py_Identifier *, PyObject *);
-PyAPI_FUNC(int) _PyObject_HasAttrId(PyObject *, struct _Py_Identifier *);
/* Replacements of PyObject_GetAttr() and _PyObject_GetAttrId() which
don't raise AttributeError.
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index 42a7fc1630..5d5e4e3319 100644
--- a/Include/cpython/pystate.h
+++ b/Include/cpython/pystate.h
@@ -56,8 +56,6 @@ struct _ts {
int recursion_depth;
char overflowed; /* The stack has overflowed. Allow 50 more calls
to handle the runtime error. */
- char recursion_critical; /* The current calls must not cause
- a stack overflow. */
int stackcheck_counter;
/* 'tracing' keeps track of the execution depth when tracing/profiling.
diff --git a/Include/fileobject.h b/Include/fileobject.h
index 456887ef9d..6ec2994aa8 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -20,8 +20,15 @@ PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
If non-NULL, this is different than the default encoding for strings
*/
PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
+PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors;
+#endif
PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
+PyAPI_DATA(int) Py_UTF8Mode;
+#endif
+
/* A routine to check if a file descriptor can be select()-ed. */
#ifdef _MSC_VER
/* On Windows, any socket fd can be select()-ed, no matter how high */
diff --git a/Include/genobject.h b/Include/genobject.h
index 7488054c68..e965334a01 100644
--- a/Include/genobject.h
+++ b/Include/genobject.h
@@ -9,6 +9,7 @@ extern "C" {
#endif
#include "pystate.h" /* _PyErr_StackItem */
+#include "abstract.h" /* PySendResult */
/* _PyGenObject_HEAD defines the initial segment of generator
and coroutine objects. */
@@ -41,25 +42,9 @@ PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *,
PyObject *name, PyObject *qualname);
PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *);
PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **);
-PyAPI_FUNC(PyObject *) _PyGen_Send(PyGenObject *, PyObject *);
PyObject *_PyGen_yf(PyGenObject *);
PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self);
-typedef enum {
- PYGEN_RETURN = 0,
- PYGEN_ERROR = -1,
- PYGEN_NEXT = 1,
-} PySendResult;
-
-/* Sends the value into the generator or the coroutine. Returns:
- - PYGEN_RETURN (0) if generator has returned.
- 'result' parameter is filled with return value
- - PYGEN_ERROR (-1) if exception was raised.
- 'result' parameter is NULL
- - PYGEN_NEXT (1) if generator has yielded.
- 'result' parameter is filled with yielded value. */
-PyAPI_FUNC(PySendResult) PyGen_Send(PyGenObject *, PyObject *, PyObject **);
-
#ifndef Py_LIMITED_API
typedef struct {
_PyGenObject_HEAD(cr)
diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h
index bbee58617f..9cb5fc66ee 100644
--- a/Include/internal/pycore_fileutils.h
+++ b/Include/internal/pycore_fileutils.h
@@ -48,6 +48,8 @@ PyAPI_FUNC(int) _Py_GetLocaleconvNumeric(
PyObject **decimal_point,
PyObject **thousands_sep);
+PyAPI_FUNC(void) _Py_closerange(int first, int last);
+
#ifdef __cplusplus
}
#endif
diff --git a/Include/patchlevel.h b/Include/patchlevel.h
index 8578b6597f..eeb23af976 100644
--- a/Include/patchlevel.h
+++ b/Include/patchlevel.h
@@ -20,10 +20,10 @@
#define PY_MINOR_VERSION 10
#define PY_MICRO_VERSION 0
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
-#define PY_RELEASE_SERIAL 0
+#define PY_RELEASE_SERIAL 1
/* Version as a string */
-#define PY_VERSION "3.10.0a0"
+#define PY_VERSION "3.10.0a1+"
/*--end constants--*/
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
diff --git a/Include/pymacro.h b/Include/pymacro.h
index 856cae774d..202b936d96 100644
--- a/Include/pymacro.h
+++ b/Include/pymacro.h
@@ -118,7 +118,9 @@
"We've reached an unreachable state. Anything is possible.\n" \
"The limits were in our heads all along. Follow your dreams.\n" \
"https://xkcd.com/2200")
-#elif defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
+#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
+# define Py_UNREACHABLE() __builtin_unreachable()
+#elif defined(__clang__) || defined(__INTEL_COMPILER)
# define Py_UNREACHABLE() __builtin_unreachable()
#elif defined(_MSC_VER)
# define Py_UNREACHABLE() __assume(0)
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 500ce242e9..90b3299fd2 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -261,11 +261,14 @@ PyAPI_FUNC(PyObject *) PyUnicode_FromFormat(
);
PyAPI_FUNC(void) PyUnicode_InternInPlace(PyObject **);
-PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
PyAPI_FUNC(PyObject *) PyUnicode_InternFromString(
const char *u /* UTF-8 encoded string */
);
+// PyUnicode_InternImmortal() is deprecated since Python 3.10
+// and will be removed in Python 3.12. Use PyUnicode_InternInPlace() instead.
+Py_DEPRECATED(3.10) PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
+
/* Use only if you know it's a string */
#define PyUnicode_CHECK_INTERNED(op) \
(((PyASCIIObject *)(op))->state.interned)
diff --git a/Lib/abc.py b/Lib/abc.py
index 431b64040a..276ef9a2cd 100644
--- a/Lib/abc.py
+++ b/Lib/abc.py
@@ -122,6 +122,44 @@ else:
_reset_caches(cls)
+def update_abstractmethods(cls):
+ """Recalculate the set of abstract methods of an abstract class.
+
+ If a class has had one of its abstract methods implemented after the
+ class was created, the method will not be considered implemented until
+ this function is called. Alternatively, if a new abstract method has been
+ added to the class, it will only be considered an abstract method of the
+ class after this function is called.
+
+ This function should be called before any use is made of the class,
+ usually in class decorators that add methods to the subject class.
+
+ Returns cls, to allow usage as a class decorator.
+
+ If cls is not an instance of ABCMeta, does nothing.
+ """
+ if not hasattr(cls, '__abstractmethods__'):
+ # We check for __abstractmethods__ here because cls might by a C
+ # implementation or a python implementation (especially during
+ # testing), and we want to handle both cases.
+ return cls
+
+ abstracts = set()
+ # Check the existing abstract methods of the parents, keep only the ones
+ # that are not implemented.
+ for scls in cls.__bases__:
+ for name in getattr(scls, '__abstractmethods__', ()):
+ value = getattr(cls, name, None)
+ if getattr(value, "__isabstractmethod__", False):
+ abstracts.add(name)
+ # Also add any other newly added abstract methods.
+ for name, value in cls.__dict__.items():
+ if getattr(value, "__isabstractmethod__", False):
+ abstracts.add(name)
+ cls.__abstractmethods__ = frozenset(abstracts)
+ return cls
+
+
class ABC(metaclass=ABCMeta):
"""Helper class that provides a standard way to create an ABC using
inheritance.
diff --git a/Lib/ast.py b/Lib/ast.py
index d860917f4d..d8bd337370 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -59,7 +59,7 @@ def literal_eval(node_or_string):
sets, booleans, and None.
"""
if isinstance(node_or_string, str):
- node_or_string = parse(node_or_string, mode='eval')
+ node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
if isinstance(node_or_string, Expression):
node_or_string = node_or_string.body
def _raise_malformed_node(node):
diff --git a/Lib/cProfile.py b/Lib/cProfile.py
index 4f202038d6..59b4699feb 100755
--- a/Lib/cProfile.py
+++ b/Lib/cProfile.py
@@ -152,6 +152,11 @@ def main():
(options, args) = parser.parse_args()
sys.argv[:] = args
+ # The script that we're profiling may chdir, so capture the absolute path
+ # to the output file at startup.
+ if options.outfile is not None:
+ options.outfile = os.path.abspath(options.outfile)
+
if len(args) > 0:
if options.module:
code = "run_module(modname, run_name='__main__')"
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index f4da9d0cef..5d75501645 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -574,7 +574,7 @@ class Counter(dict):
# http://en.wikipedia.org/wiki/Multiset
# http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html
# http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm
- # https://github.com/ActiveState/code/tree/master/recipes/Python/259174_bag_collection_class/recipe-259174.py
+ # http://code.activestate.com/recipes/259174/
# Knuth, TAOCP Vol. II section 4.6.3
def __init__(self, iterable=None, /, **kwds):
diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
index bfb6b42cbb..4a8a3820f3 100644
--- a/Lib/ctypes/test/test_find.py
+++ b/Lib/ctypes/test/test_find.py
@@ -1,4 +1,5 @@
import unittest
+import unittest.mock
import os.path
import sys
import test.support
@@ -73,7 +74,7 @@ class Test_OpenGL_libs(unittest.TestCase):
@unittest.skipUnless(sys.platform.startswith('linux'),
'Test only valid for Linux')
-class LibPathFindTest(unittest.TestCase):
+class FindLibraryLinux(unittest.TestCase):
def test_find_on_libpath(self):
import subprocess
import tempfile
@@ -112,6 +113,15 @@ class LibPathFindTest(unittest.TestCase):
# LD_LIBRARY_PATH)
self.assertEqual(find_library(libname), 'lib%s.so' % libname)
+ def test_find_library_with_gcc(self):
+ with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
+ self.assertNotEqual(find_library('c'), None)
+
+ def test_find_library_with_ld(self):
+ with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
+ unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
+ self.assertNotEqual(find_library('c'), None)
+
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 01176bf969..0c2510e161 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -93,6 +93,12 @@ elif os.name == "posix":
# Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
import re, tempfile
+ def _is_elf(filename):
+ "Return True if the given file is an ELF file"
+ elf_header = b'\x7fELF'
+ with open(filename, 'br') as thefile:
+ return thefile.read(4) == elf_header
+
def _findLib_gcc(name):
# Run GCC's linker with the -t (aka --trace) option and examine the
# library name it prints out. The GCC command will fail because we
@@ -130,10 +136,17 @@ elif os.name == "posix":
# Raised if the file was already removed, which is the normal
# behaviour of GCC if linking fails
pass
- res = re.search(expr, trace)
+ res = re.findall(expr, trace)
if not res:
return None
- return os.fsdecode(res.group(0))
+
+ for file in res:
+ # Check if the given file is an elf file: gcc can report
+ # some files that are linker scripts and not actual
+ # shared objects. See bpo-41976 for more details
+ if not _is_elf(file):
+ continue
+ return os.fsdecode(file)
if sys.platform == "sunos5":
@@ -299,9 +312,14 @@ elif os.name == "posix":
stderr=subprocess.PIPE,
universal_newlines=True)
out, _ = p.communicate()
- res = re.search(expr, os.fsdecode(out))
- if res:
- result = res.group(0)
+ res = re.findall(expr, os.fsdecode(out))
+ for file in res:
+ # Check if the given file is an elf file: gcc can report
+ # some files that are linker scripts and not actual
+ # shared objects. See bpo-41976 for more details
+ if not _is_elf(file):
+ continue
+ return os.fsdecode(file)
except Exception:
pass # result will be None
return result
@@ -309,7 +327,7 @@ elif os.name == "posix":
def find_library(name):
# See issue #9998
return _findSoname_ldconfig(name) or \
- _get_soname(_findLib_gcc(name) or _findLib_ld(name))
+ _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))
################################################################
# test code
diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py
index 530d3e9957..adfb9b7240 100644
--- a/Lib/dataclasses.py
+++ b/Lib/dataclasses.py
@@ -6,6 +6,7 @@ import inspect
import keyword
import builtins
import functools
+import abc
import _thread
from types import GenericAlias
@@ -398,8 +399,10 @@ def _create_fn(name, args, body, *, globals=None, locals=None,
ns = {}
exec(txt, globals, ns)
- return ns['__create_fn__'](**locals)
-
+ func = ns['__create_fn__'](**locals)
+ for arg, annotation in func.__annotations__.copy().items():
+ func.__annotations__[arg] = locals[annotation]
+ return func
def _field_assign(frozen, name, value, self_name):
# If we're a frozen class, then assign to our fields in __init__
@@ -650,6 +653,11 @@ def _is_type(annotation, cls, a_module, a_type, is_type_predicate):
# a eval() penalty for every single field of every dataclass
# that's defined. It was judged not worth it.
+ # Strip away the extra quotes as a result of double-stringifying when the
+ # 'annotations' feature became default.
+ if annotation.startswith(("'", '"')) and annotation.endswith(("'", '"')):
+ annotation = annotation[1:-1]
+
match = _MODULE_IDENTIFIER_RE.match(annotation)
if match:
ns = None
@@ -990,7 +998,9 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen):
if not getattr(cls, '__doc__'):
# Create a class doc-string.
cls.__doc__ = (cls.__name__ +
- str(inspect.signature(cls)).replace(' -> None', ''))
+ str(inspect.signature(cls)).replace(' -> NoneType', ''))
+
+ abc.update_abstractmethods(cls)
return cls
diff --git a/Lib/datetime.py b/Lib/datetime.py
index 3090978508..b896b94b0f 100644
--- a/Lib/datetime.py
+++ b/Lib/datetime.py
@@ -1421,7 +1421,8 @@ class time:
part is omitted if self.microsecond == 0.
The optional argument timespec specifies the number of additional
- terms of the time to include.
+ terms of the time to include. Valid options are 'auto', 'hours',
+ 'minutes', 'seconds', 'milliseconds' and 'microseconds'.
"""
s = _format_time(self._hour, self._minute, self._second,
self._microsecond, timespec)
@@ -1547,7 +1548,7 @@ class time:
self._tzinfo = tzinfo
def __reduce_ex__(self, protocol):
- return (time, self._getstate(protocol))
+ return (self.__class__, self._getstate(protocol))
def __reduce__(self):
return self.__reduce_ex__(2)
@@ -1906,7 +1907,8 @@ class datetime(date):
time, default 'T'.
The optional argument timespec specifies the number of additional
- terms of the time to include.
+ terms of the time to include. Valid options are 'auto', 'hours',
+ 'minutes', 'seconds', 'milliseconds' and 'microseconds'.
"""
s = ("%04d-%02d-%02d%c" % (self._year, self._month, self._day, sep) +
_format_time(self._hour, self._minute, self._second,
diff --git a/Lib/email/message.py b/Lib/email/message.py
index 1262602617..3701b30553 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -141,7 +141,7 @@ class Message:
header. For backward compatibility reasons, if maxheaderlen is
not specified it defaults to 0, so you must override it explicitly
if you want a different maxheaderlen. 'policy' is passed to the
- Generator instance used to serialize the mesasge; if it is not
+ Generator instance used to serialize the message; if it is not
specified the policy associated with the message instance is used.
If the message object contains binary data that is not encoded
@@ -958,7 +958,7 @@ class MIMEPart(Message):
header. maxheaderlen is retained for backward compatibility with the
base Message class, but defaults to None, meaning that the policy value
for max_line_length controls the header maximum length. 'policy' is
- passed to the Generator instance used to serialize the mesasge; if it
+ passed to the Generator instance used to serialize the message; if it
is not specified the policy associated with the message instance is
used.
"""
diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py
index ddd5afdcf2..4b37d3321c 100644
--- a/Lib/encodings/__init__.py
+++ b/Lib/encodings/__init__.py
@@ -61,7 +61,8 @@ def normalize_encoding(encoding):
if c.isalnum() or c == '.':
if punct and chars:
chars.append('_')
- chars.append(c)
+ if c.isascii():
+ chars.append(c)
punct = False
else:
punct = True
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
index 21320a8319..cb2882e336 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -3,6 +3,7 @@ import os.path
import sys
import runpy
import tempfile
+import subprocess
from importlib import resources
from . import _bundled
@@ -14,7 +15,7 @@ __all__ = ["version", "bootstrap"]
_SETUPTOOLS_VERSION = "47.1.0"
-_PIP_VERSION = "20.1.1"
+_PIP_VERSION = "20.2.3"
_PROJECTS = [
("setuptools", _SETUPTOOLS_VERSION, "py3"),
@@ -23,22 +24,18 @@ _PROJECTS = [
def _run_pip(args, additional_paths=None):
- # Add our bundled software to the sys.path so we can import it
- if additional_paths is not None:
- sys.path = additional_paths + sys.path
-
- # Invoke pip as if it's the main module, and catch the exit.
- backup_argv = sys.argv[:]
- sys.argv[1:] = args
- try:
- # run_module() alters sys.modules and sys.argv, but restores them at exit
- runpy.run_module("pip", run_name="__main__", alter_sys=True)
- except SystemExit as exc:
- return exc.code
- finally:
- sys.argv[:] = backup_argv
-
- raise SystemError("pip did not exit, this should never happen")
+ # Run the bootstraping in a subprocess to avoid leaking any state that happens
+ # after pip has executed. Particulary, this avoids the case when pip holds onto
+ # the files in *additional_paths*, preventing us to remove them at the end of the
+ # invocation.
+ code = f"""
+import runpy
+import sys
+sys.path = {additional_paths or []} + sys.path
+sys.argv[1:] = {args}
+runpy.run_module("pip", run_name="__main__", alter_sys=True)
+"""
+ return subprocess.run([sys.executable, "-c", code], check=True).returncode
def version():
diff --git a/Lib/ensurepip/_bundled/pip-20.1.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-20.2.3-py2.py3-none-any.whl
index ea1d0f7c86..7ebdc0f31d 100644
--- a/Lib/ensurepip/_bundled/pip-20.1.1-py2.py3-none-any.whl
+++ b/Lib/ensurepip/_bundled/pip-20.2.3-py2.py3-none-any.whl
Binary files differ
diff --git a/Lib/graphlib.py b/Lib/graphlib.py
index 948f62f1dc..d0e7a4814c 100644
--- a/Lib/graphlib.py
+++ b/Lib/graphlib.py
@@ -22,7 +22,8 @@ class _NodeInfo:
class CycleError(ValueError):
- """Subclass of ValueError raised by TopologicalSorterif cycles exist in the graph
+ """Subclass of ValueError raised by TopologicalSorter.prepare if cycles
+ exist in the working graph.
If multiple cycles exist, only one undefined choice among them will be reported
and included in the exception. The detected cycle can be accessed via the second
@@ -129,7 +130,7 @@ class TopologicalSorter:
return result
def is_active(self):
- """Return True if more progress can be made and ``False`` otherwise.
+ """Return ``True`` if more progress can be made and ``False`` otherwise.
Progress can be made if cycles do not block the resolution and either there
are still nodes ready that haven't yet been returned by "get_ready" or the
@@ -149,7 +150,7 @@ class TopologicalSorter:
"""Marks a set of nodes returned by "get_ready" as processed.
This method unblocks any successor of each node in *nodes* for being returned
- in the future by a a call to "get_ready"
+ in the future by a call to "get_ready".
Raises :exec:`ValueError` if any node in *nodes* has already been marked as
processed by a previous call to this method, if a node was not added to the
diff --git a/Lib/heapq.py b/Lib/heapq.py
index 5895562db4..fabefd87f8 100644
--- a/Lib/heapq.py
+++ b/Lib/heapq.py
@@ -456,7 +456,7 @@ def merge(*iterables, key=None, reverse=False):
# 2) Made multiple passes over the data.
# 3) Made more comparisons in common cases (small k, large n, semi-random input).
# See the more detailed comparison of approach at:
-# https://github.com/ActiveState/code/tree/master/recipes/Python/577573_Compare_algorithms/recipe-577573.py
+# http://code.activestate.com/recipes/577573-compare-algorithms-for-heapqsmallest
def nsmallest(n, iterable, key=None):
"""Find the n smallest elements in a dataset.
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index 4f06039f3d..b08ad032ab 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -277,6 +277,7 @@ _code_type = type(_write_atomic.__code__)
# Python 3.9a2 3423 (add IS_OP, CONTAINS_OP and JUMP_IF_NOT_EXC_MATCH bytecodes #39156)
# Python 3.9a2 3424 (simplify bytecodes for *value unpacking)
# Python 3.9a2 3425 (simplify bytecodes for **value unpacking)
+# Python 3.10a1 3430 (Make 'annotations' future by default)
#
# MAGIC must change whenever the bytecode emitted by the compiler may no
@@ -286,7 +287,7 @@ _code_type = type(_write_atomic.__code__)
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.
-MAGIC_NUMBER = (3425).to_bytes(2, 'little') + b'\r\n'
+MAGIC_NUMBER = (3430).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
_PYCACHE = '__pycache__'
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 887a342405..ac127cbd72 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -45,6 +45,7 @@ import sys
import tokenize
import token
import types
+import typing
import warnings
import functools
import builtins
@@ -1877,7 +1878,10 @@ def _signature_is_functionlike(obj):
code = getattr(obj, '__code__', None)
defaults = getattr(obj, '__defaults__', _void) # Important to use _void ...
kwdefaults = getattr(obj, '__kwdefaults__', _void) # ... and not None here
- annotations = getattr(obj, '__annotations__', None)
+ try:
+ annotations = _get_type_hints(obj)
+ except AttributeError:
+ annotations = None
return (isinstance(code, types.CodeType) and
isinstance(name, str) and
@@ -2118,6 +2122,16 @@ def _signature_fromstr(cls, obj, s, skip_bound_arg=True):
return cls(parameters, return_annotation=cls.empty)
+def _get_type_hints(func):
+ try:
+ return typing.get_type_hints(func)
+ except Exception:
+ # First, try to use the get_type_hints to resolve
+ # annotations. But for keeping the behavior intact
+ # if there was a problem with that (like the namespace
+ # can't resolve some annotation) continue to use
+ # string annotations
+ return func.__annotations__
def _signature_from_builtin(cls, func, skip_bound_arg=True):
"""Private helper function to get signature for
@@ -2161,7 +2175,8 @@ def _signature_from_function(cls, func, skip_bound_arg=True):
positional = arg_names[:pos_count]
keyword_only_count = func_code.co_kwonlyargcount
keyword_only = arg_names[pos_count:pos_count + keyword_only_count]
- annotations = func.__annotations__
+ annotations = _get_type_hints(func)
+
defaults = func.__defaults__
kwdefaults = func.__kwdefaults__
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 94361ca75f..265e286101 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -194,7 +194,8 @@ def _checkLevel(level):
raise ValueError("Unknown level: %r" % level)
rv = _nameToLevel[level]
else:
- raise TypeError("Level not an integer or a valid string: %r" % level)
+ raise TypeError("Level not an integer or a valid string: %r"
+ % (level,))
return rv
#---------------------------------------------------------------------------
@@ -522,7 +523,7 @@ class Formatter(object):
responsible for converting a LogRecord to (usually) a string which can
be interpreted by either a human or an external system. The base Formatter
allows a formatting string to be specified. If none is supplied, the
- the style-dependent default value, "%(message)s", "{message}", or
+ style-dependent default value, "%(message)s", "{message}", or
"${message}", is used.
The Formatter can be initialized with a format string which makes use of
@@ -762,8 +763,8 @@ class Filter(object):
"""
Determine if the specified record is to be logged.
- Is the specified record to be logged? Returns 0 for no, nonzero for
- yes. If deemed appropriate, the record may be modified in-place.
+ Returns True if the record should be logged, or False otherwise.
+ If deemed appropriate, the record may be modified in-place.
"""
if self.nlen == 0:
return True
diff --git a/Lib/pathlib.py b/Lib/pathlib.py
index babc443dd3..147be2ff0d 100644
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -1366,17 +1366,26 @@ class Path(PurePath):
def rename(self, target):
"""
- Rename this path to the given path,
- and return a new Path instance pointing to the given path.
+ Rename this path to the target path.
+
+ The target path may be absolute or relative. Relative paths are
+ interpreted relative to the current working directory, *not* the
+ directory of the Path object.
+
+ Returns the new Path instance pointing to the target path.
"""
self._accessor.rename(self, target)
return self.__class__(target)
def replace(self, target):
"""
- Rename this path to the given path, clobbering the existing
- destination if it exists, and return a new Path instance
- pointing to the given path.
+ Rename this path to the target path, overwriting if that path exists.
+
+ The target path may be absolute or relative. Relative paths are
+ interpreted relative to the current working directory, *not* the
+ directory of the Path object.
+
+ Returns the new Path instance pointing to the target path.
"""
self._accessor.replace(self, target)
return self.__class__(target)
diff --git a/Lib/profile.py b/Lib/profile.py
index aad458dc95..5cb017ed83 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -571,6 +571,11 @@ def main():
(options, args) = parser.parse_args()
sys.argv[:] = args
+ # The script that we're profiling may chdir, so capture the absolute path
+ # to the output file at startup.
+ if options.outfile is not None:
+ options.outfile = os.path.abspath(options.outfile)
+
if len(args) > 0:
if options.module:
import runpy
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index 8aca5c0cb8..1fdb1ae859 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Mon Apr 27 22:35:16 2020
+# Autogenerated by Sphinx on Mon Oct 5 18:27:28 2020
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
'\n'
@@ -99,27 +99,26 @@ topics = {'assert': 'The "assert" statement\n'
'assigned,\n'
' from left to right, to the corresponding targets.\n'
'\n'
- ' * If the target list contains one target prefixed with an\n'
- ' asterisk, called a “starred” target: The object must be '
- 'an\n'
- ' iterable with at least as many items as there are targets '
- 'in the\n'
- ' target list, minus one. The first items of the iterable '
- 'are\n'
- ' assigned, from left to right, to the targets before the '
+ ' * If the target list contains one target prefixed with an '
+ 'asterisk,\n'
+ ' called a “starred” target: The object must be an iterable '
+ 'with at\n'
+ ' least as many items as there are targets in the target '
+ 'list, minus\n'
+ ' one. The first items of the iterable are assigned, from '
+ 'left to\n'
+ ' right, to the targets before the starred target. The '
+ 'final items\n'
+ ' of the iterable are assigned to the targets after the '
'starred\n'
- ' target. The final items of the iterable are assigned to '
- 'the\n'
- ' targets after the starred target. A list of the remaining '
- 'items\n'
- ' in the iterable is then assigned to the starred target '
- '(the list\n'
- ' can be empty).\n'
+ ' target. A list of the remaining items in the iterable is '
+ 'then\n'
+ ' assigned to the starred target (the list can be empty).\n'
'\n'
' * Else: The object must be an iterable with the same number '
- 'of\n'
- ' items as there are targets in the target list, and the '
- 'items are\n'
+ 'of items\n'
+ ' as there are targets in the target list, and the items '
+ 'are\n'
' assigned, from left to right, to the corresponding '
'targets.\n'
'\n'
@@ -135,10 +134,10 @@ topics = {'assert': 'The "assert" statement\n'
'in the\n'
' current local namespace.\n'
'\n'
- ' * Otherwise: the name is bound to the object in the global\n'
- ' namespace or the outer namespace determined by '
- '"nonlocal",\n'
- ' respectively.\n'
+ ' * Otherwise: the name is bound to the object in the global '
+ 'namespace\n'
+ ' or the outer namespace determined by "nonlocal", '
+ 'respectively.\n'
'\n'
' The name is rebound if it was already bound. This may cause '
'the\n'
@@ -225,26 +224,27 @@ topics = {'assert': 'The "assert" statement\n'
'called with\n'
' appropriate arguments.\n'
'\n'
- '* If the target is a slicing: The primary expression in the\n'
- ' reference is evaluated. It should yield a mutable sequence '
- 'object\n'
- ' (such as a list). The assigned object should be a sequence '
- 'object\n'
- ' of the same type. Next, the lower and upper bound '
- 'expressions are\n'
- ' evaluated, insofar they are present; defaults are zero and '
- 'the\n'
- ' sequence’s length. The bounds should evaluate to integers. '
- 'If\n'
- ' either bound is negative, the sequence’s length is added to '
- 'it. The\n'
- ' resulting bounds are clipped to lie between zero and the '
+ '* If the target is a slicing: The primary expression in the '
+ 'reference\n'
+ ' is evaluated. It should yield a mutable sequence object '
+ '(such as a\n'
+ ' list). The assigned object should be a sequence object of '
+ 'the same\n'
+ ' type. Next, the lower and upper bound expressions are '
+ 'evaluated,\n'
+ ' insofar they are present; defaults are zero and the '
'sequence’s\n'
- ' length, inclusive. Finally, the sequence object is asked to '
- 'replace\n'
- ' the slice with the items of the assigned sequence. The '
- 'length of\n'
- ' the slice may be different from the length of the assigned '
+ ' length. The bounds should evaluate to integers. If either '
+ 'bound is\n'
+ ' negative, the sequence’s length is added to it. The '
+ 'resulting\n'
+ ' bounds are clipped to lie between zero and the sequence’s '
+ 'length,\n'
+ ' inclusive. Finally, the sequence object is asked to replace '
+ 'the\n'
+ ' slice with the items of the assigned sequence. The length '
+ 'of the\n'
+ ' slice may be different from the length of the assigned '
'sequence,\n'
' thus changing the length of the target sequence, if the '
'target\n'
@@ -544,13 +544,17 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'-[ Footnotes ]-\n'
'\n'
- '[1] The exception is propagated to the invocation stack unless\n'
- ' there is a "finally" clause which happens to raise another\n'
- ' exception. That new exception causes the old one to be lost.\n'
+ '[1] The exception is propagated to the invocation stack unless '
+ 'there\n'
+ ' is a "finally" clause which happens to raise another '
+ 'exception.\n'
+ ' That new exception causes the old one to be lost.\n'
'\n'
- '[2] A string literal appearing as the first statement in the\n'
- ' function body is transformed into the function’s "__doc__"\n'
- ' attribute and therefore the function’s *docstring*.\n'
+ '[2] A string literal appearing as the first statement in the '
+ 'function\n'
+ ' body is transformed into the function’s "__doc__" attribute '
+ 'and\n'
+ ' therefore the function’s *docstring*.\n'
'\n'
'[3] A string literal appearing as the first statement in the class\n'
' body is transformed into the namespace’s "__doc__" item and\n'
@@ -688,11 +692,13 @@ topics = {'assert': 'The "assert" statement\n'
'needs, for\n'
' example, "object.__getattribute__(self, name)".\n'
'\n'
- ' Note: This method may still be bypassed when looking '
- 'up special\n'
- ' methods as the result of implicit invocation via '
- 'language syntax\n'
- ' or built-in functions. See Special method lookup.\n'
+ ' Note:\n'
+ '\n'
+ ' This method may still be bypassed when looking up '
+ 'special methods\n'
+ ' as the result of implicit invocation via language '
+ 'syntax or\n'
+ ' built-in functions. See Special method lookup.\n'
'\n'
'object.__setattr__(self, name, value)\n'
'\n'
@@ -776,15 +782,16 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' sys.modules[__name__].__class__ = VerboseModule\n'
'\n'
- 'Note: Defining module "__getattr__" and setting module '
- '"__class__"\n'
- ' only affect lookups made using the attribute access '
- 'syntax –\n'
- ' directly accessing the module globals (whether by code '
- 'within the\n'
- ' module, or via a reference to the module’s globals '
- 'dictionary) is\n'
- ' unaffected.\n'
+ 'Note:\n'
+ '\n'
+ ' Defining module "__getattr__" and setting module '
+ '"__class__" only\n'
+ ' affect lookups made using the attribute access syntax '
+ '– directly\n'
+ ' accessing the module globals (whether by code within '
+ 'the module, or\n'
+ ' via a reference to the module’s globals dictionary) is '
+ 'unaffected.\n'
'\n'
'Changed in version 3.5: "__class__" module attribute is '
'now writable.\n'
@@ -867,12 +874,14 @@ topics = {'assert': 'The "assert" statement\n'
'created. The\n'
' descriptor has been assigned to *name*.\n'
'\n'
- ' Note: "__set_name__()" is only called implicitly as '
- 'part of the\n'
- ' "type" constructor, so it will need to be called '
- 'explicitly with\n'
- ' the appropriate parameters when a descriptor is '
- 'added to a class\n'
+ ' Note:\n'
+ '\n'
+ ' "__set_name__()" is only called implicitly as part '
+ 'of the "type"\n'
+ ' constructor, so it will need to be called '
+ 'explicitly with the\n'
+ ' appropriate parameters when a descriptor is added '
+ 'to a class\n'
' after initial creation:\n'
'\n'
' class A:\n'
@@ -1033,10 +1042,9 @@ topics = {'assert': 'The "assert" statement\n'
'--------------------------\n'
'\n'
'* When inheriting from a class without *__slots__*, the '
- '*__dict__*\n'
- ' and *__weakref__* attribute of the instances will '
- 'always be\n'
- ' accessible.\n'
+ '*__dict__* and\n'
+ ' *__weakref__* attribute of the instances will always '
+ 'be accessible.\n'
'\n'
'* Without a *__dict__* variable, instances cannot be '
'assigned new\n'
@@ -1051,14 +1059,12 @@ topics = {'assert': 'The "assert" statement\n'
' declaration.\n'
'\n'
'* Without a *__weakref__* variable for each instance, '
- 'classes\n'
- ' defining *__slots__* do not support weak references to '
- 'its\n'
- ' instances. If weak reference support is needed, then '
- 'add\n'
- ' "\'__weakref__\'" to the sequence of strings in the '
- '*__slots__*\n'
- ' declaration.\n'
+ 'classes defining\n'
+ ' *__slots__* do not support weak references to its '
+ 'instances. If weak\n'
+ ' reference support is needed, then add '
+ '"\'__weakref__\'" to the\n'
+ ' sequence of strings in the *__slots__* declaration.\n'
'\n'
'* *__slots__* are implemented at the class level by '
'creating\n'
@@ -1071,24 +1077,23 @@ topics = {'assert': 'The "assert" statement\n'
' attribute would overwrite the descriptor assignment.\n'
'\n'
'* The action of a *__slots__* declaration is not limited '
- 'to the\n'
- ' class where it is defined. *__slots__* declared in '
- 'parents are\n'
- ' available in child classes. However, child subclasses '
- 'will get a\n'
- ' *__dict__* and *__weakref__* unless they also define '
- '*__slots__*\n'
- ' (which should only contain names of any *additional* '
- 'slots).\n'
+ 'to the class\n'
+ ' where it is defined. *__slots__* declared in parents '
+ 'are available\n'
+ ' in child classes. However, child subclasses will get a '
+ '*__dict__*\n'
+ ' and *__weakref__* unless they also define *__slots__* '
+ '(which should\n'
+ ' only contain names of any *additional* slots).\n'
'\n'
'* If a class defines a slot also defined in a base '
- 'class, the\n'
- ' instance variable defined by the base class slot is '
- 'inaccessible\n'
- ' (except by retrieving its descriptor directly from the '
- 'base class).\n'
- ' This renders the meaning of the program undefined. In '
- 'the future, a\n'
+ 'class, the instance\n'
+ ' variable defined by the base class slot is '
+ 'inaccessible (except by\n'
+ ' retrieving its descriptor directly from the base '
+ 'class). This\n'
+ ' renders the meaning of the program undefined. In the '
+ 'future, a\n'
' check may be added to prevent this.\n'
'\n'
'* Nonempty *__slots__* does not work for classes derived '
@@ -1097,9 +1102,9 @@ topics = {'assert': 'The "assert" statement\n'
'"bytes" and "tuple".\n'
'\n'
'* Any non-string iterable may be assigned to '
- '*__slots__*. Mappings\n'
- ' may also be used; however, in the future, special '
- 'meaning may be\n'
+ '*__slots__*. Mappings may\n'
+ ' also be used; however, in the future, special meaning '
+ 'may be\n'
' assigned to the values corresponding to each key.\n'
'\n'
'* *__class__* assignment works only if both classes have '
@@ -1115,9 +1120,9 @@ topics = {'assert': 'The "assert" statement\n'
' raise "TypeError".\n'
'\n'
'* If an iterator is used for *__slots__* then a '
- 'descriptor is\n'
- ' created for each of the iterator’s values. However, '
- 'the *__slots__*\n'
+ 'descriptor is created\n'
+ ' for each of the iterator’s values. However, the '
+ '*__slots__*\n'
' attribute will be an empty iterator.\n',
'attribute-references': 'Attribute references\n'
'********************\n'
@@ -1882,10 +1887,10 @@ topics = {'assert': 'The "assert" statement\n'
' != x" is true. This behavior is compliant with IEEE 754.\n'
'\n'
'* "None" and "NotImplemented" are singletons. **PEP 8** '
- 'advises\n'
- ' that comparisons for singletons should always be done with '
- '"is" or\n'
- ' "is not", never the equality operators.\n'
+ 'advises that\n'
+ ' comparisons for singletons should always be done with "is" '
+ 'or "is\n'
+ ' not", never the equality operators.\n'
'\n'
'* Binary sequences (instances of "bytes" or "bytearray") can '
'be\n'
@@ -1901,15 +1906,15 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Strings and binary sequences cannot be directly compared.\n'
'\n'
- '* Sequences (instances of "tuple", "list", or "range") can '
- 'be\n'
- ' compared only within each of their types, with the '
- 'restriction that\n'
- ' ranges do not support order comparison. Equality '
- 'comparison across\n'
- ' these types results in inequality, and ordering comparison '
- 'across\n'
- ' these types raises "TypeError".\n'
+ '* Sequences (instances of "tuple", "list", or "range") can be '
+ 'compared\n'
+ ' only within each of their types, with the restriction that '
+ 'ranges do\n'
+ ' not support order comparison. Equality comparison across '
+ 'these\n'
+ ' types results in inequality, and ordering comparison across '
+ 'these\n'
+ ' types raises "TypeError".\n'
'\n'
' Sequences compare lexicographically using comparison of\n'
' corresponding elements. The built-in containers typically '
@@ -1933,8 +1938,8 @@ topics = {'assert': 'The "assert" statement\n'
' false because the type is not the same).\n'
'\n'
' * Collections that support order comparison are ordered the '
- 'same\n'
- ' as their first unequal elements (for example, "[1,2,x] <= '
+ 'same as\n'
+ ' their first unequal elements (for example, "[1,2,x] <= '
'[1,2,y]"\n'
' has the same value as "x <= y"). If a corresponding '
'element does\n'
@@ -1952,8 +1957,8 @@ topics = {'assert': 'The "assert" statement\n'
'"TypeError".\n'
'\n'
'* Sets (instances of "set" or "frozenset") can be compared '
- 'within\n'
- ' and across their types.\n'
+ 'within and\n'
+ ' across their types.\n'
'\n'
' They define order comparison operators to mean subset and '
'superset\n'
@@ -1972,8 +1977,8 @@ topics = {'assert': 'The "assert" statement\n'
' Comparison of sets enforces reflexivity of its elements.\n'
'\n'
'* Most other built-in types have no comparison methods '
- 'implemented,\n'
- ' so they inherit the default comparison behavior.\n'
+ 'implemented, so\n'
+ ' they inherit the default comparison behavior.\n'
'\n'
'User-defined classes that customize their comparison behavior '
'should\n'
@@ -2022,10 +2027,10 @@ topics = {'assert': 'The "assert" statement\n'
' "total_ordering()" decorator.\n'
'\n'
'* The "hash()" result should be consistent with equality. '
- 'Objects\n'
- ' that are equal should either have the same hash value, or '
- 'be marked\n'
- ' as unhashable.\n'
+ 'Objects that\n'
+ ' are equal should either have the same hash value, or be '
+ 'marked as\n'
+ ' unhashable.\n'
'\n'
'Python does not enforce these consistency rules. In fact, '
'the\n'
@@ -2299,10 +2304,11 @@ topics = {'assert': 'The "assert" statement\n'
':= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, '
'2]".\n'
'\n'
- 'Note: There is a subtlety when the sequence is being modified by '
- 'the\n'
- ' loop (this can only occur for mutable sequences, e.g. lists). '
- 'An\n'
+ 'Note:\n'
+ '\n'
+ ' There is a subtlety when the sequence is being modified by the '
+ 'loop\n'
+ ' (this can only occur for mutable sequences, e.g. lists). An\n'
' internal counter is used to keep track of which item is used '
'next,\n'
' and this is incremented on each iteration. When this counter '
@@ -2525,8 +2531,8 @@ topics = {'assert': 'The "assert" statement\n'
'follows:\n'
'\n'
'1. The context expression (the expression given in the '
- '"with_item")\n'
- ' is evaluated to obtain a context manager.\n'
+ '"with_item") is\n'
+ ' evaluated to obtain a context manager.\n'
'\n'
'2. The context manager’s "__enter__()" is loaded for later use.\n'
'\n'
@@ -2534,13 +2540,15 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'4. The context manager’s "__enter__()" method is invoked.\n'
'\n'
- '5. If a target was included in the "with" statement, the return\n'
- ' value from "__enter__()" is assigned to it.\n'
+ '5. If a target was included in the "with" statement, the return '
+ 'value\n'
+ ' from "__enter__()" is assigned to it.\n'
+ '\n'
+ ' Note:\n'
'\n'
- ' Note: The "with" statement guarantees that if the '
- '"__enter__()"\n'
- ' method returns without an error, then "__exit__()" will '
- 'always be\n'
+ ' The "with" statement guarantees that if the "__enter__()" '
+ 'method\n'
+ ' returns without an error, then "__exit__()" will always be\n'
' called. Thus, if an error occurs during the assignment to '
'the\n'
' target list, it will be treated the same as an error '
@@ -2710,17 +2718,17 @@ topics = {'assert': 'The "assert" statement\n'
'“pre-\n'
'computed” value is used for each call. This is especially '
'important\n'
- 'to understand when a default parameter is a mutable object, such '
- 'as a\n'
- 'list or a dictionary: if the function modifies the object (e.g. '
- 'by\n'
- 'appending an item to a list), the default value is in effect '
- 'modified.\n'
- 'This is generally not what was intended. A way around this is '
- 'to use\n'
- '"None" as the default, and explicitly test for it in the body of '
- 'the\n'
- 'function, e.g.:\n'
+ 'to understand when a default parameter value is a mutable '
+ 'object, such\n'
+ 'as a list or a dictionary: if the function modifies the object '
+ '(e.g.\n'
+ 'by appending an item to a list), the default parameter value is '
+ 'in\n'
+ 'effect modified. This is generally not what was intended. A '
+ 'way\n'
+ 'around this is to use "None" as the default, and explicitly test '
+ 'for\n'
+ 'it in the body of the function, e.g.:\n'
'\n'
' def whats_on_the_telly(penguin=None):\n'
' if penguin is None:\n'
@@ -3054,14 +3062,17 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'-[ Footnotes ]-\n'
'\n'
- '[1] The exception is propagated to the invocation stack unless\n'
- ' there is a "finally" clause which happens to raise another\n'
- ' exception. That new exception causes the old one to be '
- 'lost.\n'
+ '[1] The exception is propagated to the invocation stack unless '
+ 'there\n'
+ ' is a "finally" clause which happens to raise another '
+ 'exception.\n'
+ ' That new exception causes the old one to be lost.\n'
'\n'
- '[2] A string literal appearing as the first statement in the\n'
- ' function body is transformed into the function’s "__doc__"\n'
- ' attribute and therefore the function’s *docstring*.\n'
+ '[2] A string literal appearing as the first statement in the '
+ 'function\n'
+ ' body is transformed into the function’s "__doc__" attribute '
+ 'and\n'
+ ' therefore the function’s *docstring*.\n'
'\n'
'[3] A string literal appearing as the first statement in the '
'class\n'
@@ -3160,8 +3171,8 @@ topics = {'assert': 'The "assert" statement\n'
' complex;\n'
'\n'
'* otherwise, if either argument is a floating point number, '
- 'the\n'
- ' other is converted to floating point;\n'
+ 'the other\n'
+ ' is converted to floating point;\n'
'\n'
'* otherwise, both must be integers and no conversion is '
'necessary.\n'
@@ -3271,7 +3282,9 @@ topics = {'assert': 'The "assert" statement\n'
'for\n'
' objects that still exist when the interpreter exits.\n'
'\n'
- ' Note: "del x" doesn’t directly call "x.__del__()" — the '
+ ' Note:\n'
+ '\n'
+ ' "del x" doesn’t directly call "x.__del__()" — the '
'former\n'
' decrements the reference count for "x" by one, and the '
'latter is\n'
@@ -3295,13 +3308,15 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' See also: Documentation for the "gc" module.\n'
'\n'
- ' Warning: Due to the precarious circumstances under '
- 'which\n'
- ' "__del__()" methods are invoked, exceptions that occur '
- 'during\n'
- ' their execution are ignored, and a warning is printed '
- 'to\n'
- ' "sys.stderr" instead. In particular:\n'
+ ' Warning:\n'
+ '\n'
+ ' Due to the precarious circumstances under which '
+ '"__del__()"\n'
+ ' methods are invoked, exceptions that occur during '
+ 'their execution\n'
+ ' are ignored, and a warning is printed to "sys.stderr" '
+ 'instead.\n'
+ ' In particular:\n'
'\n'
' * "__del__()" can be invoked when arbitrary code is '
'being\n'
@@ -3314,22 +3329,20 @@ topics = {'assert': 'The "assert" statement\n'
' that gets interrupted to execute "__del__()".\n'
'\n'
' * "__del__()" can be executed during interpreter '
- 'shutdown. As\n'
- ' a consequence, the global variables it needs to '
- 'access\n'
- ' (including other modules) may already have been '
- 'deleted or set\n'
- ' to "None". Python guarantees that globals whose name '
- 'begins\n'
- ' with a single underscore are deleted from their '
- 'module before\n'
- ' other globals are deleted; if no other references to '
- 'such\n'
- ' globals exist, this may help in assuring that '
- 'imported modules\n'
- ' are still available at the time when the "__del__()" '
- 'method is\n'
- ' called.\n'
+ 'shutdown. As a\n'
+ ' consequence, the global variables it needs to access '
+ '(including\n'
+ ' other modules) may already have been deleted or set '
+ 'to "None".\n'
+ ' Python guarantees that globals whose name begins '
+ 'with a single\n'
+ ' underscore are deleted from their module before '
+ 'other globals\n'
+ ' are deleted; if no other references to such globals '
+ 'exist, this\n'
+ ' may help in assuring that imported modules are still '
+ 'available\n'
+ ' at the time when the "__del__()" method is called.\n'
'\n'
'object.__repr__(self)\n'
'\n'
@@ -3505,19 +3518,21 @@ topics = {'assert': 'The "assert" statement\n'
' def __hash__(self):\n'
' return hash((self.name, self.nick, self.color))\n'
'\n'
- ' Note: "hash()" truncates the value returned from an '
- 'object’s\n'
- ' custom "__hash__()" method to the size of a '
- '"Py_ssize_t". This\n'
- ' is typically 8 bytes on 64-bit builds and 4 bytes on '
- '32-bit\n'
- ' builds. If an object’s "__hash__()" must '
- 'interoperate on builds\n'
- ' of different bit sizes, be sure to check the width on '
- 'all\n'
- ' supported builds. An easy way to do this is with '
- '"python -c\n'
- ' "import sys; print(sys.hash_info.width)"".\n'
+ ' Note:\n'
+ '\n'
+ ' "hash()" truncates the value returned from an object’s '
+ 'custom\n'
+ ' "__hash__()" method to the size of a "Py_ssize_t". '
+ 'This is\n'
+ ' typically 8 bytes on 64-bit builds and 4 bytes on '
+ '32-bit builds.\n'
+ ' If an object’s "__hash__()" must interoperate on '
+ 'builds of\n'
+ ' different bit sizes, be sure to check the width on all '
+ 'supported\n'
+ ' builds. An easy way to do this is with "python -c '
+ '"import sys;\n'
+ ' print(sys.hash_info.width)"".\n'
'\n'
' If a class does not define an "__eq__()" method it '
'should not\n'
@@ -3575,22 +3590,24 @@ topics = {'assert': 'The "assert" statement\n'
' hashable by an "isinstance(obj, '
'collections.abc.Hashable)" call.\n'
'\n'
- ' Note: By default, the "__hash__()" values of str and '
- 'bytes\n'
- ' objects are “salted” with an unpredictable random '
- 'value.\n'
- ' Although they remain constant within an individual '
- 'Python\n'
- ' process, they are not predictable between repeated '
- 'invocations of\n'
- ' Python.This is intended to provide protection against '
- 'a denial-\n'
- ' of-service caused by carefully-chosen inputs that '
- 'exploit the\n'
- ' worst case performance of a dict insertion, O(n^2) '
- 'complexity.\n'
- ' See '
- 'http://www.ocert.org/advisories/ocert-2011-003.html for\n'
+ ' Note:\n'
+ '\n'
+ ' By default, the "__hash__()" values of str and bytes '
+ 'objects are\n'
+ ' “salted” with an unpredictable random value. Although '
+ 'they\n'
+ ' remain constant within an individual Python process, '
+ 'they are not\n'
+ ' predictable between repeated invocations of '
+ 'Python.This is\n'
+ ' intended to provide protection against a '
+ 'denial-of-service caused\n'
+ ' by carefully-chosen inputs that exploit the worst '
+ 'case\n'
+ ' performance of a dict insertion, O(n^2) complexity. '
+ 'See\n'
+ ' http://www.ocert.org/advisories/ocert-2011-003.html '
+ 'for\n'
' details.Changing hash values affects the iteration '
'order of sets.\n'
' Python has never made guarantees about this ordering '
@@ -4170,9 +4187,11 @@ topics = {'assert': 'The "assert" statement\n'
'its\n'
' value.\n'
'\n'
- ' Note: "print()" can also be used, but is not a debugger '
- 'command —\n'
- ' this executes the Python "print()" function.\n'
+ ' Note:\n'
+ '\n'
+ ' "print()" can also be used, but is not a debugger command — '
+ 'this\n'
+ ' executes the Python "print()" function.\n'
'\n'
'pp expression\n'
'\n'
@@ -4298,13 +4317,14 @@ topics = {'assert': 'The "assert" statement\n'
' the current environment).\n'
'\n'
'retval\n'
- 'Print the return value for the last return of a function.\n'
+ '\n'
+ ' Print the return value for the last return of a function.\n'
'\n'
'-[ Footnotes ]-\n'
'\n'
'[1] Whether a frame is considered to originate in a certain '
- 'module\n'
- ' is determined by the "__name__" in the frame globals.\n',
+ 'module is\n'
+ ' determined by the "__name__" in the frame globals.\n',
'del': 'The "del" statement\n'
'*******************\n'
'\n'
@@ -4484,13 +4504,15 @@ topics = {'assert': 'The "assert" statement\n'
'about the\n'
'exceptional condition.\n'
'\n'
- 'Note: Exception messages are not part of the Python API. '
- 'Their\n'
- ' contents may change from one version of Python to the next '
- 'without\n'
- ' warning and should not be relied on by code which will run '
- 'under\n'
- ' multiple versions of the interpreter.\n'
+ 'Note:\n'
+ '\n'
+ ' Exception messages are not part of the Python API. Their '
+ 'contents\n'
+ ' may change from one version of Python to the next without '
+ 'warning\n'
+ ' and should not be relied on by code which will run under '
+ 'multiple\n'
+ ' versions of the interpreter.\n'
'\n'
'See also the description of the "try" statement in section The '
'try\n'
@@ -4500,10 +4522,9 @@ topics = {'assert': 'The "assert" statement\n'
'-[ Footnotes ]-\n'
'\n'
'[1] This limitation occurs because the code that is executed '
- 'by\n'
- ' these operations is not available at the time the module '
- 'is\n'
- ' compiled.\n',
+ 'by these\n'
+ ' operations is not available at the time the module is '
+ 'compiled.\n',
'execmodel': 'Execution model\n'
'***************\n'
'\n'
@@ -4809,13 +4830,15 @@ topics = {'assert': 'The "assert" statement\n'
'about the\n'
'exceptional condition.\n'
'\n'
- 'Note: Exception messages are not part of the Python API. '
- 'Their\n'
- ' contents may change from one version of Python to the next '
- 'without\n'
- ' warning and should not be relied on by code which will run '
- 'under\n'
- ' multiple versions of the interpreter.\n'
+ 'Note:\n'
+ '\n'
+ ' Exception messages are not part of the Python API. Their '
+ 'contents\n'
+ ' may change from one version of Python to the next without '
+ 'warning\n'
+ ' and should not be relied on by code which will run under '
+ 'multiple\n'
+ ' versions of the interpreter.\n'
'\n'
'See also the description of the "try" statement in section The '
'try\n'
@@ -4824,11 +4847,10 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'-[ Footnotes ]-\n'
'\n'
- '[1] This limitation occurs because the code that is executed '
- 'by\n'
- ' these operations is not available at the time the module '
- 'is\n'
- ' compiled.\n',
+ '[1] This limitation occurs because the code that is executed by '
+ 'these\n'
+ ' operations is not available at the time the module is '
+ 'compiled.\n',
'exprlists': 'Expression lists\n'
'****************\n'
'\n'
@@ -4947,8 +4969,11 @@ topics = {'assert': 'The "assert" statement\n'
'i\n'
':= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".\n'
'\n'
- 'Note: There is a subtlety when the sequence is being modified by the\n'
- ' loop (this can only occur for mutable sequences, e.g. lists). An\n'
+ 'Note:\n'
+ '\n'
+ ' There is a subtlety when the sequence is being modified by the '
+ 'loop\n'
+ ' (this can only occur for mutable sequences, e.g. lists). An\n'
' internal counter is used to keep track of which item is used next,\n'
' and this is incremented on each iteration. When this counter has\n'
' reached the length of the sequence the loop terminates. This '
@@ -5786,17 +5811,17 @@ topics = {'assert': 'The "assert" statement\n'
'“pre-\n'
'computed” value is used for each call. This is especially '
'important\n'
- 'to understand when a default parameter is a mutable object, such '
- 'as a\n'
- 'list or a dictionary: if the function modifies the object (e.g. '
- 'by\n'
- 'appending an item to a list), the default value is in effect '
- 'modified.\n'
- 'This is generally not what was intended. A way around this is '
- 'to use\n'
- '"None" as the default, and explicitly test for it in the body of '
- 'the\n'
- 'function, e.g.:\n'
+ 'to understand when a default parameter value is a mutable '
+ 'object, such\n'
+ 'as a list or a dictionary: if the function modifies the object '
+ '(e.g.\n'
+ 'by appending an item to a list), the default parameter value is '
+ 'in\n'
+ 'effect modified. This is generally not what was intended. A '
+ 'way\n'
+ 'around this is to use "None" as the default, and explicitly test '
+ 'for\n'
+ 'it in the body of the function, e.g.:\n'
'\n'
' def whats_on_the_telly(penguin=None):\n'
' if penguin is None:\n'
@@ -5956,7 +5981,9 @@ topics = {'assert': 'The "assert" statement\n'
'defined.\n'
' See section The import statement.\n'
'\n'
- ' Note: The name "_" is often used in conjunction with\n'
+ ' Note:\n'
+ '\n'
+ ' The name "_" is often used in conjunction with\n'
' internationalization; refer to the documentation for the\n'
' "gettext" module for more information on this '
'convention.\n'
@@ -6060,8 +6087,8 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'A non-normative HTML file listing all valid identifier '
'characters for\n'
- 'Unicode 4.1 can be found at https://www.dcl.hpi.uni-\n'
- 'potsdam.de/home/loewis/table-3131.html.\n'
+ 'Unicode 4.1 can be found at\n'
+ 'https://www.unicode.org/Public/13.0.0/ucd/DerivedCoreProperties.txt\n'
'\n'
'\n'
'Keywords\n'
@@ -6102,7 +6129,9 @@ topics = {'assert': 'The "assert" statement\n'
'defined.\n'
' See section The import statement.\n'
'\n'
- ' Note: The name "_" is often used in conjunction with\n'
+ ' Note:\n'
+ '\n'
+ ' The name "_" is often used in conjunction with\n'
' internationalization; refer to the documentation for '
'the\n'
' "gettext" module for more information on this '
@@ -6187,8 +6216,9 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'1. find a module, loading and initializing it if necessary\n'
'\n'
- '2. define a name or names in the local namespace for the scope\n'
- ' where the "import" statement occurs.\n'
+ '2. define a name or names in the local namespace for the scope '
+ 'where\n'
+ ' the "import" statement occurs.\n'
'\n'
'When the statement contains multiple clauses (separated by commas) '
'the\n'
@@ -6214,8 +6244,9 @@ topics = {'assert': 'The "assert" statement\n'
'made\n'
'available in the local namespace in one of three ways:\n'
'\n'
- '* If the module name is followed by "as", then the name following\n'
- ' "as" is bound directly to the imported module.\n'
+ '* If the module name is followed by "as", then the name following '
+ '"as"\n'
+ ' is bound directly to the imported module.\n'
'\n'
'* If no other name is specified, and the module being imported is '
'a\n'
@@ -6893,15 +6924,18 @@ topics = {'assert': 'The "assert" statement\n'
'"__rpow__()" (the\n'
' coercion rules would become too complicated).\n'
'\n'
- ' Note: If the right operand’s type is a subclass of the '
- 'left\n'
- ' operand’s type and that subclass provides the '
- 'reflected method\n'
- ' for the operation, this method will be called before '
- 'the left\n'
- ' operand’s non-reflected method. This behavior allows '
- 'subclasses\n'
- ' to override their ancestors’ operations.\n'
+ ' Note:\n'
+ '\n'
+ ' If the right operand’s type is a subclass of the left '
+ 'operand’s\n'
+ ' type and that subclass provides a different '
+ 'implementation of the\n'
+ ' reflected method for the operation, this method will '
+ 'be called\n'
+ ' before the left operand’s non-reflected method. This '
+ 'behavior\n'
+ ' allows subclasses to override their ancestors’ '
+ 'operations.\n'
'\n'
'object.__iadd__(self, other)\n'
'object.__isub__(self, other)\n'
@@ -7221,8 +7255,8 @@ topics = {'assert': 'The "assert" statement\n'
'-[ Footnotes ]-\n'
'\n'
'[1] While "abs(x%y) < abs(y)" is true mathematically, '
- 'for floats\n'
- ' it may not be true numerically due to roundoff. For '
+ 'for floats it\n'
+ ' may not be true numerically due to roundoff. For '
'example, and\n'
' assuming a platform on which a Python float is an '
'IEEE 754 double-\n'
@@ -7287,22 +7321,22 @@ topics = {'assert': 'The "assert" statement\n'
'"unicodedata.normalize()".\n'
'\n'
'[4] Due to automatic garbage-collection, free lists, and '
- 'the\n'
- ' dynamic nature of descriptors, you may notice '
- 'seemingly unusual\n'
- ' behaviour in certain uses of the "is" operator, like '
- 'those\n'
- ' involving comparisons between instance methods, or '
- 'constants.\n'
- ' Check their documentation for more info.\n'
+ 'the dynamic\n'
+ ' nature of descriptors, you may notice seemingly '
+ 'unusual behaviour\n'
+ ' in certain uses of the "is" operator, like those '
+ 'involving\n'
+ ' comparisons between instance methods, or constants. '
+ 'Check their\n'
+ ' documentation for more info.\n'
'\n'
'[5] The "%" operator is also used for string formatting; '
'the same\n'
' precedence applies.\n'
'\n'
'[6] The power operator "**" binds less tightly than an '
- 'arithmetic\n'
- ' or bitwise unary operator on its right, that is, '
+ 'arithmetic or\n'
+ ' bitwise unary operator on its right, that is, '
'"2**-1" is "0.5".\n',
'pass': 'The "pass" statement\n'
'********************\n'
@@ -7592,9 +7626,11 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' New in version 3.4.\n'
'\n'
- 'Note: Slicing is done exclusively with the following three '
- 'methods.\n'
- ' A call like\n'
+ 'Note:\n'
+ '\n'
+ ' Slicing is done exclusively with the following three '
+ 'methods. A\n'
+ ' call like\n'
'\n'
' a[1:2] = b\n'
'\n'
@@ -7625,7 +7661,9 @@ topics = {'assert': 'The "assert" statement\n'
'the\n'
' container), "KeyError" should be raised.\n'
'\n'
- ' Note: "for" loops expect that an "IndexError" will be '
+ ' Note:\n'
+ '\n'
+ ' "for" loops expect that an "IndexError" will be '
'raised for\n'
' illegal indexes to allow proper detection of the end '
'of the\n'
@@ -7861,26 +7899,26 @@ topics = {'assert': 'The "assert" statement\n'
'-[ Footnotes ]-\n'
'\n'
'[1] Additional information on these special methods may be '
- 'found\n'
- ' in the Python Reference Manual (Basic customization).\n'
+ 'found in\n'
+ ' the Python Reference Manual (Basic customization).\n'
'\n'
'[2] As a consequence, the list "[1, 2]" is considered equal '
- 'to\n'
- ' "[1.0, 2.0]", and similarly for tuples.\n'
+ 'to "[1.0,\n'
+ ' 2.0]", and similarly for tuples.\n'
'\n'
'[3] They must have since the parser can’t tell the type of '
'the\n'
' operands.\n'
'\n'
'[4] Cased characters are those with general category '
- 'property\n'
- ' being one of “Lu” (Letter, uppercase), “Ll” (Letter, '
- 'lowercase),\n'
- ' or “Lt” (Letter, titlecase).\n'
- '\n'
- '[5] To format only a tuple you should therefore provide a\n'
- ' singleton tuple whose only element is the tuple to be '
- 'formatted.\n',
+ 'property being\n'
+ ' one of “Lu” (Letter, uppercase), “Ll” (Letter, '
+ 'lowercase), or “Lt”\n'
+ ' (Letter, titlecase).\n'
+ '\n'
+ '[5] To format only a tuple you should therefore provide a '
+ 'singleton\n'
+ ' tuple whose only element is the tuple to be formatted.\n',
'specialnames': 'Special method names\n'
'********************\n'
'\n'
@@ -8025,7 +8063,9 @@ topics = {'assert': 'The "assert" statement\n'
'for\n'
' objects that still exist when the interpreter exits.\n'
'\n'
- ' Note: "del x" doesn’t directly call "x.__del__()" — the '
+ ' Note:\n'
+ '\n'
+ ' "del x" doesn’t directly call "x.__del__()" — the '
'former\n'
' decrements the reference count for "x" by one, and the '
'latter is\n'
@@ -8049,12 +8089,15 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' See also: Documentation for the "gc" module.\n'
'\n'
- ' Warning: Due to the precarious circumstances under which\n'
- ' "__del__()" methods are invoked, exceptions that occur '
- 'during\n'
- ' their execution are ignored, and a warning is printed '
- 'to\n'
- ' "sys.stderr" instead. In particular:\n'
+ ' Warning:\n'
+ '\n'
+ ' Due to the precarious circumstances under which '
+ '"__del__()"\n'
+ ' methods are invoked, exceptions that occur during their '
+ 'execution\n'
+ ' are ignored, and a warning is printed to "sys.stderr" '
+ 'instead.\n'
+ ' In particular:\n'
'\n'
' * "__del__()" can be invoked when arbitrary code is '
'being\n'
@@ -8067,22 +8110,20 @@ topics = {'assert': 'The "assert" statement\n'
' that gets interrupted to execute "__del__()".\n'
'\n'
' * "__del__()" can be executed during interpreter '
- 'shutdown. As\n'
- ' a consequence, the global variables it needs to '
- 'access\n'
- ' (including other modules) may already have been '
- 'deleted or set\n'
- ' to "None". Python guarantees that globals whose name '
- 'begins\n'
- ' with a single underscore are deleted from their '
- 'module before\n'
- ' other globals are deleted; if no other references to '
- 'such\n'
- ' globals exist, this may help in assuring that '
- 'imported modules\n'
- ' are still available at the time when the "__del__()" '
- 'method is\n'
- ' called.\n'
+ 'shutdown. As a\n'
+ ' consequence, the global variables it needs to access '
+ '(including\n'
+ ' other modules) may already have been deleted or set '
+ 'to "None".\n'
+ ' Python guarantees that globals whose name begins with '
+ 'a single\n'
+ ' underscore are deleted from their module before other '
+ 'globals\n'
+ ' are deleted; if no other references to such globals '
+ 'exist, this\n'
+ ' may help in assuring that imported modules are still '
+ 'available\n'
+ ' at the time when the "__del__()" method is called.\n'
'\n'
'object.__repr__(self)\n'
'\n'
@@ -8258,19 +8299,21 @@ topics = {'assert': 'The "assert" statement\n'
' def __hash__(self):\n'
' return hash((self.name, self.nick, self.color))\n'
'\n'
- ' Note: "hash()" truncates the value returned from an '
- 'object’s\n'
- ' custom "__hash__()" method to the size of a '
- '"Py_ssize_t". This\n'
- ' is typically 8 bytes on 64-bit builds and 4 bytes on '
- '32-bit\n'
- ' builds. If an object’s "__hash__()" must interoperate '
- 'on builds\n'
- ' of different bit sizes, be sure to check the width on '
- 'all\n'
- ' supported builds. An easy way to do this is with '
- '"python -c\n'
- ' "import sys; print(sys.hash_info.width)"".\n'
+ ' Note:\n'
+ '\n'
+ ' "hash()" truncates the value returned from an object’s '
+ 'custom\n'
+ ' "__hash__()" method to the size of a "Py_ssize_t". '
+ 'This is\n'
+ ' typically 8 bytes on 64-bit builds and 4 bytes on '
+ '32-bit builds.\n'
+ ' If an object’s "__hash__()" must interoperate on '
+ 'builds of\n'
+ ' different bit sizes, be sure to check the width on all '
+ 'supported\n'
+ ' builds. An easy way to do this is with "python -c '
+ '"import sys;\n'
+ ' print(sys.hash_info.width)"".\n'
'\n'
' If a class does not define an "__eq__()" method it should '
'not\n'
@@ -8326,21 +8369,22 @@ topics = {'assert': 'The "assert" statement\n'
' hashable by an "isinstance(obj, '
'collections.abc.Hashable)" call.\n'
'\n'
- ' Note: By default, the "__hash__()" values of str and '
- 'bytes\n'
- ' objects are “salted” with an unpredictable random '
- 'value.\n'
- ' Although they remain constant within an individual '
- 'Python\n'
- ' process, they are not predictable between repeated '
- 'invocations of\n'
- ' Python.This is intended to provide protection against a '
- 'denial-\n'
- ' of-service caused by carefully-chosen inputs that '
- 'exploit the\n'
- ' worst case performance of a dict insertion, O(n^2) '
- 'complexity.\n'
- ' See http://www.ocert.org/advisories/ocert-2011-003.html '
+ ' Note:\n'
+ '\n'
+ ' By default, the "__hash__()" values of str and bytes '
+ 'objects are\n'
+ ' “salted” with an unpredictable random value. Although '
+ 'they\n'
+ ' remain constant within an individual Python process, '
+ 'they are not\n'
+ ' predictable between repeated invocations of Python.This '
+ 'is\n'
+ ' intended to provide protection against a '
+ 'denial-of-service caused\n'
+ ' by carefully-chosen inputs that exploit the worst case\n'
+ ' performance of a dict insertion, O(n^2) complexity. '
+ 'See\n'
+ ' http://www.ocert.org/advisories/ocert-2011-003.html '
'for\n'
' details.Changing hash values affects the iteration '
'order of sets.\n'
@@ -8429,11 +8473,13 @@ topics = {'assert': 'The "assert" statement\n'
'needs, for\n'
' example, "object.__getattribute__(self, name)".\n'
'\n'
- ' Note: This method may still be bypassed when looking up '
- 'special\n'
- ' methods as the result of implicit invocation via '
- 'language syntax\n'
- ' or built-in functions. See Special method lookup.\n'
+ ' Note:\n'
+ '\n'
+ ' This method may still be bypassed when looking up '
+ 'special methods\n'
+ ' as the result of implicit invocation via language '
+ 'syntax or\n'
+ ' built-in functions. See Special method lookup.\n'
'\n'
'object.__setattr__(self, name, value)\n'
'\n'
@@ -8517,15 +8563,16 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' sys.modules[__name__].__class__ = VerboseModule\n'
'\n'
- 'Note: Defining module "__getattr__" and setting module '
- '"__class__"\n'
- ' only affect lookups made using the attribute access syntax '
- '–\n'
- ' directly accessing the module globals (whether by code '
- 'within the\n'
- ' module, or via a reference to the module’s globals '
- 'dictionary) is\n'
- ' unaffected.\n'
+ 'Note:\n'
+ '\n'
+ ' Defining module "__getattr__" and setting module '
+ '"__class__" only\n'
+ ' affect lookups made using the attribute access syntax – '
+ 'directly\n'
+ ' accessing the module globals (whether by code within the '
+ 'module, or\n'
+ ' via a reference to the module’s globals dictionary) is '
+ 'unaffected.\n'
'\n'
'Changed in version 3.5: "__class__" module attribute is now '
'writable.\n'
@@ -8608,12 +8655,14 @@ topics = {'assert': 'The "assert" statement\n'
'The\n'
' descriptor has been assigned to *name*.\n'
'\n'
- ' Note: "__set_name__()" is only called implicitly as part '
- 'of the\n'
- ' "type" constructor, so it will need to be called '
- 'explicitly with\n'
- ' the appropriate parameters when a descriptor is added '
- 'to a class\n'
+ ' Note:\n'
+ '\n'
+ ' "__set_name__()" is only called implicitly as part of '
+ 'the "type"\n'
+ ' constructor, so it will need to be called explicitly '
+ 'with the\n'
+ ' appropriate parameters when a descriptor is added to a '
+ 'class\n'
' after initial creation:\n'
'\n'
' class A:\n'
@@ -8772,10 +8821,9 @@ topics = {'assert': 'The "assert" statement\n'
'~~~~~~~~~~~~~~~~~~~~~~~~~~\n'
'\n'
'* When inheriting from a class without *__slots__*, the '
- '*__dict__*\n'
- ' and *__weakref__* attribute of the instances will always '
- 'be\n'
- ' accessible.\n'
+ '*__dict__* and\n'
+ ' *__weakref__* attribute of the instances will always be '
+ 'accessible.\n'
'\n'
'* Without a *__dict__* variable, instances cannot be '
'assigned new\n'
@@ -8789,13 +8837,12 @@ topics = {'assert': 'The "assert" statement\n'
' declaration.\n'
'\n'
'* Without a *__weakref__* variable for each instance, '
- 'classes\n'
- ' defining *__slots__* do not support weak references to '
- 'its\n'
- ' instances. If weak reference support is needed, then add\n'
- ' "\'__weakref__\'" to the sequence of strings in the '
- '*__slots__*\n'
- ' declaration.\n'
+ 'classes defining\n'
+ ' *__slots__* do not support weak references to its '
+ 'instances. If weak\n'
+ ' reference support is needed, then add "\'__weakref__\'" to '
+ 'the\n'
+ ' sequence of strings in the *__slots__* declaration.\n'
'\n'
'* *__slots__* are implemented at the class level by '
'creating\n'
@@ -8808,23 +8855,22 @@ topics = {'assert': 'The "assert" statement\n'
' attribute would overwrite the descriptor assignment.\n'
'\n'
'* The action of a *__slots__* declaration is not limited to '
- 'the\n'
- ' class where it is defined. *__slots__* declared in '
- 'parents are\n'
- ' available in child classes. However, child subclasses will '
- 'get a\n'
- ' *__dict__* and *__weakref__* unless they also define '
- '*__slots__*\n'
- ' (which should only contain names of any *additional* '
- 'slots).\n'
+ 'the class\n'
+ ' where it is defined. *__slots__* declared in parents are '
+ 'available\n'
+ ' in child classes. However, child subclasses will get a '
+ '*__dict__*\n'
+ ' and *__weakref__* unless they also define *__slots__* '
+ '(which should\n'
+ ' only contain names of any *additional* slots).\n'
'\n'
'* If a class defines a slot also defined in a base class, '
- 'the\n'
- ' instance variable defined by the base class slot is '
- 'inaccessible\n'
- ' (except by retrieving its descriptor directly from the '
- 'base class).\n'
- ' This renders the meaning of the program undefined. In the '
+ 'the instance\n'
+ ' variable defined by the base class slot is inaccessible '
+ '(except by\n'
+ ' retrieving its descriptor directly from the base class). '
+ 'This\n'
+ ' renders the meaning of the program undefined. In the '
'future, a\n'
' check may be added to prevent this.\n'
'\n'
@@ -8834,9 +8880,9 @@ topics = {'assert': 'The "assert" statement\n'
'and "tuple".\n'
'\n'
'* Any non-string iterable may be assigned to *__slots__*. '
- 'Mappings\n'
- ' may also be used; however, in the future, special meaning '
- 'may be\n'
+ 'Mappings may\n'
+ ' also be used; however, in the future, special meaning may '
+ 'be\n'
' assigned to the values corresponding to each key.\n'
'\n'
'* *__class__* assignment works only if both classes have the '
@@ -8852,8 +8898,8 @@ topics = {'assert': 'The "assert" statement\n'
' raise "TypeError".\n'
'\n'
'* If an iterator is used for *__slots__* then a descriptor '
- 'is\n'
- ' created for each of the iterator’s values. However, the '
+ 'is created\n'
+ ' for each of the iterator’s values. However, the '
'*__slots__*\n'
' attribute will be an empty iterator.\n'
'\n'
@@ -8906,9 +8952,11 @@ topics = {'assert': 'The "assert" statement\n'
'does nothing,\n'
' but raises an error if it is called with any arguments.\n'
'\n'
- ' Note: The metaclass hint "metaclass" is consumed by the '
- 'rest of\n'
- ' the type machinery, and is never passed to '
+ ' Note:\n'
+ '\n'
+ ' The metaclass hint "metaclass" is consumed by the rest '
+ 'of the\n'
+ ' type machinery, and is never passed to '
'"__init_subclass__"\n'
' implementations. The actual metaclass (rather than the '
'explicit\n'
@@ -8976,9 +9024,10 @@ topics = {'assert': 'The "assert" statement\n'
'tuple may\n'
'be empty, in such case the original base is ignored.\n'
'\n'
- 'See also: **PEP 560** - Core support for typing module and '
- 'generic\n'
- ' types\n'
+ 'See also:\n'
+ '\n'
+ ' **PEP 560** - Core support for typing module and generic '
+ 'types\n'
'\n'
'\n'
'Determining the appropriate metaclass\n'
@@ -9236,9 +9285,10 @@ topics = {'assert': 'The "assert" statement\n'
'type hints,\n'
'other usage is discouraged.\n'
'\n'
- 'See also: **PEP 560** - Core support for typing module and '
- 'generic\n'
- ' types\n'
+ 'See also:\n'
+ '\n'
+ ' **PEP 560** - Core support for typing module and generic '
+ 'types\n'
'\n'
'\n'
'Emulating callable objects\n'
@@ -9350,9 +9400,11 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' New in version 3.4.\n'
'\n'
- 'Note: Slicing is done exclusively with the following three '
- 'methods.\n'
- ' A call like\n'
+ 'Note:\n'
+ '\n'
+ ' Slicing is done exclusively with the following three '
+ 'methods. A\n'
+ ' call like\n'
'\n'
' a[1:2] = b\n'
'\n'
@@ -9383,8 +9435,10 @@ topics = {'assert': 'The "assert" statement\n'
'the\n'
' container), "KeyError" should be raised.\n'
'\n'
- ' Note: "for" loops expect that an "IndexError" will be '
- 'raised for\n'
+ ' Note:\n'
+ '\n'
+ ' "for" loops expect that an "IndexError" will be raised '
+ 'for\n'
' illegal indexes to allow proper detection of the end of '
'the\n'
' sequence.\n'
@@ -9574,15 +9628,18 @@ topics = {'assert': 'The "assert" statement\n'
'"__rpow__()" (the\n'
' coercion rules would become too complicated).\n'
'\n'
- ' Note: If the right operand’s type is a subclass of the '
- 'left\n'
- ' operand’s type and that subclass provides the reflected '
- 'method\n'
- ' for the operation, this method will be called before '
- 'the left\n'
- ' operand’s non-reflected method. This behavior allows '
- 'subclasses\n'
- ' to override their ancestors’ operations.\n'
+ ' Note:\n'
+ '\n'
+ ' If the right operand’s type is a subclass of the left '
+ 'operand’s\n'
+ ' type and that subclass provides a different '
+ 'implementation of the\n'
+ ' reflected method for the operation, this method will be '
+ 'called\n'
+ ' before the left operand’s non-reflected method. This '
+ 'behavior\n'
+ ' allows subclasses to override their ancestors’ '
+ 'operations.\n'
'\n'
'object.__iadd__(self, other)\n'
'object.__isub__(self, other)\n'
@@ -9914,36 +9971,7 @@ topics = {'assert': 'The "assert" statement\n'
'*start* and\n'
' *end* are interpreted as in slice notation.\n'
'\n'
- 'str.removeprefix(prefix, /)\n'
- '\n'
- ' If the string starts with the *prefix* string, return\n'
- ' "string[len(prefix):]". Otherwise, return a copy of the '
- 'original\n'
- ' string:\n'
- '\n'
- " >>> 'TestHook'.removeprefix('Test')\n"
- " 'Hook'\n"
- " >>> 'BaseTestCase'.removeprefix('Test')\n"
- " 'BaseTestCase'\n"
- '\n'
- ' New in version 3.9.\n'
- '\n'
- 'str.removesuffix(suffix, /)\n'
- '\n'
- ' If the string ends with the *suffix* string and that '
- '*suffix* is\n'
- ' not empty, return "string[:-len(suffix)]". Otherwise, '
- 'return a copy\n'
- ' of the original string:\n'
- '\n'
- " >>> 'MiscTests'.removesuffix('Tests')\n"
- " 'Misc'\n"
- " >>> 'TmpDirMixin'.removesuffix('Tests')\n"
- " 'TmpDirMixin'\n"
- '\n'
- ' New in version 3.9.\n'
- '\n'
- 'str.encode(encoding="utf-8", errors="strict")\n'
+ "str.encode(encoding='utf-8', errors='strict')\n"
'\n'
' Return an encoded version of the string as a bytes '
'object. Default\n'
@@ -10029,11 +10057,13 @@ topics = {'assert': 'The "assert" statement\n'
'"-1" if\n'
' *sub* is not found.\n'
'\n'
- ' Note: The "find()" method should be used only if you '
- 'need to know\n'
- ' the position of *sub*. To check if *sub* is a '
- 'substring or not,\n'
- ' use the "in" operator:\n'
+ ' Note:\n'
+ '\n'
+ ' The "find()" method should be used only if you need '
+ 'to know the\n'
+ ' position of *sub*. To check if *sub* is a substring '
+ 'or not, use\n'
+ ' the "in" operator:\n'
'\n'
" >>> 'Py' in 'Python'\n"
' True\n'
@@ -10062,8 +10092,9 @@ topics = {'assert': 'The "assert" statement\n'
' formatting options that can be specified in format '
'strings.\n'
'\n'
- ' Note: When formatting a number ("int", "float", '
- '"complex",\n'
+ ' Note:\n'
+ '\n'
+ ' When formatting a number ("int", "float", "complex",\n'
' "decimal.Decimal" and subclasses) with the "n" type '
'(ex:\n'
' "\'{:n}\'.format(1234)"), the function temporarily '
@@ -10371,6 +10402,35 @@ topics = {'assert': 'The "assert" statement\n'
'followed by\n'
' two empty strings.\n'
'\n'
+ 'str.removeprefix(prefix, /)\n'
+ '\n'
+ ' If the string starts with the *prefix* string, return\n'
+ ' "string[len(prefix):]". Otherwise, return a copy of the '
+ 'original\n'
+ ' string:\n'
+ '\n'
+ " >>> 'TestHook'.removeprefix('Test')\n"
+ " 'Hook'\n"
+ " >>> 'BaseTestCase'.removeprefix('Test')\n"
+ " 'BaseTestCase'\n"
+ '\n'
+ ' New in version 3.9.\n'
+ '\n'
+ 'str.removesuffix(suffix, /)\n'
+ '\n'
+ ' If the string ends with the *suffix* string and that '
+ '*suffix* is\n'
+ ' not empty, return "string[:-len(suffix)]". Otherwise, '
+ 'return a copy\n'
+ ' of the original string:\n'
+ '\n'
+ " >>> 'MiscTests'.removesuffix('Tests')\n"
+ " 'Misc'\n"
+ " >>> 'TmpDirMixin'.removesuffix('Tests')\n"
+ " 'TmpDirMixin'\n"
+ '\n'
+ ' New in version 3.9.\n'
+ '\n'
'str.replace(old, new[, count])\n'
'\n'
' Return a copy of the string with all occurrences of '
@@ -10417,7 +10477,7 @@ topics = {'assert': 'The "assert" statement\n'
'followed by\n'
' the string itself.\n'
'\n'
- 'str.rsplit(sep=None, maxsplit=-1)\n'
+ 'str.rsplit(sep=None, maxsplit=- 1)\n'
'\n'
' Return a list of the words in the string, using *sep* '
'as the\n'
@@ -10458,7 +10518,7 @@ topics = {'assert': 'The "assert" statement\n'
" >>> 'Monty Python'.removesuffix(' Python')\n"
" 'Monty'\n"
'\n'
- 'str.split(sep=None, maxsplit=-1)\n'
+ 'str.split(sep=None, maxsplit=- 1)\n'
'\n'
' Return a list of the words in the string, using *sep* '
'as the\n'
@@ -10939,17 +10999,20 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'2. Unlike in Standard C, exactly two hex digits are required.\n'
'\n'
- '3. In a bytes literal, hexadecimal and octal escapes denote the\n'
- ' byte with the given value. In a string literal, these escapes\n'
- ' denote a Unicode character with the given value.\n'
+ '3. In a bytes literal, hexadecimal and octal escapes denote the '
+ 'byte\n'
+ ' with the given value. In a string literal, these escapes '
+ 'denote a\n'
+ ' Unicode character with the given value.\n'
'\n'
'4. Changed in version 3.3: Support for name aliases [1] has been\n'
' added.\n'
'\n'
'5. Exactly four hex digits are required.\n'
'\n'
- '6. Any Unicode character can be encoded this way. Exactly eight\n'
- ' hex digits are required.\n'
+ '6. Any Unicode character can be encoded this way. Exactly eight '
+ 'hex\n'
+ ' digits are required.\n'
'\n'
'Unlike Standard C, all unrecognized escape sequences are left in '
'the\n'
@@ -11399,7 +11462,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 '
@@ -12647,9 +12710,11 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
' Changed in version 3.8: Dictionaries are now reversible.\n'
'\n'
- 'See also: "types.MappingProxyType" can be used to create a '
- 'read-only\n'
- ' view of a "dict".\n'
+ 'See also:\n'
+ '\n'
+ ' "types.MappingProxyType" can be used to create a read-only '
+ 'view of a\n'
+ ' "dict".\n'
'\n'
'\n'
'Dictionary view objects\n'
@@ -12712,6 +12777,14 @@ topics = {'assert': 'The "assert" statement\n'
' Changed in version 3.8: Dictionary views are now '
'reversible.\n'
'\n'
+ 'dictview.mapping\n'
+ '\n'
+ ' Return a "types.MappingProxyType" that wraps the '
+ 'original\n'
+ ' dictionary to which the view refers.\n'
+ '\n'
+ ' New in version 3.10.\n'
+ '\n'
'Keys views are set-like since their entries are unique and '
'hashable.\n'
'If all values are hashable, so that "(key, value)" pairs are '
@@ -12757,7 +12830,15 @@ topics = {'assert': 'The "assert" statement\n'
" >>> keys & {'eggs', 'bacon', 'salad'}\n"
" {'bacon'}\n"
" >>> keys ^ {'sausage', 'juice'}\n"
- " {'juice', 'sausage', 'bacon', 'spam'}\n",
+ " {'juice', 'sausage', 'bacon', 'spam'}\n"
+ '\n'
+ ' >>> # get back a read-only proxy for the original '
+ 'dictionary\n'
+ ' >>> values.mapping\n'
+ " mappingproxy({'eggs': 2, 'sausage': 1, 'bacon': 1, "
+ "'spam': 500})\n"
+ " >>> values.mapping['spam']\n"
+ ' 500\n',
'typesmethods': 'Methods\n'
'*******\n'
'\n'
@@ -13033,13 +13114,14 @@ topics = {'assert': 'The "assert" statement\n'
'"None", it\n'
' is treated like "1".\n'
'\n'
- '6. Concatenating immutable sequences always results in a new\n'
- ' object. This means that building up a sequence by repeated\n'
- ' concatenation will have a quadratic runtime cost in the '
- 'total\n'
- ' sequence length. To get a linear runtime cost, you must '
- 'switch to\n'
- ' one of the alternatives below:\n'
+ '6. Concatenating immutable sequences always results in a new '
+ 'object.\n'
+ ' This means that building up a sequence by repeated '
+ 'concatenation\n'
+ ' will have a quadratic runtime cost in the total sequence '
+ 'length.\n'
+ ' To get a linear runtime cost, you must switch to one of the\n'
+ ' alternatives below:\n'
'\n'
' * if concatenating "str" objects, you can build a list and '
'use\n'
@@ -13057,24 +13139,25 @@ topics = {'assert': 'The "assert" statement\n'
' * for other types, investigate the relevant class '
'documentation\n'
'\n'
- '7. Some sequence types (such as "range") only support item\n'
- ' sequences that follow specific patterns, and hence don’t '
- 'support\n'
- ' sequence concatenation or repetition.\n'
- '\n'
- '8. "index" raises "ValueError" when *x* is not found in *s*. '
- 'Not\n'
- ' all implementations support passing the additional arguments '
- '*i*\n'
- ' and *j*. These arguments allow efficient searching of '
- 'subsections\n'
- ' of the sequence. Passing the extra arguments is roughly '
- 'equivalent\n'
- ' to using "s[i:j].index(x)", only without copying any data and '
- 'with\n'
- ' the returned index being relative to the start of the '
+ '7. Some sequence types (such as "range") only support item '
+ 'sequences\n'
+ ' that follow specific patterns, and hence don’t support '
'sequence\n'
- ' rather than the start of the slice.\n'
+ ' concatenation or repetition.\n'
+ '\n'
+ '8. "index" raises "ValueError" when *x* is not found in *s*. Not '
+ 'all\n'
+ ' implementations support passing the additional arguments *i* '
+ 'and\n'
+ ' *j*. These arguments allow efficient searching of subsections '
+ 'of\n'
+ ' the sequence. Passing the extra arguments is roughly '
+ 'equivalent to\n'
+ ' using "s[i:j].index(x)", only without copying any data and '
+ 'with the\n'
+ ' returned index being relative to the start of the sequence '
+ 'rather\n'
+ ' than the start of the slice.\n'
'\n'
'\n'
'Immutable Sequence Types\n'
@@ -13202,17 +13285,17 @@ topics = {'assert': 'The "assert" statement\n'
'1. *t* must have the same length as the slice it is replacing.\n'
'\n'
'2. The optional argument *i* defaults to "-1", so that by '
- 'default\n'
- ' the last item is removed and returned.\n'
+ 'default the\n'
+ ' last item is removed and returned.\n'
'\n'
'3. "remove()" raises "ValueError" when *x* is not found in *s*.\n'
'\n'
- '4. The "reverse()" method modifies the sequence in place for\n'
- ' economy of space when reversing a large sequence. To remind '
- 'users\n'
- ' that it operates by side effect, it does not return the '
- 'reversed\n'
- ' sequence.\n'
+ '4. The "reverse()" method modifies the sequence in place for '
+ 'economy\n'
+ ' of space when reversing a large sequence. To remind users '
+ 'that it\n'
+ ' operates by side effect, it does not return the reversed '
+ 'sequence.\n'
'\n'
'5. "clear()" and "copy()" are included for consistency with the\n'
' interfaces of mutable containers that don’t support slicing\n'
@@ -13249,9 +13332,9 @@ topics = {'assert': 'The "assert" statement\n'
' * Using a pair of square brackets to denote the empty list: '
'"[]"\n'
'\n'
- ' * Using square brackets, separating items with commas: '
- '"[a]",\n'
- ' "[a, b, c]"\n'
+ ' * Using square brackets, separating items with commas: "[a]", '
+ '"[a,\n'
+ ' b, c]"\n'
'\n'
' * Using a list comprehension: "[x for x in iterable]"\n'
'\n'
@@ -13554,9 +13637,9 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'See also:\n'
'\n'
- ' * The linspace recipe shows how to implement a lazy version '
- 'of\n'
- ' range suitable for floating point applications.\n',
+ ' * The linspace recipe shows how to implement a lazy version of '
+ 'range\n'
+ ' suitable for floating point applications.\n',
'typesseq-mutable': 'Mutable Sequence Types\n'
'**********************\n'
'\n'
@@ -13667,19 +13750,18 @@ topics = {'assert': 'The "assert" statement\n'
'replacing.\n'
'\n'
'2. The optional argument *i* defaults to "-1", so that '
- 'by default\n'
- ' the last item is removed and returned.\n'
+ 'by default the\n'
+ ' last item is removed and returned.\n'
'\n'
'3. "remove()" raises "ValueError" when *x* is not found '
'in *s*.\n'
'\n'
'4. The "reverse()" method modifies the sequence in place '
- 'for\n'
- ' economy of space when reversing a large sequence. To '
- 'remind users\n'
- ' that it operates by side effect, it does not return '
- 'the reversed\n'
- ' sequence.\n'
+ 'for economy\n'
+ ' of space when reversing a large sequence. To remind '
+ 'users that it\n'
+ ' operates by side effect, it does not return the '
+ 'reversed sequence.\n'
'\n'
'5. "clear()" and "copy()" are included for consistency '
'with the\n'
@@ -13762,8 +13844,9 @@ topics = {'assert': 'The "assert" statement\n'
'The execution of the "with" statement with one “item” proceeds as\n'
'follows:\n'
'\n'
- '1. The context expression (the expression given in the "with_item")\n'
- ' is evaluated to obtain a context manager.\n'
+ '1. The context expression (the expression given in the "with_item") '
+ 'is\n'
+ ' evaluated to obtain a context manager.\n'
'\n'
'2. The context manager’s "__enter__()" is loaded for later use.\n'
'\n'
@@ -13771,12 +13854,15 @@ topics = {'assert': 'The "assert" statement\n'
'\n'
'4. The context manager’s "__enter__()" method is invoked.\n'
'\n'
- '5. If a target was included in the "with" statement, the return\n'
- ' value from "__enter__()" is assigned to it.\n'
+ '5. If a target was included in the "with" statement, the return '
+ 'value\n'
+ ' from "__enter__()" is assigned to it.\n'
+ '\n'
+ ' Note:\n'
'\n'
- ' Note: The "with" statement guarantees that if the "__enter__()"\n'
- ' method returns without an error, then "__exit__()" will always '
- 'be\n'
+ ' The "with" statement guarantees that if the "__enter__()" '
+ 'method\n'
+ ' returns without an error, then "__exit__()" will always be\n'
' called. Thus, if an error occurs during the assignment to the\n'
' target list, it will be treated the same as an error occurring\n'
' within the suite would be. See step 6 below.\n'
diff --git a/Lib/random.py b/Lib/random.py
index 3ea369b81b..139e8a40bb 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -48,7 +48,7 @@ General notes on the underlying Mersenne Twister core generator:
from warnings import warn as _warn
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin
-from math import tau as TWOPI, floor as _floor
+from math import tau as TWOPI, floor as _floor, isfinite as _isfinite
from os import urandom as _urandom
from _collections_abc import Set as _Set, Sequence as _Sequence
from itertools import accumulate as _accumulate, repeat as _repeat
@@ -492,6 +492,8 @@ class Random(_random.Random):
total = cum_weights[-1] + 0.0 # convert to float
if total <= 0.0:
raise ValueError('Total of weights must be greater than zero')
+ if not _isfinite(total):
+ raise ValueError('Total of weights must be finite')
bisect = _bisect
hi = n - 1
return [population[bisect(cum_weights, random() * total, 0, hi)]
diff --git a/Lib/sched.py b/Lib/sched.py
index ff87874a3a..14613cf298 100644
--- a/Lib/sched.py
+++ b/Lib/sched.py
@@ -26,23 +26,19 @@ has another way to reference private data (besides global variables).
import time
import heapq
from collections import namedtuple
+from itertools import count
import threading
from time import monotonic as _time
__all__ = ["scheduler"]
-class Event(namedtuple('Event', 'time, priority, action, argument, kwargs')):
- __slots__ = []
- def __eq__(s, o): return (s.time, s.priority) == (o.time, o.priority)
- def __lt__(s, o): return (s.time, s.priority) < (o.time, o.priority)
- def __le__(s, o): return (s.time, s.priority) <= (o.time, o.priority)
- def __gt__(s, o): return (s.time, s.priority) > (o.time, o.priority)
- def __ge__(s, o): return (s.time, s.priority) >= (o.time, o.priority)
-
+Event = namedtuple('Event', 'time, priority, sequence, action, argument, kwargs')
Event.time.__doc__ = ('''Numeric type compatible with the return value of the
timefunc function passed to the constructor.''')
Event.priority.__doc__ = ('''Events scheduled for the same time will be executed
in the order of their priority.''')
+Event.sequence.__doc__ = ('''A continually increasing sequence number that
+ separates events if time and priority are equal.''')
Event.action.__doc__ = ('''Executing the event means executing
action(*argument, **kwargs)''')
Event.argument.__doc__ = ('''argument is a sequence holding the positional
@@ -61,6 +57,7 @@ class scheduler:
self._lock = threading.RLock()
self.timefunc = timefunc
self.delayfunc = delayfunc
+ self._sequence_generator = count()
def enterabs(self, time, priority, action, argument=(), kwargs=_sentinel):
"""Enter a new event in the queue at an absolute time.
@@ -71,8 +68,10 @@ class scheduler:
"""
if kwargs is _sentinel:
kwargs = {}
- event = Event(time, priority, action, argument, kwargs)
+
with self._lock:
+ event = Event(time, priority, next(self._sequence_generator),
+ action, argument, kwargs)
heapq.heappush(self._queue, event)
return event # The ID
@@ -136,7 +135,8 @@ class scheduler:
with lock:
if not q:
break
- time, priority, action, argument, kwargs = q[0]
+ (time, priority, sequence, action,
+ argument, kwargs) = q[0]
now = timefunc()
if time > now:
delay = True
diff --git a/Lib/symtable.py b/Lib/symtable.py
index 9ff27ef74f..98db1e2557 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -39,7 +39,7 @@ class SymbolTableFactory:
_newSymbolTable = SymbolTableFactory()
-class SymbolTable(object):
+class SymbolTable:
def __init__(self, raw_table, filename):
self._table = raw_table
@@ -52,7 +52,7 @@ class SymbolTable(object):
else:
kind = "%s " % self.__class__.__name__
- if self._table.name == "global":
+ if self._table.name == "top":
return "<{0}SymbolTable for module {1}>".format(kind, self._filename)
else:
return "<{0}SymbolTable for {1} in {2}>".format(kind,
@@ -124,7 +124,9 @@ class SymbolTable(object):
if sym is None:
flags = self._table.symbols[name]
namespaces = self.__check_children(name)
- sym = self._symbols[name] = Symbol(name, flags, namespaces)
+ module_scope = (self._table.name == "top")
+ sym = self._symbols[name] = Symbol(name, flags, namespaces,
+ module_scope=module_scope)
return sym
def get_symbols(self):
@@ -214,13 +216,14 @@ class Class(SymbolTable):
return self.__methods
-class Symbol(object):
+class Symbol:
- def __init__(self, name, flags, namespaces=None):
+ def __init__(self, name, flags, namespaces=None, *, module_scope=False):
self.__name = name
self.__flags = flags
self.__scope = (flags >> SCOPE_OFF) & SCOPE_MASK # like PyST_GetScope()
self.__namespaces = namespaces or ()
+ self.__module_scope = module_scope
def __repr__(self):
return "<symbol {0!r}>".format(self.__name)
@@ -244,7 +247,8 @@ class Symbol(object):
def is_global(self):
"""Return *True* if the sysmbol is global.
"""
- return bool(self.__scope in (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT))
+ return bool(self.__scope in (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)
+ or (self.__module_scope and self.__flags & DEF_BOUND))
def is_nonlocal(self):
"""Return *True* if the symbol is nonlocal."""
@@ -258,7 +262,8 @@ class Symbol(object):
def is_local(self):
"""Return *True* if the symbol is local.
"""
- return bool(self.__scope in (LOCAL, CELL))
+ return bool(self.__scope in (LOCAL, CELL)
+ or (self.__module_scope and self.__flags & DEF_BOUND))
def is_annotated(self):
"""Return *True* if the symbol is annotated.
diff --git a/Lib/test/dataclass_module_1.py b/Lib/test/dataclass_module_1.py
index 87a33f8191..9f0aeda67f 100644
--- a/Lib/test/dataclass_module_1.py
+++ b/Lib/test/dataclass_module_1.py
@@ -1,9 +1,3 @@
-#from __future__ import annotations
-USING_STRINGS = False
-
-# dataclass_module_1.py and dataclass_module_1_str.py are identical
-# except only the latter uses string annotations.
-
import dataclasses
import typing
diff --git a/Lib/test/dataclass_module_1_str.py b/Lib/test/dataclass_module_1_str.py
deleted file mode 100644
index 6de490b7ad..0000000000
--- a/Lib/test/dataclass_module_1_str.py
+++ /dev/null
@@ -1,32 +0,0 @@
-from __future__ import annotations
-USING_STRINGS = True
-
-# dataclass_module_1.py and dataclass_module_1_str.py are identical
-# except only the latter uses string annotations.
-
-import dataclasses
-import typing
-
-T_CV2 = typing.ClassVar[int]
-T_CV3 = typing.ClassVar
-
-T_IV2 = dataclasses.InitVar[int]
-T_IV3 = dataclasses.InitVar
-
-@dataclasses.dataclass
-class CV:
- T_CV4 = typing.ClassVar
- cv0: typing.ClassVar[int] = 20
- cv1: typing.ClassVar = 30
- cv2: T_CV2
- cv3: T_CV3
- not_cv4: T_CV4 # When using string annotations, this field is not recognized as a ClassVar.
-
-@dataclasses.dataclass
-class IV:
- T_IV4 = dataclasses.InitVar
- iv0: dataclasses.InitVar[int]
- iv1: dataclasses.InitVar
- iv2: T_IV2
- iv3: T_IV3
- not_iv4: T_IV4 # When using string annotations, this field is not recognized as an InitVar.
diff --git a/Lib/test/dataclass_module_2.py b/Lib/test/dataclass_module_2.py
index 68fb733e29..8d120d181b 100644
--- a/Lib/test/dataclass_module_2.py
+++ b/Lib/test/dataclass_module_2.py
@@ -1,9 +1,3 @@
-#from __future__ import annotations
-USING_STRINGS = False
-
-# dataclass_module_2.py and dataclass_module_2_str.py are identical
-# except only the latter uses string annotations.
-
from dataclasses import dataclass, InitVar
from typing import ClassVar
diff --git a/Lib/test/dataclass_module_2_str.py b/Lib/test/dataclass_module_2_str.py
deleted file mode 100644
index b363d17c17..0000000000
--- a/Lib/test/dataclass_module_2_str.py
+++ /dev/null
@@ -1,32 +0,0 @@
-from __future__ import annotations
-USING_STRINGS = True
-
-# dataclass_module_2.py and dataclass_module_2_str.py are identical
-# except only the latter uses string annotations.
-
-from dataclasses import dataclass, InitVar
-from typing import ClassVar
-
-T_CV2 = ClassVar[int]
-T_CV3 = ClassVar
-
-T_IV2 = InitVar[int]
-T_IV3 = InitVar
-
-@dataclass
-class CV:
- T_CV4 = ClassVar
- cv0: ClassVar[int] = 20
- cv1: ClassVar = 30
- cv2: T_CV2
- cv3: T_CV3
- not_cv4: T_CV4 # When using string annotations, this field is not recognized as a ClassVar.
-
-@dataclass
-class IV:
- T_IV4 = InitVar
- iv0: InitVar[int]
- iv1: InitVar
- iv2: T_IV2
- iv3: T_IV3
- not_iv4: T_IV4 # When using string annotations, this field is not recognized as an InitVar.
diff --git a/Lib/test/dataclass_textanno.py b/Lib/test/dataclass_textanno.py
index 3eb6c943d4..589b60f0cd 100644
--- a/Lib/test/dataclass_textanno.py
+++ b/Lib/test/dataclass_textanno.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import dataclasses
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 8b61c26f9e..775d3151ae 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -1781,6 +1781,7 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
self.assertEqual(orig, derived)
+ self.assertTrue(isinstance(derived, SubclassDate))
def test_backdoor_resistance(self):
# For fast unpickling, the constructor accepts a pickle byte string.
@@ -2308,6 +2309,7 @@ class TestDateTime(TestDate):
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
self.assertEqual(orig, derived)
+ self.assertTrue(isinstance(derived, SubclassDatetime))
def test_compat_unpickle(self):
tests = [
@@ -3357,6 +3359,7 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase):
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
self.assertEqual(orig, derived)
+ self.assertTrue(isinstance(derived, SubclassTime))
def test_compat_unpickle(self):
tests = [
diff --git a/Lib/test/multibytecodec_support.py b/Lib/test/multibytecodec_support.py
index cca8af67d6..f76c0153f5 100644
--- a/Lib/test/multibytecodec_support.py
+++ b/Lib/test/multibytecodec_support.py
@@ -305,29 +305,23 @@ class TestBase_Mapping(unittest.TestCase):
self._test_mapping_file_plain()
def _test_mapping_file_plain(self):
- unichrs = lambda s: ''.join(map(chr, map(eval, s.split('+'))))
+ def unichrs(s):
+ return ''.join(chr(int(x, 16)) for x in s.split('+'))
+
urt_wa = {}
with self.open_mapping_file() as f:
for line in f:
if not line:
break
- data = line.split('#')[0].strip().split()
+ data = line.split('#')[0].split()
if len(data) != 2:
continue
- csetval = eval(data[0])
- if csetval <= 0x7F:
- csetch = bytes([csetval & 0xff])
- elif csetval >= 0x1000000:
- csetch = bytes([(csetval >> 24), ((csetval >> 16) & 0xff),
- ((csetval >> 8) & 0xff), (csetval & 0xff)])
- elif csetval >= 0x10000:
- csetch = bytes([(csetval >> 16), ((csetval >> 8) & 0xff),
- (csetval & 0xff)])
- elif csetval >= 0x100:
- csetch = bytes([(csetval >> 8), (csetval & 0xff)])
- else:
+ if data[0][:2] != '0x':
+ self.fail(f"Invalid line: {line!r}")
+ csetch = bytes.fromhex(data[0][2:])
+ if len(csetch) == 1 and 0x80 <= csetch[0]:
continue
unich = unichrs(data[1])
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
index 7e9c47b3ca..3d603e7734 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -488,6 +488,155 @@ def test_factory(abc_ABCMeta, abc_get_cache_token):
pass
self.assertEqual(C.__class__, abc_ABCMeta)
+ def test_update_del(self):
+ class A(metaclass=abc_ABCMeta):
+ @abc.abstractmethod
+ def foo(self):
+ pass
+
+ del A.foo
+ self.assertEqual(A.__abstractmethods__, {'foo'})
+ self.assertFalse(hasattr(A, 'foo'))
+
+ abc.update_abstractmethods(A)
+
+ self.assertEqual(A.__abstractmethods__, set())
+ A()
+
+
+ def test_update_new_abstractmethods(self):
+ class A(metaclass=abc_ABCMeta):
+ @abc.abstractmethod
+ def bar(self):
+ pass
+
+ @abc.abstractmethod
+ def updated_foo(self):
+ pass
+
+ A.foo = updated_foo
+ abc.update_abstractmethods(A)
+ self.assertEqual(A.__abstractmethods__, {'foo', 'bar'})
+ msg = "class A with abstract methods bar, foo"
+ self.assertRaisesRegex(TypeError, msg, A)
+
+ def test_update_implementation(self):
+ class A(metaclass=abc_ABCMeta):
+ @abc.abstractmethod
+ def foo(self):
+ pass
+
+ class B(A):
+ pass
+
+ msg = "class B with abstract method foo"
+ self.assertRaisesRegex(TypeError, msg, B)
+ self.assertEqual(B.__abstractmethods__, {'foo'})
+
+ B.foo = lambda self: None
+
+ abc.update_abstractmethods(B)
+
+ B()
+ self.assertEqual(B.__abstractmethods__, set())
+
+ def test_update_as_decorator(self):
+ class A(metaclass=abc_ABCMeta):
+ @abc.abstractmethod
+ def foo(self):
+ pass
+
+ def class_decorator(cls):
+ cls.foo = lambda self: None
+ return cls
+
+ @abc.update_abstractmethods
+ @class_decorator
+ class B(A):
+ pass
+
+ B()
+ self.assertEqual(B.__abstractmethods__, set())
+
+ def test_update_non_abc(self):
+ class A:
+ pass
+
+ @abc.abstractmethod
+ def updated_foo(self):
+ pass
+
+ A.foo = updated_foo
+ abc.update_abstractmethods(A)
+ A()
+ self.assertFalse(hasattr(A, '__abstractmethods__'))
+
+ def test_update_del_implementation(self):
+ class A(metaclass=abc_ABCMeta):
+ @abc.abstractmethod
+ def foo(self):
+ pass
+
+ class B(A):
+ def foo(self):
+ pass
+
+ B()
+
+ del B.foo
+
+ abc.update_abstractmethods(B)
+
+ msg = "class B with abstract method foo"
+ self.assertRaisesRegex(TypeError, msg, B)
+
+ def test_update_layered_implementation(self):
+ class A(metaclass=abc_ABCMeta):
+ @abc.abstractmethod
+ def foo(self):
+ pass
+
+ class B(A):
+ pass
+
+ class C(B):
+ def foo(self):
+ pass
+
+ C()
+
+ del C.foo
+
+ abc.update_abstractmethods(C)
+
+ msg = "class C with abstract method foo"
+ self.assertRaisesRegex(TypeError, msg, C)
+
+ def test_update_multi_inheritance(self):
+ class A(metaclass=abc_ABCMeta):
+ @abc.abstractmethod
+ def foo(self):
+ pass
+
+ class B(metaclass=abc_ABCMeta):
+ def foo(self):
+ pass
+
+ class C(B, A):
+ @abc.abstractmethod
+ def foo(self):
+ pass
+
+ self.assertEqual(C.__abstractmethods__, {'foo'})
+
+ del C.foo
+
+ abc.update_abstractmethods(C)
+
+ self.assertEqual(C.__abstractmethods__, set())
+
+ C()
+
class TestABCWithInitSubclass(unittest.TestCase):
def test_works_with_init_subclass(self):
diff --git a/Lib/test/test_annotations.py b/Lib/test/test_annotations.py
new file mode 100644
index 0000000000..3e6b709fb4
--- /dev/null
+++ b/Lib/test/test_annotations.py
@@ -0,0 +1,228 @@
+import unittest
+import sys
+from textwrap import dedent
+
+class PostponedAnnotationsTestCase(unittest.TestCase):
+ template = dedent(
+ """
+ def f() -> {ann}:
+ ...
+ def g(arg: {ann}) -> None:
+ ...
+ async def f2() -> {ann}:
+ ...
+ async def g2(arg: {ann}) -> None:
+ ...
+ var: {ann}
+ var2: {ann} = None
+ """
+ )
+
+ def getActual(self, annotation):
+ scope = {}
+ exec(self.template.format(ann=annotation), {}, scope)
+ func_ret_ann = scope['f'].__annotations__['return']
+ func_arg_ann = scope['g'].__annotations__['arg']
+ async_func_ret_ann = scope['f2'].__annotations__['return']
+ async_func_arg_ann = scope['g2'].__annotations__['arg']
+ var_ann1 = scope['__annotations__']['var']
+ var_ann2 = scope['__annotations__']['var2']
+ self.assertEqual(func_ret_ann, func_arg_ann)
+ self.assertEqual(func_ret_ann, async_func_ret_ann)
+ self.assertEqual(func_ret_ann, async_func_arg_ann)
+ self.assertEqual(func_ret_ann, var_ann1)
+ self.assertEqual(func_ret_ann, var_ann2)
+ return func_ret_ann
+
+ def assertAnnotationEqual(
+ self, annotation, expected=None, drop_parens=False, is_tuple=False,
+ ):
+ actual = self.getActual(annotation)
+ if expected is None:
+ expected = annotation if not is_tuple else annotation[1:-1]
+ if drop_parens:
+ self.assertNotEqual(actual, expected)
+ actual = actual.replace("(", "").replace(")", "")
+
+ self.assertEqual(actual, expected)
+
+ def test_annotations(self):
+ eq = self.assertAnnotationEqual
+ eq('...')
+ eq("'some_string'")
+ eq("u'some_string'")
+ eq("b'\\xa3'")
+ eq('Name')
+ eq('None')
+ eq('True')
+ eq('False')
+ eq('1')
+ eq('1.0')
+ eq('1j')
+ eq('True or False')
+ eq('True or False or None')
+ eq('True and False')
+ eq('True and False and None')
+ eq('Name1 and Name2 or Name3')
+ eq('Name1 and (Name2 or Name3)')
+ eq('Name1 or Name2 and Name3')
+ eq('(Name1 or Name2) and Name3')
+ eq('Name1 and Name2 or Name3 and Name4')
+ eq('Name1 or Name2 and Name3 or Name4')
+ eq('a + b + (c + d)')
+ eq('a * b * (c * d)')
+ eq('(a ** b) ** c ** d')
+ eq('v1 << 2')
+ eq('1 >> v2')
+ eq('1 % finished')
+ eq('1 + v2 - v3 * 4 ^ 5 ** v6 / 7 // 8')
+ eq('not great')
+ eq('not not great')
+ eq('~great')
+ eq('+value')
+ eq('++value')
+ eq('-1')
+ eq('~int and not v1 ^ 123 + v2 | True')
+ eq('a + (not b)')
+ eq('lambda: None')
+ eq('lambda arg: None')
+ eq('lambda a=True: a')
+ eq('lambda a, b, c=True: a')
+ eq("lambda a, b, c=True, *, d=1 << v2, e='str': a")
+ eq("lambda a, b, c=True, *vararg, d, e='str', **kwargs: a + b")
+ eq("lambda a, /, b, c=True, *vararg, d, e='str', **kwargs: a + b")
+ eq('lambda x, /: x')
+ eq('lambda x=1, /: x')
+ eq('lambda x, /, y: x + y')
+ eq('lambda x=1, /, y=2: x + y')
+ eq('lambda x, /, y=1: x + y')
+ eq('lambda x, /, y=1, *, z=3: x + y + z')
+ eq('lambda x=1, /, y=2, *, z=3: x + y + z')
+ eq('lambda x=1, /, y=2, *, z: x + y + z')
+ eq('lambda x=1, y=2, z=3, /, w=4, *, l, l2: x + y + z + w + l + l2')
+ eq('lambda x=1, y=2, z=3, /, w=4, *, l, l2, **kwargs: x + y + z + w + l + l2')
+ eq('lambda x, /, y=1, *, z: x + y + z')
+ eq('lambda x: lambda y: x + y')
+ eq('1 if True else 2')
+ eq('str or None if int or True else str or bytes or None')
+ eq('str or None if (1 if True else 2) else str or bytes or None')
+ eq("0 if not x else 1 if x > 0 else -1")
+ eq("(1 if x > 0 else -1) if x else 0")
+ eq("{'2.7': dead, '3.7': long_live or die_hard}")
+ eq("{'2.7': dead, '3.7': long_live or die_hard, **{'3.6': verygood}}")
+ eq("{**a, **b, **c}")
+ eq("{'2.7', '3.6', '3.7', '3.8', '3.9', '4.0' if gilectomy else '3.10'}")
+ eq("{*a, *b, *c}")
+ eq("({'a': 'b'}, True or False, +value, 'string', b'bytes') or None")
+ eq("()")
+ eq("(a,)")
+ eq("(a, b)")
+ eq("(a, b, c)")
+ eq("(*a, *b, *c)")
+ eq("[]")
+ eq("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or A, 11 or B, 12 or C]")
+ eq("[*a, *b, *c]")
+ eq("{i for i in (1, 2, 3)}")
+ eq("{i ** 2 for i in (1, 2, 3)}")
+ eq("{i ** 2 for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))}")
+ eq("{i ** 2 + j for i in (1, 2, 3) for j in (1, 2, 3)}")
+ eq("[i for i in (1, 2, 3)]")
+ eq("[i ** 2 for i in (1, 2, 3)]")
+ eq("[i ** 2 for i, _ in ((1, 'a'), (2, 'b'), (3, 'c'))]")
+ eq("[i ** 2 + j for i in (1, 2, 3) for j in (1, 2, 3)]")
+ eq("(i for i in (1, 2, 3))")
+ eq("(i ** 2 for i in (1, 2, 3))")
+ eq("(i ** 2 for i, _ in ((1, 'a'), (2, 'b'), (3, 'c')))")
+ eq("(i ** 2 + j for i in (1, 2, 3) for j in (1, 2, 3))")
+ eq("{i: 0 for i in (1, 2, 3)}")
+ eq("{i: j for i, j in ((1, 'a'), (2, 'b'), (3, 'c'))}")
+ eq("[(x, y) for x, y in (a, b)]")
+ eq("[(x,) for x, in (a,)]")
+ eq("Python3 > Python2 > COBOL")
+ eq("Life is Life")
+ eq("call()")
+ eq("call(arg)")
+ eq("call(kwarg='hey')")
+ eq("call(arg, kwarg='hey')")
+ eq("call(arg, *args, another, kwarg='hey')")
+ eq("call(arg, another, kwarg='hey', **kwargs, kwarg2='ho')")
+ eq("lukasz.langa.pl")
+ eq("call.me(maybe)")
+ eq("1 .real")
+ eq("1.0.real")
+ eq("....__class__")
+ eq("list[str]")
+ eq("dict[str, int]")
+ eq("set[str,]")
+ eq("tuple[str, ...]")
+ eq("tuple[(str, *types)]")
+ eq("tuple[str, int, (str, int)]")
+ eq("tuple[(*int, str, str, (str, int))]")
+ eq("tuple[str, int, float, dict[str, int]]")
+ eq("slice[0]")
+ eq("slice[0:1]")
+ eq("slice[0:1:2]")
+ eq("slice[:]")
+ eq("slice[:-1]")
+ eq("slice[1:]")
+ eq("slice[::-1]")
+ eq("slice[:,]")
+ eq("slice[1:2,]")
+ eq("slice[1:2:3,]")
+ eq("slice[1:2, 1]")
+ eq("slice[1:2, 2, 3]")
+ eq("slice[()]")
+ eq("slice[a, b:c, d:e:f]")
+ eq("slice[(x for x in a)]")
+ eq('str or None if sys.version_info[0] > (3,) else str or bytes or None')
+ eq("f'f-string without formatted values is just a string'")
+ eq("f'{{NOT a formatted value}}'")
+ eq("f'some f-string with {a} {few():.2f} {formatted.values!r}'")
+ eq('''f"{f'{nested} inner'} outer"''')
+ eq("f'space between opening braces: { {a for a in (1, 2, 3)}}'")
+ eq("f'{(lambda x: x)}'")
+ eq("f'{(None if a else lambda x: x)}'")
+ eq("f'{x}'")
+ eq("f'{x!r}'")
+ eq("f'{x!a}'")
+ eq('(yield from outside_of_generator)')
+ eq('(yield)')
+ eq('(yield a + b)')
+ eq('await some.complicated[0].call(with_args=True or 1 is not 1)')
+ eq('[x for x in (a if b else c)]')
+ eq('[x for x in a if (b if c else d)]')
+ eq('f(x for x in a)')
+ eq('f(1, (x for x in a))')
+ eq('f((x for x in a), 2)')
+ eq('(((a)))', 'a')
+ eq('(((a, b)))', '(a, b)')
+ eq("(x := 10)")
+ eq("f'{(x := 10):=10}'")
+ eq("1 + 2")
+ eq("1 + 2 + 3")
+
+ def test_fstring_debug_annotations(self):
+ # f-strings with '=' don't round trip very well, so set the expected
+ # result explicitely.
+ self.assertAnnotationEqual("f'{x=!r}'", expected="f'x={x!r}'")
+ self.assertAnnotationEqual("f'{x=:}'", expected="f'x={x:}'")
+ self.assertAnnotationEqual("f'{x=:.2f}'", expected="f'x={x:.2f}'")
+ self.assertAnnotationEqual("f'{x=!r}'", expected="f'x={x!r}'")
+ self.assertAnnotationEqual("f'{x=!a}'", expected="f'x={x!a}'")
+ self.assertAnnotationEqual("f'{x=!s:*^20}'", expected="f'x={x!s:*^20}'")
+
+ def test_infinity_numbers(self):
+ inf = "1e" + repr(sys.float_info.max_10_exp + 1)
+ infj = f"{inf}j"
+ self.assertAnnotationEqual("1e1000", expected=inf)
+ self.assertAnnotationEqual("1e1000j", expected=infj)
+ self.assertAnnotationEqual("-1e1000", expected=f"-{inf}")
+ self.assertAnnotationEqual("3+1e1000j", expected=f"3 + {infj}")
+ self.assertAnnotationEqual("(1e1000, 1e1000j)", expected=f"({inf}, {infj})")
+ self.assertAnnotationEqual("'inf'")
+ self.assertAnnotationEqual("('inf', 1e1000, 'infxxx', 1e1000j)", expected=f"('inf', {inf}, 'infxxx', {infj})")
+ self.assertAnnotationEqual("(1e1000, (1e1000j,))", expected=f"({inf}, ({infj},))")
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 5f57ce8724..be4b0f78ce 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -1005,6 +1005,12 @@ Module(
malformed = ast.Dict(keys=[ast.Constant(1)], values=[ast.Constant(2), ast.Constant(3)])
self.assertRaises(ValueError, ast.literal_eval, malformed)
+ def test_literal_eval_trailing_ws(self):
+ self.assertEqual(ast.literal_eval(" -1"), -1)
+ self.assertEqual(ast.literal_eval("\t\t-1"), -1)
+ self.assertEqual(ast.literal_eval(" \t -1"), -1)
+ self.assertRaises(IndentationError, ast.literal_eval, "\n -1")
+
def test_bad_integer(self):
# issue13436: Bad error message with invalid numeric values
body = [ast.ImportFrom(module='time',
diff --git a/Lib/test/test_charmapcodec.py b/Lib/test/test_charmapcodec.py
index 0d4594d8c0..3f628902a1 100644
--- a/Lib/test/test_charmapcodec.py
+++ b/Lib/test/test_charmapcodec.py
@@ -20,12 +20,15 @@ def codec_search_function(encoding):
return tuple(testcodec.getregentry())
return None
-codecs.register(codec_search_function)
-
# test codec's name (see test/testcodec.py)
codecname = 'testcodec'
class CharmapCodecTest(unittest.TestCase):
+
+ def setUp(self):
+ codecs.register(codec_search_function)
+ self.addCleanup(codecs.unregister, codec_search_function)
+
def test_constructorx(self):
self.assertEqual(str(b'abc', codecname), 'abc')
self.assertEqual(str(b'xdef', codecname), 'abcdef')
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index 3dd56820cd..328a47b2e3 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -1641,6 +1641,18 @@ class CodecsModuleTest(unittest.TestCase):
self.assertRaises(TypeError, codecs.register)
self.assertRaises(TypeError, codecs.register, 42)
+ def test_unregister(self):
+ name = "nonexistent_codec_name"
+ search_function = mock.Mock()
+ codecs.register(search_function)
+ self.assertRaises(TypeError, codecs.lookup, name)
+ search_function.assert_called_with(name)
+ search_function.reset_mock()
+
+ codecs.unregister(search_function)
+ self.assertRaises(LookupError, codecs.lookup, name)
+ search_function.assert_not_called()
+
def test_lookup(self):
self.assertRaises(TypeError, codecs.lookup)
self.assertRaises(LookupError, codecs.lookup, "__spam__")
@@ -2185,6 +2197,18 @@ class CharmapTest(unittest.TestCase):
("", len(allbytes))
)
+ self.assertRaisesRegex(TypeError,
+ "character mapping must be in range\\(0x110000\\)",
+ codecs.charmap_decode,
+ b"\x00\x01\x02", "strict", {0: "A", 1: 'Bb', 2: -2}
+ )
+
+ self.assertRaisesRegex(TypeError,
+ "character mapping must be in range\\(0x110000\\)",
+ codecs.charmap_decode,
+ b"\x00\x01\x02", "strict", {0: "A", 1: 'Bb', 2: 999999999}
+ )
+
def test_decode_with_int2int_map(self):
a = ord('a')
b = ord('b')
@@ -2742,29 +2766,14 @@ _TEST_CODECS = {}
def _get_test_codec(codec_name):
return _TEST_CODECS.get(codec_name)
-codecs.register(_get_test_codec) # Returns None, not usable as a decorator
-
-try:
- # Issue #22166: Also need to clear the internal cache in CPython
- from _codecs import _forget_codec
-except ImportError:
- def _forget_codec(codec_name):
- pass
class ExceptionChainingTest(unittest.TestCase):
def setUp(self):
- # There's no way to unregister a codec search function, so we just
- # ensure we render this one fairly harmless after the test
- # case finishes by using the test case repr as the codec name
- # The codecs module normalizes codec names, although this doesn't
- # appear to be formally documented...
- # We also make sure we use a truly unique id for the custom codec
- # to avoid issues with the codec cache when running these tests
- # multiple times (e.g. when hunting for refleaks)
- unique_id = repr(self) + str(id(self))
- self.codec_name = encodings.normalize_encoding(unique_id).lower()
+ self.codec_name = 'exception_chaining_test'
+ codecs.register(_get_test_codec)
+ self.addCleanup(codecs.unregister, _get_test_codec)
# We store the object to raise on the instance because of a bad
# interaction between the codec caching (which means we can't
@@ -2779,10 +2788,6 @@ class ExceptionChainingTest(unittest.TestCase):
_TEST_CODECS.pop(self.codec_name, None)
# Issue #22166: Also pop from caches to avoid appearance of ref leaks
encodings._cache.pop(self.codec_name, None)
- try:
- _forget_codec(self.codec_name)
- except KeyError:
- pass
def set_codec(self, encode, decode):
codec_info = codecs.CodecInfo(encode, decode,
@@ -3403,5 +3408,42 @@ class Rot13UtilTest(unittest.TestCase):
'To be, or not to be, that is the question')
+class CodecNameNormalizationTest(unittest.TestCase):
+ """Test codec name normalization"""
+ def test_codecs_lookup(self):
+ FOUND = (1, 2, 3, 4)
+ NOT_FOUND = (None, None, None, None)
+ def search_function(encoding):
+ if encoding == "aaa_8":
+ return FOUND
+ else:
+ return NOT_FOUND
+
+ codecs.register(search_function)
+ self.addCleanup(codecs.unregister, search_function)
+ self.assertEqual(FOUND, codecs.lookup('aaa_8'))
+ self.assertEqual(FOUND, codecs.lookup('AAA-8'))
+ self.assertEqual(FOUND, codecs.lookup('AAA---8'))
+ self.assertEqual(FOUND, codecs.lookup('AAA 8'))
+ self.assertEqual(FOUND, codecs.lookup('aaa\xe9\u20ac-8'))
+ self.assertEqual(NOT_FOUND, codecs.lookup('AAA.8'))
+ self.assertEqual(NOT_FOUND, codecs.lookup('AAA...8'))
+ self.assertEqual(NOT_FOUND, codecs.lookup('BBB-8'))
+ self.assertEqual(NOT_FOUND, codecs.lookup('BBB.8'))
+ self.assertEqual(NOT_FOUND, codecs.lookup('a\xe9\u20ac-8'))
+
+ def test_encodings_normalize_encoding(self):
+ # encodings.normalize_encoding() ignores non-ASCII characters.
+ normalize = encodings.normalize_encoding
+ self.assertEqual(normalize('utf_8'), 'utf_8')
+ self.assertEqual(normalize('utf\xE9\u20AC\U0010ffff-8'), 'utf_8')
+ self.assertEqual(normalize('utf 8'), 'utf_8')
+ # encodings.normalize_encoding() doesn't convert
+ # characters to lower case.
+ self.assertEqual(normalize('UTF 8'), 'UTF_8')
+ self.assertEqual(normalize('utf.8'), 'utf.8')
+ self.assertEqual(normalize('utf...8'), 'utf...8')
+
+
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py
index d1f241f7a6..af39ee878d 100644
--- a/Lib/test/test_complex.py
+++ b/Lib/test/test_complex.py
@@ -11,6 +11,14 @@ INF = float("inf")
NAN = float("nan")
# These tests ensure that complex math does the right thing
+ZERO_DIVISION = (
+ (1+1j, 0+0j),
+ (1+1j, 0.0),
+ (1+1j, 0),
+ (1.0, 0+0j),
+ (1, 0+0j),
+)
+
class ComplexTest(unittest.TestCase):
def assertAlmostEqual(self, a, b):
@@ -99,20 +107,34 @@ class ComplexTest(unittest.TestCase):
self.check_div(complex(random(), random()),
complex(random(), random()))
- self.assertRaises(ZeroDivisionError, complex.__truediv__, 1+1j, 0+0j)
- self.assertRaises(OverflowError, pow, 1e200+1j, 1e200+1j)
-
self.assertAlmostEqual(complex.__truediv__(2+0j, 1+1j), 1-1j)
- self.assertRaises(ZeroDivisionError, complex.__truediv__, 1+1j, 0+0j)
for denom_real, denom_imag in [(0, NAN), (NAN, 0), (NAN, NAN)]:
z = complex(0, 0) / complex(denom_real, denom_imag)
self.assertTrue(isnan(z.real))
self.assertTrue(isnan(z.imag))
+ def test_truediv_zero_division(self):
+ for a, b in ZERO_DIVISION:
+ with self.assertRaises(ZeroDivisionError):
+ a / b
+
def test_floordiv(self):
- self.assertRaises(TypeError, complex.__floordiv__, 3+0j, 1.5+0j)
- self.assertRaises(TypeError, complex.__floordiv__, 3+0j, 0+0j)
+ with self.assertRaises(TypeError):
+ (1+1j) // (1+0j)
+ with self.assertRaises(TypeError):
+ (1+1j) // 1.0
+ with self.assertRaises(TypeError):
+ (1+1j) // 1
+ with self.assertRaises(TypeError):
+ 1.0 // (1+0j)
+ with self.assertRaises(TypeError):
+ 1 // (1+0j)
+
+ def test_floordiv_zero_division(self):
+ for a, b in ZERO_DIVISION:
+ with self.assertRaises(TypeError):
+ a // b
def test_richcompare(self):
self.assertIs(complex.__eq__(1+1j, 1<<10000), False)
@@ -159,13 +181,32 @@ class ComplexTest(unittest.TestCase):
def test_mod(self):
# % is no longer supported on complex numbers
- self.assertRaises(TypeError, (1+1j).__mod__, 0+0j)
- self.assertRaises(TypeError, lambda: (3.33+4.43j) % 0)
- self.assertRaises(TypeError, (1+1j).__mod__, 4.3j)
+ with self.assertRaises(TypeError):
+ (1+1j) % (1+0j)
+ with self.assertRaises(TypeError):
+ (1+1j) % 1.0
+ with self.assertRaises(TypeError):
+ (1+1j) % 1
+ with self.assertRaises(TypeError):
+ 1.0 % (1+0j)
+ with self.assertRaises(TypeError):
+ 1 % (1+0j)
+
+ def test_mod_zero_division(self):
+ for a, b in ZERO_DIVISION:
+ with self.assertRaises(TypeError):
+ a % b
def test_divmod(self):
self.assertRaises(TypeError, divmod, 1+1j, 1+0j)
- self.assertRaises(TypeError, divmod, 1+1j, 0+0j)
+ self.assertRaises(TypeError, divmod, 1+1j, 1.0)
+ self.assertRaises(TypeError, divmod, 1+1j, 1)
+ self.assertRaises(TypeError, divmod, 1.0, 1+0j)
+ self.assertRaises(TypeError, divmod, 1, 1+0j)
+
+ def test_divmod_zero_division(self):
+ for a, b in ZERO_DIVISION:
+ self.assertRaises(TypeError, divmod, a, b)
def test_pow(self):
self.assertAlmostEqual(pow(1+1j, 0+0j), 1.0)
@@ -174,6 +215,7 @@ class ComplexTest(unittest.TestCase):
self.assertAlmostEqual(pow(1j, -1), 1/1j)
self.assertAlmostEqual(pow(1j, 200), 1)
self.assertRaises(ValueError, pow, 1+1j, 1+1j, 1+1j)
+ self.assertRaises(OverflowError, pow, 1e200+1j, 1e200+1j)
a = 3.33+4.43j
self.assertEqual(a ** 0j, 1)
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py
index 145adb6778..40c2eb8d23 100644
--- a/Lib/test/test_coroutines.py
+++ b/Lib/test/test_coroutines.py
@@ -91,10 +91,6 @@ class AsyncBadSyntaxTest(unittest.TestCase):
pass
""",
- """async def foo(a:await something()):
- pass
- """,
-
"""async def foo():
def bar():
[i async for i in els]
@@ -299,10 +295,6 @@ class AsyncBadSyntaxTest(unittest.TestCase):
pass
""",
- """async def foo(a:await b):
- pass
- """,
-
"""def baz():
async def foo(a=await b):
pass
diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py
index b20103bdce..7c1d9c568f 100644
--- a/Lib/test/test_dataclasses.py
+++ b/Lib/test/test_dataclasses.py
@@ -4,10 +4,12 @@
from dataclasses import *
+import abc
import pickle
import inspect
import builtins
import unittest
+from textwrap import dedent
from unittest.mock import Mock
from typing import ClassVar, Any, List, Union, Tuple, Dict, Generic, TypeVar, Optional
from typing import get_type_hints
@@ -561,17 +563,17 @@ class TestCase(unittest.TestCase):
self.assertEqual(len(the_fields), 3)
self.assertEqual(the_fields[0].name, 'x')
- self.assertEqual(the_fields[0].type, int)
+ self.assertEqual(the_fields[0].type, 'int')
self.assertFalse(hasattr(C, 'x'))
self.assertTrue (the_fields[0].init)
self.assertTrue (the_fields[0].repr)
self.assertEqual(the_fields[1].name, 'y')
- self.assertEqual(the_fields[1].type, str)
+ self.assertEqual(the_fields[1].type, 'str')
self.assertIsNone(getattr(C, 'y'))
self.assertFalse(the_fields[1].init)
self.assertTrue (the_fields[1].repr)
self.assertEqual(the_fields[2].name, 'z')
- self.assertEqual(the_fields[2].type, str)
+ self.assertEqual(the_fields[2].type, 'str')
self.assertFalse(hasattr(C, 'z'))
self.assertTrue (the_fields[2].init)
self.assertFalse(the_fields[2].repr)
@@ -757,11 +759,11 @@ class TestCase(unittest.TestCase):
def validate_class(cls):
# First, check __annotations__, even though they're not
# function annotations.
- self.assertEqual(cls.__annotations__['i'], int)
- self.assertEqual(cls.__annotations__['j'], str)
- self.assertEqual(cls.__annotations__['k'], F)
- self.assertEqual(cls.__annotations__['l'], float)
- self.assertEqual(cls.__annotations__['z'], complex)
+ self.assertEqual(cls.__annotations__['i'], 'int')
+ self.assertEqual(cls.__annotations__['j'], 'str')
+ self.assertEqual(cls.__annotations__['k'], 'F')
+ self.assertEqual(cls.__annotations__['l'], 'float')
+ self.assertEqual(cls.__annotations__['z'], 'complex')
# Verify __init__.
@@ -776,22 +778,22 @@ class TestCase(unittest.TestCase):
self.assertEqual(param.name, 'self')
param = next(params)
self.assertEqual(param.name, 'i')
- self.assertIs (param.annotation, int)
+ self.assertIs (param.annotation, 'int')
self.assertEqual(param.default, inspect.Parameter.empty)
self.assertEqual(param.kind, inspect.Parameter.POSITIONAL_OR_KEYWORD)
param = next(params)
self.assertEqual(param.name, 'j')
- self.assertIs (param.annotation, str)
+ self.assertIs (param.annotation, 'str')
self.assertEqual(param.default, inspect.Parameter.empty)
self.assertEqual(param.kind, inspect.Parameter.POSITIONAL_OR_KEYWORD)
param = next(params)
self.assertEqual(param.name, 'k')
- self.assertIs (param.annotation, F)
+ self.assertIs (param.annotation, 'F')
# Don't test for the default, since it's set to MISSING.
self.assertEqual(param.kind, inspect.Parameter.POSITIONAL_OR_KEYWORD)
param = next(params)
self.assertEqual(param.name, 'l')
- self.assertIs (param.annotation, float)
+ self.assertIs (param.annotation, 'float')
# Don't test for the default, since it's set to MISSING.
self.assertEqual(param.kind, inspect.Parameter.POSITIONAL_OR_KEYWORD)
self.assertRaises(StopIteration, next, params)
@@ -2805,13 +2807,10 @@ class TestDescriptors(unittest.TestCase):
class TestStringAnnotations(unittest.TestCase):
def test_classvar(self):
- # Some expressions recognized as ClassVar really aren't. But
- # if you're using string annotations, it's not an exact
- # science.
# These tests assume that both "import typing" and "from
# typing import *" have been run in this file.
for typestr in ('ClassVar[int]',
- 'ClassVar [int]'
+ 'ClassVar [int]',
' ClassVar [int]',
'ClassVar',
' ClassVar ',
@@ -2822,17 +2821,15 @@ class TestStringAnnotations(unittest.TestCase):
'typing. ClassVar[str]',
'typing.ClassVar [str]',
'typing.ClassVar [ str]',
-
+ # Double stringified
+ '"typing.ClassVar[int]"',
# Not syntactically valid, but these will
- # be treated as ClassVars.
+ # be treated as ClassVars.
'typing.ClassVar.[int]',
'typing.ClassVar+',
):
with self.subTest(typestr=typestr):
- @dataclass
- class C:
- x: typestr
-
+ C = dataclass(type("C", (), {"__annotations__": {"x": typestr}}))
# x is a ClassVar, so C() takes no args.
C()
@@ -2853,9 +2850,7 @@ class TestStringAnnotations(unittest.TestCase):
'typingxClassVar[str]',
):
with self.subTest(typestr=typestr):
- @dataclass
- class C:
- x: typestr
+ C = dataclass(type("C", (), {"__annotations__": {"x": typestr}}))
# x is not a ClassVar, so C() takes one arg.
self.assertEqual(C(10).x, 10)
@@ -2875,16 +2870,16 @@ class TestStringAnnotations(unittest.TestCase):
'dataclasses. InitVar[str]',
'dataclasses.InitVar [str]',
'dataclasses.InitVar [ str]',
-
+ # Double stringified
+ '"dataclasses.InitVar[int]"',
# Not syntactically valid, but these will
# be treated as InitVars.
'dataclasses.InitVar.[int]',
'dataclasses.InitVar+',
):
with self.subTest(typestr=typestr):
- @dataclass
- class C:
- x: typestr
+ C = dataclass(type("C", (), {"__annotations__": {"x": typestr}}))
+
# x is an InitVar, so doesn't create a member.
with self.assertRaisesRegex(AttributeError,
@@ -2898,30 +2893,22 @@ class TestStringAnnotations(unittest.TestCase):
'typing.xInitVar[int]',
):
with self.subTest(typestr=typestr):
- @dataclass
- class C:
- x: typestr
+ C = dataclass(type("C", (), {"__annotations__": {"x": typestr}}))
# x is not an InitVar, so there will be a member x.
self.assertEqual(C(10).x, 10)
def test_classvar_module_level_import(self):
from test import dataclass_module_1
- from test import dataclass_module_1_str
from test import dataclass_module_2
- from test import dataclass_module_2_str
- for m in (dataclass_module_1, dataclass_module_1_str,
- dataclass_module_2, dataclass_module_2_str,
- ):
+ for m in (dataclass_module_1,
+ dataclass_module_2):
with self.subTest(m=m):
# There's a difference in how the ClassVars are
# interpreted when using string annotations or
# not. See the imported modules for details.
- if m.USING_STRINGS:
- c = m.CV(10)
- else:
- c = m.CV()
+ c = m.CV(10)
self.assertEqual(c.cv0, 20)
@@ -2937,14 +2924,9 @@ class TestStringAnnotations(unittest.TestCase):
# not an instance field.
getattr(c, field_name)
- if m.USING_STRINGS:
- # iv4 is interpreted as a normal field.
- self.assertIn('not_iv4', c.__dict__)
- self.assertEqual(c.not_iv4, 4)
- else:
- # iv4 is interpreted as an InitVar, so it
- # won't exist on the instance.
- self.assertNotIn('not_iv4', c.__dict__)
+ # iv4 is interpreted as a normal field.
+ self.assertIn('not_iv4', c.__dict__)
+ self.assertEqual(c.not_iv4, 4)
def test_text_annotations(self):
from test import dataclass_textanno
@@ -3332,6 +3314,42 @@ class TestReplace(unittest.TestCase):
## replace(c, x=5)
+class TestAbstract(unittest.TestCase):
+ def test_abc_implementation(self):
+ class Ordered(abc.ABC):
+ @abc.abstractmethod
+ def __lt__(self, other):
+ pass
+
+ @abc.abstractmethod
+ def __le__(self, other):
+ pass
+
+ @dataclass(order=True)
+ class Date(Ordered):
+ year: int
+ month: 'Month'
+ day: 'int'
+
+ self.assertFalse(inspect.isabstract(Date))
+ self.assertGreater(Date(2020,12,25), Date(2020,8,31))
+
+ def test_maintain_abc(self):
+ class A(abc.ABC):
+ @abc.abstractmethod
+ def foo(self):
+ pass
+
+ @dataclass
+ class Date(A):
+ year: int
+ month: 'Month'
+ day: 'int'
+
+ self.assertTrue(inspect.isabstract(Date))
+ msg = 'class Date with abstract method foo'
+ self.assertRaisesRegex(TypeError, msg, Date)
+
if __name__ == '__main__':
unittest.main()
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index 4533a016a2..bbaddd57d2 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -227,28 +227,26 @@ dis_annot_stmt_str = """\
2 0 SETUP_ANNOTATIONS
2 LOAD_CONST 0 (1)
4 STORE_NAME 0 (x)
- 6 LOAD_NAME 1 (int)
- 8 LOAD_NAME 2 (__annotations__)
- 10 LOAD_CONST 1 ('x')
+ 6 LOAD_CONST 1 ('int')
+ 8 LOAD_NAME 1 (__annotations__)
+ 10 LOAD_CONST 2 ('x')
12 STORE_SUBSCR
- 3 14 LOAD_NAME 3 (fun)
- 16 LOAD_CONST 0 (1)
- 18 CALL_FUNCTION 1
- 20 LOAD_NAME 2 (__annotations__)
- 22 LOAD_CONST 2 ('y')
- 24 STORE_SUBSCR
-
- 4 26 LOAD_CONST 0 (1)
- 28 LOAD_NAME 4 (lst)
- 30 LOAD_NAME 3 (fun)
- 32 LOAD_CONST 3 (0)
- 34 CALL_FUNCTION 1
- 36 STORE_SUBSCR
- 38 LOAD_NAME 1 (int)
- 40 POP_TOP
- 42 LOAD_CONST 4 (None)
- 44 RETURN_VALUE
+ 3 14 LOAD_CONST 3 ('fun(1)')
+ 16 LOAD_NAME 1 (__annotations__)
+ 18 LOAD_CONST 4 ('y')
+ 20 STORE_SUBSCR
+
+ 4 22 LOAD_CONST 0 (1)
+ 24 LOAD_NAME 2 (lst)
+ 26 LOAD_NAME 3 (fun)
+ 28 LOAD_CONST 5 (0)
+ 30 CALL_FUNCTION 1
+ 32 STORE_SUBSCR
+ 34 LOAD_NAME 4 (int)
+ 36 POP_TOP
+ 38 LOAD_CONST 6 (None)
+ 40 RETURN_VALUE
"""
compound_stmt_str = """\
diff --git a/Lib/test/test_finalization.py b/Lib/test/test_finalization.py
index 35d7913e5b..1d13443090 100644
--- a/Lib/test/test_finalization.py
+++ b/Lib/test/test_finalization.py
@@ -16,6 +16,15 @@ except ImportError:
raise TypeError('requires _testcapi.with_tp_del')
return C
+try:
+ from _testcapi import without_gc
+except ImportError:
+ def without_gc(cls):
+ class C:
+ def __new__(cls, *args, **kwargs):
+ raise TypeError('requires _testcapi.without_gc')
+ return C
+
from test import support
@@ -94,9 +103,11 @@ class SimpleBase(NonGCSimpleBase):
assert self.id_ == id(self)
+@without_gc
class NonGC(NonGCSimpleBase):
__slots__ = ()
+@without_gc
class NonGCResurrector(NonGCSimpleBase):
__slots__ = ()
@@ -109,8 +120,14 @@ class NonGCResurrector(NonGCSimpleBase):
class Simple(SimpleBase):
pass
-class SimpleResurrector(NonGCResurrector, SimpleBase):
- pass
+# Can't inherit from NonGCResurrector, in case importing without_gc fails.
+class SimpleResurrector(SimpleBase):
+
+ def side_effect(self):
+ """
+ Resurrect self by storing self in a class-wide list.
+ """
+ self.survivors.append(self)
class TestBase:
@@ -178,6 +195,7 @@ class SimpleFinalizationTest(TestBase, unittest.TestCase):
self.assert_survivors([])
self.assertIs(wr(), None)
+ @support.cpython_only
def test_non_gc(self):
with SimpleBase.test():
s = NonGC()
@@ -191,6 +209,7 @@ class SimpleFinalizationTest(TestBase, unittest.TestCase):
self.assert_del_calls(ids)
self.assert_survivors([])
+ @support.cpython_only
def test_non_gc_resurrect(self):
with SimpleBase.test():
s = NonGCResurrector()
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index 9651281e24..99c81f0b72 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -64,6 +64,9 @@ class GeneralFloatCases(unittest.TestCase):
# See bpo-34087
self.assertRaises(ValueError, float, '\u3053\u3093\u306b\u3061\u306f')
+ def test_noargs(self):
+ self.assertEqual(float(), 0.0)
+
def test_underscores(self):
for lit in VALID_UNDERSCORE_LITERALS:
if not any(ch in lit for ch in 'jJxXoObB'):
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index edd5773e13..bee9f9112b 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -618,7 +618,7 @@ class TestUpdateWrapper(unittest.TestCase):
def _default_update(self):
- def f(a:'This is a new annotation'):
+ def f(a: int):
"""This is a test"""
pass
f.attr = 'This is also a test'
@@ -635,7 +635,7 @@ class TestUpdateWrapper(unittest.TestCase):
self.assertEqual(wrapper.__name__, 'f')
self.assertEqual(wrapper.__qualname__, f.__qualname__)
self.assertEqual(wrapper.attr, 'This is also a test')
- self.assertEqual(wrapper.__annotations__['a'], 'This is a new annotation')
+ self.assertEqual(wrapper.__annotations__['a'], 'int')
self.assertNotIn('b', wrapper.__annotations__)
@unittest.skipIf(sys.flags.optimize >= 2,
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index 1b096efdbc..ba66737015 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -582,9 +582,9 @@ class GCTests(unittest.TestCase):
self.assertTrue(gc.is_tracked(UserInt()))
self.assertTrue(gc.is_tracked([]))
self.assertTrue(gc.is_tracked(set()))
- self.assertFalse(gc.is_tracked(UserClassSlots()))
- self.assertFalse(gc.is_tracked(UserFloatSlots()))
- self.assertFalse(gc.is_tracked(UserIntSlots()))
+ self.assertTrue(gc.is_tracked(UserClassSlots()))
+ self.assertTrue(gc.is_tracked(UserFloatSlots()))
+ self.assertTrue(gc.is_tracked(UserIntSlots()))
def test_is_finalized(self):
# Objects not tracked by the always gc return false
diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py
index 643fffc073..2979cfb550 100644
--- a/Lib/test/test_genericalias.py
+++ b/Lib/test/test_genericalias.py
@@ -29,7 +29,7 @@ try:
except ImportError:
# multiprocessing.shared_memory is not available on e.g. Android
ShareableList = None
-from multiprocessing.queues import SimpleQueue
+from multiprocessing.queues import SimpleQueue as MPSimpleQueue
from os import DirEntry
from re import Pattern, Match
from types import GenericAlias, MappingProxyType, AsyncGeneratorType
@@ -81,7 +81,7 @@ class BaseTest(unittest.TestCase):
SplitResult, ParseResult,
ValueProxy, ApplyResult,
WeakSet, ReferenceType, ref,
- ShareableList, SimpleQueue,
+ ShareableList, MPSimpleQueue,
Future, _WorkItem,
Morsel]
if ctypes is not None:
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 5235fa2c78..2f6716dfc9 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -362,7 +362,7 @@ class GrammarTests(unittest.TestCase):
z = 2
def __init__(self, x):
self.x: int = x
- self.assertEqual(C.__annotations__, {'_C__foo': int, 's': str})
+ self.assertEqual(C.__annotations__, {'_C__foo': 'int', 's': 'str'})
with self.assertRaises(NameError):
class CBad:
no_such_name_defined.attr: int = 0
@@ -378,15 +378,15 @@ class GrammarTests(unittest.TestCase):
return {'__annotations__': CNS()}
class CC(metaclass=CMeta):
XX: 'ANNOT'
- self.assertEqual(CC.__annotations__['xx'], 'ANNOT')
+ self.assertEqual(CC.__annotations__['xx'], repr('ANNOT'))
def test_var_annot_module_semantics(self):
with self.assertRaises(AttributeError):
print(test.__annotations__)
self.assertEqual(ann_module.__annotations__,
- {1: 2, 'x': int, 'y': str, 'f': typing.Tuple[int, int]})
+ {1: 2, 'x': 'int', 'y': 'str', 'f': 'Tuple[int, int]'})
self.assertEqual(ann_module.M.__annotations__,
- {'123': 123, 'o': type})
+ {'123': 123, 'o': 'type'})
self.assertEqual(ann_module2.__annotations__, {})
def test_var_annot_in_module(self):
@@ -405,7 +405,7 @@ class GrammarTests(unittest.TestCase):
exec("'docstring'\n"
"__annotations__[1] = 2\n"
"x: int = 5\n", gns, lns)
- self.assertEqual(lns["__annotations__"], {1: 2, 'x': int})
+ self.assertEqual(lns["__annotations__"], {1: 2, 'x': 'int'})
with self.assertRaises(KeyError):
gns['__annotations__']
@@ -413,8 +413,8 @@ class GrammarTests(unittest.TestCase):
# tests with custom locals() and __annotations__
ns = {'__annotations__': CNS()}
exec('X: int; Z: str = "Z"; (w): complex = 1j', ns)
- self.assertEqual(ns['__annotations__']['x'], int)
- self.assertEqual(ns['__annotations__']['z'], str)
+ self.assertEqual(ns['__annotations__']['x'], 'int')
+ self.assertEqual(ns['__annotations__']['z'], 'str')
with self.assertRaises(KeyError):
ns['__annotations__']['w']
nonloc_ns = {}
@@ -428,7 +428,7 @@ class GrammarTests(unittest.TestCase):
def __getitem__(self, item):
return self._dct[item]
exec('x: int = 1', {}, CNS2())
- self.assertEqual(nonloc_ns['__annotations__']['x'], int)
+ self.assertEqual(nonloc_ns['__annotations__']['x'], 'int')
def test_var_annot_refleak(self):
# complex case: custom locals plus custom __annotations__
@@ -445,7 +445,7 @@ class GrammarTests(unittest.TestCase):
def __getitem__(self, item):
return self._dct[item]
exec('X: str', {}, CNS2())
- self.assertEqual(nonloc_ns['__annotations__']['x'], str)
+ self.assertEqual(nonloc_ns['__annotations__']['x'], 'str')
def test_var_annot_rhs(self):
ns = {}
@@ -625,50 +625,46 @@ class GrammarTests(unittest.TestCase):
# argument annotation tests
def f(x) -> list: pass
- self.assertEqual(f.__annotations__, {'return': list})
+ self.assertEqual(f.__annotations__, {'return': 'list'})
def f(x: int): pass
- self.assertEqual(f.__annotations__, {'x': int})
+ self.assertEqual(f.__annotations__, {'x': 'int'})
def f(x: int, /): pass
- self.assertEqual(f.__annotations__, {'x': int})
+ self.assertEqual(f.__annotations__, {'x': 'int'})
def f(x: int = 34, /): pass
- self.assertEqual(f.__annotations__, {'x': int})
+ self.assertEqual(f.__annotations__, {'x': 'int'})
def f(*x: str): pass
- self.assertEqual(f.__annotations__, {'x': str})
+ self.assertEqual(f.__annotations__, {'x': 'str'})
def f(**x: float): pass
- self.assertEqual(f.__annotations__, {'x': float})
- def f(x, y: 1+2): pass
- self.assertEqual(f.__annotations__, {'y': 3})
- def f(x, y: 1+2, /): pass
- self.assertEqual(f.__annotations__, {'y': 3})
+ self.assertEqual(f.__annotations__, {'x': 'float'})
def f(a, b: 1, c: 2, d): pass
- self.assertEqual(f.__annotations__, {'b': 1, 'c': 2})
+ self.assertEqual(f.__annotations__, {'b': '1', 'c': '2'})
def f(a, b: 1, /, c: 2, d): pass
- self.assertEqual(f.__annotations__, {'b': 1, 'c': 2})
+ self.assertEqual(f.__annotations__, {'b': '1', 'c': '2'})
def f(a, b: 1, c: 2, d, e: 3 = 4, f=5, *g: 6): pass
self.assertEqual(f.__annotations__,
- {'b': 1, 'c': 2, 'e': 3, 'g': 6})
+ {'b': '1', 'c': '2', 'e': '3', 'g': '6'})
def f(a, b: 1, c: 2, d, e: 3 = 4, f=5, *g: 6, h: 7, i=8, j: 9 = 10,
**k: 11) -> 12: pass
self.assertEqual(f.__annotations__,
- {'b': 1, 'c': 2, 'e': 3, 'g': 6, 'h': 7, 'j': 9,
- 'k': 11, 'return': 12})
+ {'b': '1', 'c': '2', 'e': '3', 'g': '6', 'h': '7', 'j': '9',
+ 'k': '11', 'return': '12'})
def f(a, b: 1, c: 2, d, e: 3 = 4, f: int = 5, /, *g: 6, h: 7, i=8, j: 9 = 10,
**k: 11) -> 12: pass
self.assertEqual(f.__annotations__,
- {'b': 1, 'c': 2, 'e': 3, 'f': int, 'g': 6, 'h': 7, 'j': 9,
- 'k': 11, 'return': 12})
+ {'b': '1', 'c': '2', 'e': '3', 'f': 'int', 'g': '6', 'h': '7', 'j': '9',
+ 'k': '11', 'return': '12'})
# Check for issue #20625 -- annotations mangling
class Spam:
def f(self, *, __kw: 1):
pass
class Ham(Spam): pass
- self.assertEqual(Spam.f.__annotations__, {'_Spam__kw': 1})
- self.assertEqual(Ham.f.__annotations__, {'_Spam__kw': 1})
+ self.assertEqual(Spam.f.__annotations__, {'_Spam__kw': '1'})
+ self.assertEqual(Ham.f.__annotations__, {'_Spam__kw': '1'})
# Check for SF Bug #1697248 - mixing decorators and a return annotation
def null(x): return x
@null
def f(x) -> list: pass
- self.assertEqual(f.__annotations__, {'return': list})
+ self.assertEqual(f.__annotations__, {'return': 'list'})
# Test expressions as decorators (PEP 614):
@False or null
@@ -1116,8 +1112,6 @@ class GrammarTests(unittest.TestCase):
# Not allowed at class scope
check_syntax_error(self, "class foo:yield 1")
check_syntax_error(self, "class foo:yield from ()")
- # Check annotation refleak on SyntaxError
- check_syntax_error(self, "def g(a:(yield)): pass")
def test_yield_in_comprehensions(self):
# Check yield in comprehensions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 6667dc91ed..71c4f27d27 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -862,7 +862,7 @@ class TestClassesAndFunctions(unittest.TestCase):
self.assertFullArgSpecEquals(mod2.annotated, ['arg1'],
ann_e={'arg1' : list},
- formatted='(arg1: list)')
+ formatted="(arg1: list)")
self.assertFullArgSpecEquals(mod2.keyword_only_arg, [],
kwonlyargs_e=['arg'],
formatted='(*, arg)')
@@ -2211,8 +2211,8 @@ class TestSignatureObject(unittest.TestCase):
pass
self.assertEqual(self.signature(test),
((('a', ..., ..., "positional_or_keyword"),
- ('b', ..., 'foo', "positional_or_keyword")),
- 123))
+ ('b', ..., repr('foo'), "positional_or_keyword")),
+ '123'))
def test_signature_on_wkwonly(self):
def test(*, a:float, b:str) -> int:
@@ -2227,11 +2227,11 @@ class TestSignatureObject(unittest.TestCase):
pass
self.assertEqual(self.signature(test),
((('a', ..., ..., "positional_or_keyword"),
- ('b', 10, 'foo', "positional_or_keyword"),
- ('args', ..., 'bar', "var_positional"),
- ('spam', ..., 'baz', "keyword_only"),
+ ('b', 10, repr('foo'), "positional_or_keyword"),
+ ('args', ..., repr('bar'), "var_positional"),
+ ('spam', ..., repr('baz'), "keyword_only"),
('ham', 123, ..., "keyword_only"),
- ('kwargs', ..., int, "var_keyword")),
+ ('kwargs', ..., 'int', "var_keyword")),
...))
def test_signature_without_self(self):
@@ -2640,12 +2640,12 @@ class TestSignatureObject(unittest.TestCase):
self.assertEqual(self.signature(partial(partial(test, 1))),
((('b', ..., ..., "positional_or_keyword"),
- ('c', ..., int, "positional_or_keyword")),
- 42))
+ ('c', ..., 'int', "positional_or_keyword")),
+ '42'))
self.assertEqual(self.signature(partial(partial(test, 1), 2)),
- ((('c', ..., int, "positional_or_keyword"),),
- 42))
+ ((('c', ..., 'int', "positional_or_keyword"),),
+ '42'))
psig = inspect.signature(partial(partial(test, 1), 2))
@@ -2764,12 +2764,12 @@ class TestSignatureObject(unittest.TestCase):
((('it', ..., ..., 'positional_or_keyword'),
('a', ..., ..., 'positional_or_keyword'),
('c', 1, ..., 'keyword_only')),
- 'spam'))
+ repr('spam')))
self.assertEqual(self.signature(Spam().ham),
((('a', ..., ..., 'positional_or_keyword'),
('c', 1, ..., 'keyword_only')),
- 'spam'))
+ repr('spam')))
class Spam:
def test(self: 'anno', x):
@@ -2778,7 +2778,7 @@ class TestSignatureObject(unittest.TestCase):
g = partialmethod(test, 1)
self.assertEqual(self.signature(Spam.g),
- ((('self', ..., 'anno', 'positional_or_keyword'),),
+ ((('self', ..., repr('anno'), 'positional_or_keyword'),),
...))
def test_signature_on_fake_partialmethod(self):
@@ -3116,20 +3116,16 @@ class TestSignatureObject(unittest.TestCase):
with self.assertRaisesRegex(TypeError, 'unhashable type'):
hash(inspect.signature(foo))
- def foo(a) -> {}: pass
- with self.assertRaisesRegex(TypeError, 'unhashable type'):
- hash(inspect.signature(foo))
-
def test_signature_str(self):
def foo(a:int=1, *, b, c=None, **kwargs) -> 42:
pass
self.assertEqual(str(inspect.signature(foo)),
- '(a: int = 1, *, b, c=None, **kwargs) -> 42')
+ '(a: \'int\' = 1, *, b, c=None, **kwargs) -> \'42\'')
def foo(a:int=1, *args, b, c=None, **kwargs) -> 42:
pass
self.assertEqual(str(inspect.signature(foo)),
- '(a: int = 1, *args, b, c=None, **kwargs) -> 42')
+ '(a: \'int\' = 1, *args, b, c=None, **kwargs) -> \'42\'')
def foo():
pass
@@ -3172,8 +3168,8 @@ class TestSignatureObject(unittest.TestCase):
self.assertIs(sig.return_annotation, None)
sig = sig.replace(return_annotation=sig.empty)
self.assertIs(sig.return_annotation, sig.empty)
- sig = sig.replace(return_annotation=42)
- self.assertEqual(sig.return_annotation, 42)
+ sig = sig.replace(return_annotation='42')
+ self.assertEqual(sig.return_annotation, '42')
self.assertEqual(sig, inspect.signature(test))
def test_signature_on_mangled_parameters(self):
@@ -3185,8 +3181,8 @@ class TestSignatureObject(unittest.TestCase):
self.assertEqual(self.signature(Spam.foo),
((('self', ..., ..., "positional_or_keyword"),
- ('_Spam__p1', 2, 1, "positional_or_keyword"),
- ('_Spam__p2', 3, 2, "keyword_only")),
+ ('_Spam__p1', 2, '1', "positional_or_keyword"),
+ ('_Spam__p2', 3, '2', "keyword_only")),
...))
self.assertEqual(self.signature(Spam.foo),
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 85fac30e30..fbaea3aaec 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -2529,10 +2529,6 @@ class StatefulIncrementalDecoder(codecs.IncrementalDecoder):
streamreader=None, streamwriter=None,
incrementaldecoder=cls)
-# Register the previous decoder for testing.
-# Disabled by default, tests will enable it.
-codecs.register(StatefulIncrementalDecoder.lookupTestDecoder)
-
class StatefulIncrementalDecoderTest(unittest.TestCase):
"""
@@ -2583,6 +2579,9 @@ class TextIOWrapperTest(unittest.TestCase):
self.testdata = b"AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n"
self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ascii")
os_helper.unlink(os_helper.TESTFN)
+ codecs.register(StatefulIncrementalDecoder.lookupTestDecoder)
+ self.addCleanup(codecs.unregister,
+ StatefulIncrementalDecoder.lookupTestDecoder)
def tearDown(self):
os_helper.unlink(os_helper.TESTFN)
diff --git a/Lib/test/test_isinstance.py b/Lib/test/test_isinstance.py
index 91e79c2954..109c3f84a5 100644
--- a/Lib/test/test_isinstance.py
+++ b/Lib/test/test_isinstance.py
@@ -303,6 +303,16 @@ class TestIsInstanceIsSubclass(unittest.TestCase):
self.assertEqual(True, issubclass(B(), int))
+ def test_infinite_recursion_in_bases(self):
+ class X:
+ @property
+ def __bases__(self):
+ return self.__bases__
+
+ self.assertRaises(RecursionError, issubclass, X(), int)
+ self.assertRaises(RecursionError, issubclass, int, X())
+ self.assertRaises(RecursionError, isinstance, 1, X())
+
def blowstack(fxn, arg, compare_to):
# Make sure that calling isinstance with a deeply nested tuple for its
diff --git a/Lib/test/test_lib2to3.py b/Lib/test/test_lib2to3.py
index 159a8387e4..fd12a7e7ac 100644
--- a/Lib/test/test_lib2to3.py
+++ b/Lib/test/test_lib2to3.py
@@ -1,8 +1,9 @@
import unittest
+from test.support.import_helper import import_fresh_module
from test.support.warnings_helper import check_warnings
with check_warnings(("", PendingDeprecationWarning)):
- from lib2to3.tests import load_tests
+ load_tests = import_fresh_module('lib2to3.tests', fresh=['lib2to3']).load_tests
if __name__ == '__main__':
unittest.main()
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index d23fbfb4fe..7c98e19b74 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -1164,22 +1164,27 @@ class MemoryHandlerTest(BaseTest):
class MockRaceConditionHandler:
def __init__(self, mem_hdlr):
self.mem_hdlr = mem_hdlr
+ self.threads = []
def removeTarget(self):
self.mem_hdlr.setTarget(None)
def handle(self, msg):
- t = threading.Thread(target=self.removeTarget)
- t.daemon = True
- t.start()
+ thread = threading.Thread(target=self.removeTarget)
+ self.threads.append(thread)
+ thread.start()
target = MockRaceConditionHandler(self.mem_hdlr)
- self.mem_hdlr.setTarget(target)
+ try:
+ self.mem_hdlr.setTarget(target)
- for _ in range(10):
- time.sleep(0.005)
- self.mem_logger.info("not flushed")
- self.mem_logger.warning("flushed")
+ for _ in range(10):
+ time.sleep(0.005)
+ self.mem_logger.info("not flushed")
+ self.mem_logger.warning("flushed")
+ finally:
+ for thread in target.threads:
+ threading_helper.join_thread(thread)
class ExceptionFormatter(logging.Formatter):
@@ -3720,7 +3725,15 @@ class UTC(datetime.tzinfo):
utc = UTC()
-class FormatterTest(unittest.TestCase):
+class AssertErrorMessage:
+
+ def assert_error_message(self, exception, message, *args, **kwargs):
+ try:
+ self.assertRaises((), *args, **kwargs)
+ except exception as e:
+ self.assertEqual(message, str(e))
+
+class FormatterTest(unittest.TestCase, AssertErrorMessage):
def setUp(self):
self.common = {
'name': 'formatter.test',
@@ -3744,12 +3757,6 @@ class FormatterTest(unittest.TestCase):
result.update(self.variants[name])
return logging.makeLogRecord(result)
- def assert_error_message(self, exception, message, *args, **kwargs):
- try:
- self.assertRaises(exception, *args, **kwargs)
- except exception as e:
- self.assertEqual(message, e.message)
-
def test_percent(self):
# Test %-formatting
r = self.get_record()
@@ -3868,7 +3875,7 @@ class FormatterTest(unittest.TestCase):
# Testing failure for '-' in field name
self.assert_error_message(
ValueError,
- "invalid field name/expression: 'name-thing'",
+ "invalid format: invalid field name/expression: 'name-thing'",
logging.Formatter, "{name-thing}", style="{"
)
# Testing failure for style mismatch
@@ -3891,7 +3898,7 @@ class FormatterTest(unittest.TestCase):
# Testing failure for invalid spec
self.assert_error_message(
ValueError,
- "bad specifier: '.2ff'",
+ "invalid format: bad specifier: '.2ff'",
logging.Formatter, '{process:.2ff}', style='{'
)
self.assertRaises(ValueError, logging.Formatter, '{process:.2Z}', style='{')
@@ -3901,12 +3908,12 @@ class FormatterTest(unittest.TestCase):
# Testing failure for mismatch braces
self.assert_error_message(
ValueError,
- "invalid format: unmatched '{' in format spec",
+ "invalid format: expected '}' before end of string",
logging.Formatter, '{process', style='{'
)
self.assert_error_message(
ValueError,
- "invalid format: unmatched '{' in format spec",
+ "invalid format: Single '}' encountered in format string",
logging.Formatter, 'process}', style='{'
)
self.assertRaises(ValueError, logging.Formatter, '{{foo!r:4.2}', style='{')
@@ -4867,7 +4874,7 @@ class LoggerAdapterTest(unittest.TestCase):
self.assertIs(self.logger.manager, orig_manager)
-class LoggerTest(BaseTest):
+class LoggerTest(BaseTest, AssertErrorMessage):
def setUp(self):
super(LoggerTest, self).setUp()
@@ -4879,7 +4886,12 @@ class LoggerTest(BaseTest):
self.addCleanup(logging.shutdown)
def test_set_invalid_level(self):
- self.assertRaises(TypeError, self.logger.setLevel, object())
+ self.assert_error_message(
+ TypeError, 'Level not an integer or a valid string: None',
+ self.logger.setLevel, None)
+ self.assert_error_message(
+ TypeError, 'Level not an integer or a valid string: (0, 0)',
+ self.logger.setLevel, (0, 0))
def test_exception(self):
msg = 'testing exception: %r'
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index 2abe5b028b..a6f6483f55 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -611,7 +611,7 @@ class MathTests(unittest.TestCase):
def msum(iterable):
"""Full precision summation. Compute sum(iterable) without any
intermediate accumulation of error. Based on the 'lsum' function
- at https://github.com/ActiveState/code/tree/master/recipes/Python/393090_Binary_floating_point_summatiaccurate_full/recipe-393090.py
+ at http://code.activestate.com/recipes/393090/
"""
tmant, texp = 0, 0
diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py
index 527aca664d..1152eb65bb 100644
--- a/Lib/test/test_opcodes.py
+++ b/Lib/test/test_opcodes.py
@@ -39,7 +39,7 @@ class OpcodeTest(unittest.TestCase):
def test_use_existing_annotations(self):
ns = {'__annotations__': {1: 2}}
exec('x: int', ns)
- self.assertEqual(ns['__annotations__'], {'x': int, 1: 2})
+ self.assertEqual(ns['__annotations__'], {'x': 'int', 1: 2})
def test_do_not_recreate_annotations(self):
# Don't rely on the existence of the '__annotations__' global.
diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py
index 2c13635d37..0dffedca78 100644
--- a/Lib/test/test_peg_generator/test_c_parser.py
+++ b/Lib/test/test_peg_generator/test_c_parser.py
@@ -90,7 +90,7 @@ class TestCParser(TempdirManager, unittest.TestCase):
def test_c_parser(self) -> None:
grammar_source = """
- start[mod_ty]: a=stmt* $ { Module(a, NULL, p->arena) }
+ start[mod_ty]: a[asdl_stmt_seq*]=stmt* $ { Module(a, NULL, p->arena) }
stmt[stmt_ty]: a=expr_stmt { a }
expr_stmt[stmt_ty]: a=expression NEWLINE { _Py_Expr(a, EXTRA) }
expression[expr_ty]: ( l=expression '+' r=term { _Py_BinOp(l, Add, r, EXTRA) }
@@ -232,7 +232,7 @@ class TestCParser(TempdirManager, unittest.TestCase):
def test_return_stmt_noexpr_action(self) -> None:
grammar_source = """
start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) }
- statements[asdl_seq*]: a=statement+ { a }
+ statements[asdl_stmt_seq*]: a[asdl_stmt_seq*]=statement+ { a }
statement[stmt_ty]: simple_stmt
simple_stmt[stmt_ty]: small_stmt
small_stmt[stmt_ty]: return_stmt
@@ -246,7 +246,7 @@ class TestCParser(TempdirManager, unittest.TestCase):
def test_gather_action_ast(self) -> None:
grammar_source = """
- start[mod_ty]: a=';'.pass_stmt+ NEWLINE ENDMARKER { Module(a, NULL, p->arena) }
+ start[mod_ty]: a[asdl_stmt_seq*]=';'.pass_stmt+ NEWLINE ENDMARKER { Module(a, NULL, p->arena) }
pass_stmt[stmt_ty]: a='pass' { _Py_Pass(EXTRA)}
"""
test_source = """
@@ -258,7 +258,7 @@ class TestCParser(TempdirManager, unittest.TestCase):
def test_pass_stmt_action(self) -> None:
grammar_source = """
start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) }
- statements[asdl_seq*]: a=statement+ { a }
+ statements[asdl_stmt_seq*]: a[asdl_stmt_seq*]=statement+ { a }
statement[stmt_ty]: simple_stmt
simple_stmt[stmt_ty]: small_stmt
small_stmt[stmt_ty]: pass_stmt
@@ -273,10 +273,11 @@ class TestCParser(TempdirManager, unittest.TestCase):
def test_if_stmt_action(self) -> None:
grammar_source = """
start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) }
- statements[asdl_seq*]: a=statement+ { _PyPegen_seq_flatten(p, a) }
- statement[asdl_seq*]: a=compound_stmt { _PyPegen_singleton_seq(p, a) } | simple_stmt
+ statements[asdl_stmt_seq*]: a=statement+ { (asdl_stmt_seq*)_PyPegen_seq_flatten(p, a) }
+ statement[asdl_stmt_seq*]: a=compound_stmt { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, a) } | simple_stmt
- simple_stmt[asdl_seq*]: a=small_stmt b=further_small_stmt* [';'] NEWLINE { _PyPegen_seq_insert_in_front(p, a, b) }
+ simple_stmt[asdl_stmt_seq*]: a=small_stmt b=further_small_stmt* [';'] NEWLINE {
+ (asdl_stmt_seq*)_PyPegen_seq_insert_in_front(p, a, b) }
further_small_stmt[stmt_ty]: ';' a=small_stmt { a }
block: simple_stmt | NEWLINE INDENT a=statements DEDENT { a }
@@ -299,14 +300,14 @@ class TestCParser(TempdirManager, unittest.TestCase):
def test_same_name_different_types(self) -> None:
grammar_source = """
- start[mod_ty]: a=import_from+ NEWLINE ENDMARKER { Module(a, NULL, p->arena)}
+ start[mod_ty]: a[asdl_stmt_seq*]=import_from+ NEWLINE ENDMARKER { Module(a, NULL, p->arena)}
import_from[stmt_ty]: ( a='from' !'import' c=simple_name 'import' d=import_as_names_from {
_Py_ImportFrom(c->v.Name.id, d, 0, EXTRA) }
| a='from' '.' 'import' c=import_as_names_from {
_Py_ImportFrom(NULL, c, 1, EXTRA) }
)
simple_name[expr_ty]: NAME
- import_as_names_from[asdl_seq*]: a=','.import_as_name_from+ { a }
+ import_as_names_from[asdl_alias_seq*]: a[asdl_alias_seq*]=','.import_as_name_from+ { a }
import_as_name_from[alias_ty]: a=NAME 'as' b=NAME { _Py_alias(((expr_ty) a)->v.Name.id, ((expr_ty) b)->v.Name.id, p->arena) }
"""
test_source = """
@@ -320,12 +321,12 @@ class TestCParser(TempdirManager, unittest.TestCase):
def test_with_stmt_with_paren(self) -> None:
grammar_source = """
start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) }
- statements[asdl_seq*]: a=statement+ { _PyPegen_seq_flatten(p, a) }
- statement[asdl_seq*]: a=compound_stmt { _PyPegen_singleton_seq(p, a) }
+ statements[asdl_stmt_seq*]: a=statement+ { (asdl_stmt_seq*)_PyPegen_seq_flatten(p, a) }
+ statement[asdl_stmt_seq*]: a=compound_stmt { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, a) }
compound_stmt[stmt_ty]: with_stmt
with_stmt[stmt_ty]: (
- a='with' '(' b=','.with_item+ ')' ':' c=block {
- _Py_With(b, _PyPegen_singleton_seq(p, c), NULL, EXTRA) }
+ a='with' '(' b[asdl_withitem_seq*]=','.with_item+ ')' ':' c=block {
+ _Py_With(b, (asdl_stmt_seq*) _PyPegen_singleton_seq(p, c), NULL, EXTRA) }
)
with_item[withitem_ty]: (
e=NAME o=['as' t=NAME { t }] { _Py_withitem(e, _PyPegen_set_expr_context(p, o, Store), p->arena) }
@@ -346,12 +347,12 @@ class TestCParser(TempdirManager, unittest.TestCase):
def test_ternary_operator(self) -> None:
grammar_source = """
start[mod_ty]: a=expr ENDMARKER { Module(a, NULL, p->arena) }
- expr[asdl_seq*]: a=listcomp NEWLINE { _PyPegen_singleton_seq(p, _Py_Expr(a, EXTRA)) }
+ expr[asdl_stmt_seq*]: a=listcomp NEWLINE { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, _Py_Expr(a, EXTRA)) }
listcomp[expr_ty]: (
a='[' b=NAME c=for_if_clauses d=']' { _Py_ListComp(b, c, EXTRA) }
)
- for_if_clauses[asdl_seq*]: (
- a=(y=[ASYNC] 'for' a=NAME 'in' b=NAME c=('if' z=NAME { z })*
+ for_if_clauses[asdl_comprehension_seq*]: (
+ a[asdl_comprehension_seq*]=(y=[ASYNC] 'for' a=NAME 'in' b=NAME c[asdl_expr_seq*]=('if' z=NAME { z })*
{ _Py_comprehension(_Py_Name(((expr_ty) a)->v.Name.id, Store, EXTRA), b, c, (y == NULL) ? 0 : 1, p->arena) })+ { a }
)
"""
diff --git a/Lib/test/test_positional_only_arg.py b/Lib/test/test_positional_only_arg.py
index 0a9503e202..1fe8256d46 100644
--- a/Lib/test/test_positional_only_arg.py
+++ b/Lib/test/test_positional_only_arg.py
@@ -302,14 +302,14 @@ class PositionalOnlyTestCase(unittest.TestCase):
def f(x: int, /): ...
return f
- assert inner_has_pos_only().__annotations__ == {'x': int}
+ assert inner_has_pos_only().__annotations__ == {'x': 'int'}
class Something:
def method(self):
def f(x: int, /): ...
return f
- assert Something().method().__annotations__ == {'x': int}
+ assert Something().method().__annotations__ == {'x': 'int'}
def multiple_levels():
def inner_has_pos_only():
@@ -317,7 +317,7 @@ class PositionalOnlyTestCase(unittest.TestCase):
return f
return inner_has_pos_only()
- assert multiple_levels().__annotations__ == {'x': int}
+ assert multiple_levels().__annotations__ == {'x': 'int'}
def test_same_keyword_as_positional_with_kwargs(self):
def f(something,/,**kwargs):
@@ -429,17 +429,6 @@ class PositionalOnlyTestCase(unittest.TestCase):
self.assertEqual(C().method(), sentinel)
- def test_annotations_constant_fold(self):
- def g():
- def f(x: not (int is int), /): ...
-
- # without constant folding we end up with
- # COMPARE_OP(is), IS_OP (0)
- # with constant folding we should expect a IS_OP (1)
- codes = [(i.opname, i.argval) for i in dis.get_instructions(g)]
- self.assertNotIn(('UNARY_NOT', None), codes)
- self.assertIn(('IS_OP', 1), codes)
-
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/test/test_profile.py b/Lib/test/test_profile.py
index 738be85bed..1bdf30acbb 100644
--- a/Lib/test/test_profile.py
+++ b/Lib/test/test_profile.py
@@ -7,7 +7,7 @@ import os
from difflib import unified_diff
from io import StringIO
from test.support import run_unittest
-from test.support.os_helper import TESTFN, unlink
+from test.support.os_helper import TESTFN, unlink, temp_dir, change_cwd
from contextlib import contextmanager
import profile
@@ -112,6 +112,20 @@ class ProfileTest(unittest.TestCase):
assert_python_ok('-m', self.profilermodule.__name__,
'-m', 'timeit', '-n', '1')
+ def test_output_file_when_changing_directory(self):
+ with temp_dir() as tmpdir, change_cwd(tmpdir):
+ os.mkdir('dest')
+ with open('demo.py', 'w') as f:
+ f.write('import os; os.chdir("dest")')
+
+ assert_python_ok(
+ '-m', self.profilermodule.__name__,
+ '-o', 'out.pstats',
+ 'demo.py',
+ )
+
+ self.assertTrue(os.path.exists('out.pstats'))
+
def regenerate_expected_output(filename, cls):
filename = filename.rstrip('co')
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 76d2af8e46..2f502627f4 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -81,7 +81,7 @@ CLASSES
|\x20\x20
| NO_MEANING = 'eggs'
|\x20\x20
- | __annotations__ = {'NO_MEANING': <class 'str'>}
+ | __annotations__ = {'NO_MEANING': 'str'}
\x20\x20\x20\x20
class C(builtins.object)
| Methods defined here:
@@ -194,7 +194,7 @@ Data descriptors defined here:<br>
Data and other attributes defined here:<br>
<dl><dt><strong>NO_MEANING</strong> = 'eggs'</dl>
-<dl><dt><strong>__annotations__</strong> = {'NO_MEANING': &lt;class 'str'&gt;}</dl>
+<dl><dt><strong>__annotations__</strong> = {'NO_MEANING': 'str'}</dl>
</td></tr></table> <p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index a80e71e67e..0c1fdeec99 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -324,6 +324,22 @@ class TestBasicOps:
with self.assertRaises(ValueError):
self.gen.choices('AB', [0.0, 0.0])
+ def test_choices_negative_total(self):
+ with self.assertRaises(ValueError):
+ self.gen.choices('ABC', [3, -5, 1])
+
+ def test_choices_infinite_total(self):
+ with self.assertRaises(ValueError):
+ self.gen.choices('A', [float('inf')])
+ with self.assertRaises(ValueError):
+ self.gen.choices('AB', [0.0, float('inf')])
+ with self.assertRaises(ValueError):
+ self.gen.choices('AB', [-float('inf'), 123])
+ with self.assertRaises(ValueError):
+ self.gen.choices('AB', [0.0, float('nan')])
+ with self.assertRaises(ValueError):
+ self.gen.choices('AB', [float('-inf'), float('inf')])
+
def test_gauss(self):
# Ensure that the seed() method initializes all the hidden state. In
# particular, through 2.2.1 it failed to reset a piece of state used
diff --git a/Lib/test/test_sched.py b/Lib/test/test_sched.py
index 491d7b3a74..7ae7baae85 100644
--- a/Lib/test/test_sched.py
+++ b/Lib/test/test_sched.py
@@ -142,6 +142,17 @@ class TestCase(unittest.TestCase):
self.assertTrue(q.empty())
self.assertEqual(timer.time(), 4)
+ def test_cancel_correct_event(self):
+ # bpo-19270
+ events = []
+ scheduler = sched.scheduler()
+ scheduler.enterabs(1, 1, events.append, ("a",))
+ b = scheduler.enterabs(1, 1, events.append, ("b",))
+ scheduler.enterabs(1, 1, events.append, ("c",))
+ scheduler.cancel(b)
+ scheduler.run()
+ self.assertEqual(events, ["a", "c"])
+
def test_empty(self):
l = []
fun = lambda x: l.append(x)
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index d3ee68facd..2e70880f56 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -516,8 +516,6 @@ class ImportSideEffectTests(unittest.TestCase):
@test.support.requires_resource('network')
@test.support.system_must_validate_cert
- @unittest.skipUnless(sys.version_info[3] == 'final',
- 'only for released versions')
@unittest.skipUnless(hasattr(urllib.request, "HTTPSHandler"),
'need SSL support to download license')
def test_license_exists_at_url(self):
@@ -525,6 +523,8 @@ class ImportSideEffectTests(unittest.TestCase):
# string displayed by license in the absence of a LICENSE file.
url = license._Printer__data.split()[1]
req = urllib.request.Request(url, method='HEAD')
+ # Reset global urllib.request._opener
+ self.addCleanup(urllib.request.urlcleanup)
try:
with socket_helper.transient_internet(url):
with urllib.request.urlopen(req) as data:
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
index fa514917a1..a30e534960 100644
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -11,6 +11,8 @@ import sys
glob = 42
some_var = 12
+some_non_assigned_global_var = 11
+some_assigned_global_var = 11
class Mine:
instance_var = 24
@@ -19,6 +21,8 @@ class Mine:
def spam(a, b, *var, **kw):
global bar
+ global some_assigned_global_var
+ some_assigned_global_var = 12
bar = 47
some_var = 10
x = 23
@@ -88,14 +92,14 @@ class SymtableTest(unittest.TestCase):
def test_lineno(self):
self.assertEqual(self.top.get_lineno(), 0)
- self.assertEqual(self.spam.get_lineno(), 12)
+ self.assertEqual(self.spam.get_lineno(), 14)
def test_function_info(self):
func = self.spam
self.assertEqual(sorted(func.get_parameters()), ["a", "b", "kw", "var"])
expected = ['a', 'b', 'internal', 'kw', 'other_internal', 'some_var', 'var', 'x']
self.assertEqual(sorted(func.get_locals()), expected)
- self.assertEqual(sorted(func.get_globals()), ["bar", "glob"])
+ self.assertEqual(sorted(func.get_globals()), ["bar", "glob", "some_assigned_global_var"])
self.assertEqual(self.internal.get_frees(), ("x",))
def test_globals(self):
@@ -106,6 +110,9 @@ class SymtableTest(unittest.TestCase):
self.assertFalse(self.internal.lookup("x").is_global())
self.assertFalse(self.Mine.lookup("instance_var").is_global())
self.assertTrue(self.spam.lookup("bar").is_global())
+ # Module-scope globals are both global and local
+ self.assertTrue(self.top.lookup("some_non_assigned_global_var").is_global())
+ self.assertTrue(self.top.lookup("some_assigned_global_var").is_global())
def test_nonlocal(self):
self.assertFalse(self.spam.lookup("some_var").is_nonlocal())
@@ -116,6 +123,9 @@ class SymtableTest(unittest.TestCase):
def test_local(self):
self.assertTrue(self.spam.lookup("x").is_local())
self.assertFalse(self.spam.lookup("bar").is_local())
+ # Module-scope globals are both global and local
+ self.assertTrue(self.top.lookup("some_non_assigned_global_var").is_local())
+ self.assertTrue(self.top.lookup("some_assigned_global_var").is_local())
def test_free(self):
self.assertTrue(self.internal.lookup("x").is_free())
@@ -234,6 +244,10 @@ class SymtableTest(unittest.TestCase):
top = symtable.symtable(code, "?", "exec")
self.assertIsNotNone(find_block(top, "\u017d"))
+ def test_symtable_repr(self):
+ self.assertEqual(str(self.top), "<SymbolTable for module ?>")
+ self.assertEqual(str(self.spam), "<Function SymbolTable for spam in ?>")
+
if __name__ == '__main__':
unittest.main()
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 4657fd1c0d..7c3302c1d4 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -752,14 +752,6 @@ Corner-cases that used to fail to raise the correct error:
Traceback (most recent call last):
SyntaxError: cannot assign to __debug__
- >>> def f(*args:(lambda __debug__:0)): pass
- Traceback (most recent call last):
- SyntaxError: cannot assign to __debug__
-
- >>> def f(**kwargs:(lambda __debug__:0)): pass
- Traceback (most recent call last):
- SyntaxError: cannot assign to __debug__
-
>>> with (lambda *:0): pass
Traceback (most recent call last):
SyntaxError: named arguments must follow bare *
@@ -950,6 +942,15 @@ pass
except SyntaxError:
self.fail("Empty line after a line continuation character is valid.")
+ @support.cpython_only
+ def test_nested_named_except_blocks(self):
+ code = ""
+ for i in range(12):
+ code += f"{' '*i}try:\n"
+ code += f"{' '*(i+1)}raise Exception\n"
+ code += f"{' '*i}except Exception as e:\n"
+ code += f"{' '*4*12}pass"
+ self._check_error(code, "too many statically nested blocks")
def test_main():
support.run_unittest(SyntaxTestCase)
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index 3f902b1fe7..dd4418dd98 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -602,6 +602,23 @@ class TraceTestCase(unittest.TestCase):
self.compare_events(doit_async.__code__.co_firstlineno,
tracer.events, events)
+ def test_loop_in_try_except(self):
+ # https://bugs.python.org/issue41670
+
+ def func():
+ try:
+ for i in []: pass
+ return 1
+ except:
+ return 2
+
+ self.run_and_compare(func,
+ [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (3, 'return')])
+
class SkipLineEventsTraceTestCase(TraceTestCase):
"""Repeat the trace tests, but with per-line events skipped"""
diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py
index ed97f70ba1..dfbc2b93df 100644
--- a/Lib/test/test_textwrap.py
+++ b/Lib/test/test_textwrap.py
@@ -640,6 +640,78 @@ How *do* you spell that odd word, anyways?
max_lines=4)
+class LongWordWithHyphensTestCase(BaseTestCase):
+ def setUp(self):
+ self.wrapper = TextWrapper()
+ self.text1 = '''\
+We used enyzme 2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate synthase.
+'''
+ self.text2 = '''\
+1234567890-1234567890--this_is_a_very_long_option_indeed-good-bye"
+'''
+
+ def test_break_long_words_on_hyphen(self):
+ expected = ['We used enyzme 2-succinyl-6-hydroxy-2,4-',
+ 'cyclohexadiene-1-carboxylate synthase.']
+ self.check_wrap(self.text1, 50, expected)
+
+ expected = ['We used', 'enyzme 2-', 'succinyl-', '6-hydroxy-', '2,4-',
+ 'cyclohexad', 'iene-1-', 'carboxylat', 'e', 'synthase.']
+ self.check_wrap(self.text1, 10, expected)
+
+ expected = ['1234567890', '-123456789', '0--this_is', '_a_very_lo',
+ 'ng_option_', 'indeed-', 'good-bye"']
+ self.check_wrap(self.text2, 10, expected)
+
+ def test_break_long_words_not_on_hyphen(self):
+ expected = ['We used enyzme 2-succinyl-6-hydroxy-2,4-cyclohexad',
+ 'iene-1-carboxylate synthase.']
+ self.check_wrap(self.text1, 50, expected, break_on_hyphens=False)
+
+ expected = ['We used', 'enyzme 2-s', 'uccinyl-6-', 'hydroxy-2,',
+ '4-cyclohex', 'adiene-1-c', 'arboxylate', 'synthase.']
+ self.check_wrap(self.text1, 10, expected, break_on_hyphens=False)
+
+ expected = ['1234567890', '-123456789', '0--this_is', '_a_very_lo',
+ 'ng_option_', 'indeed-', 'good-bye"']
+ self.check_wrap(self.text2, 10, expected)
+
+ def test_break_on_hyphen_but_not_long_words(self):
+ expected = ['We used enyzme',
+ '2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate',
+ 'synthase.']
+
+ self.check_wrap(self.text1, 50, expected, break_long_words=False)
+
+ expected = ['We used', 'enyzme',
+ '2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate',
+ 'synthase.']
+ self.check_wrap(self.text1, 10, expected, break_long_words=False)
+
+ expected = ['1234567890', '-123456789', '0--this_is', '_a_very_lo',
+ 'ng_option_', 'indeed-', 'good-bye"']
+ self.check_wrap(self.text2, 10, expected)
+
+
+ def test_do_not_break_long_words_or_on_hyphens(self):
+ expected = ['We used enyzme',
+ '2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate',
+ 'synthase.']
+ self.check_wrap(self.text1, 50, expected,
+ break_long_words=False,
+ break_on_hyphens=False)
+
+ expected = ['We used', 'enyzme',
+ '2-succinyl-6-hydroxy-2,4-cyclohexadiene-1-carboxylate',
+ 'synthase.']
+ self.check_wrap(self.text1, 10, expected,
+ break_long_words=False,
+ break_on_hyphens=False)
+
+ expected = ['1234567890', '-123456789', '0--this_is', '_a_very_lo',
+ 'ng_option_', 'indeed-', 'good-bye"']
+ self.check_wrap(self.text2, 10, expected)
+
class IndentTestCases(BaseTestCase):
# called before each test method
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index 52a59d54f0..75c5eee42d 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -671,8 +671,8 @@ class TypesTests(unittest.TestCase):
ForwardBefore = 'Forward' | T
def forward_after(x: ForwardAfter[int]) -> None: ...
def forward_before(x: ForwardBefore[int]) -> None: ...
- assert typing.get_args(typing.get_type_hints(forward_after)['x']) == (int, Forward)
- assert typing.get_args(typing.get_type_hints(forward_before)['x']) == (int, Forward)
+ assert typing.get_args(typing.get_type_hints(forward_after, localns=locals())['x']) == (int, Forward)
+ assert typing.get_args(typing.get_type_hints(forward_before, localns=locals())['x']) == (int, Forward)
def test_or_type_operator_with_Protocol(self):
class Proto(typing.Protocol):
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 42aa430c5e..57dd73c529 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -24,6 +24,7 @@ from typing import NamedTuple, TypedDict
from typing import IO, TextIO, BinaryIO
from typing import Pattern, Match
from typing import Annotated, ForwardRef
+from typing import TypeAlias
import abc
import typing
import weakref
@@ -349,7 +350,7 @@ class UnionTests(BaseTestCase):
def test_no_eval_union(self):
u = Union[int, str]
def f(x: u): ...
- self.assertIs(get_type_hints(f)['x'], u)
+ self.assertIs(get_type_hints(f, globals(), locals())['x'], u)
def test_function_repr_union(self):
def fun() -> int: ...
@@ -2849,11 +2850,11 @@ class GetTypeHintTests(BaseTestCase):
self.assertEqual(gth(HasForeignBaseClass),
{'some_xrepr': XRepr, 'other_a': mod_generics_cache.A,
'some_b': mod_generics_cache.B})
- self.assertEqual(gth(XRepr.__new__),
+ self.assertEqual(gth(XRepr),
{'x': int, 'y': int})
self.assertEqual(gth(mod_generics_cache.B),
{'my_inner_a1': mod_generics_cache.B.A,
- 'my_inner_a2': mod_generics_cache.B.A,
+ 'my_inner_a2': mod_generics_cache.A,
'my_outer_a': mod_generics_cache.A})
def test_respect_no_type_check(self):
@@ -3641,7 +3642,7 @@ class NamedTupleTests(BaseTestCase):
self.assertEqual(tim.cool, 9000)
self.assertEqual(CoolEmployee.__name__, 'CoolEmployee')
self.assertEqual(CoolEmployee._fields, ('name', 'cool'))
- self.assertEqual(CoolEmployee.__annotations__,
+ self.assertEqual(gth(CoolEmployee),
collections.OrderedDict(name=str, cool=int))
def test_annotation_usage_with_default(self):
@@ -3655,7 +3656,7 @@ class NamedTupleTests(BaseTestCase):
self.assertEqual(CoolEmployeeWithDefault.__name__, 'CoolEmployeeWithDefault')
self.assertEqual(CoolEmployeeWithDefault._fields, ('name', 'cool'))
- self.assertEqual(CoolEmployeeWithDefault.__annotations__,
+ self.assertEqual(gth(CoolEmployeeWithDefault),
dict(name=str, cool=int))
self.assertEqual(CoolEmployeeWithDefault._field_defaults, dict(cool=0))
@@ -3823,7 +3824,7 @@ class TypedDictTests(BaseTestCase):
def test_py36_class_syntax_usage(self):
self.assertEqual(LabelPoint2D.__name__, 'LabelPoint2D')
self.assertEqual(LabelPoint2D.__module__, __name__)
- self.assertEqual(LabelPoint2D.__annotations__, {'x': int, 'y': int, 'label': str})
+ self.assertEqual(gth(LabelPoint2D), {'x': int, 'y': int, 'label': str})
self.assertEqual(LabelPoint2D.__bases__, (dict,))
self.assertEqual(LabelPoint2D.__total__, True)
self.assertNotIsSubclass(LabelPoint2D, typing.Sequence)
@@ -3882,11 +3883,11 @@ class TypedDictTests(BaseTestCase):
assert BaseAnimal.__required_keys__ == frozenset(['name'])
assert BaseAnimal.__optional_keys__ == frozenset([])
- assert BaseAnimal.__annotations__ == {'name': str}
+ assert gth(BaseAnimal) == {'name': str}
assert Animal.__required_keys__ == frozenset(['name'])
assert Animal.__optional_keys__ == frozenset(['tail', 'voice'])
- assert Animal.__annotations__ == {
+ assert gth(Animal) == {
'name': str,
'tail': bool,
'voice': str,
@@ -3894,7 +3895,7 @@ class TypedDictTests(BaseTestCase):
assert Cat.__required_keys__ == frozenset(['name', 'fur_color'])
assert Cat.__optional_keys__ == frozenset(['tail', 'voice'])
- assert Cat.__annotations__ == {
+ assert gth(Cat) == {
'fur_color': str,
'name': str,
'tail': bool,
@@ -3915,7 +3916,7 @@ class IOTests(BaseTestCase):
def stuff(a: IO) -> AnyStr:
return a.readline()
- a = stuff.__annotations__['a']
+ a = gth(stuff)['a']
self.assertEqual(a.__parameters__, (AnyStr,))
def test_textio(self):
@@ -3923,7 +3924,7 @@ class IOTests(BaseTestCase):
def stuff(a: TextIO) -> str:
return a.readline()
- a = stuff.__annotations__['a']
+ a = gth(stuff)['a']
self.assertEqual(a.__parameters__, ())
def test_binaryio(self):
@@ -3931,7 +3932,7 @@ class IOTests(BaseTestCase):
def stuff(a: BinaryIO) -> bytes:
return a.readline()
- a = stuff.__annotations__['a']
+ a = gth(stuff)['a']
self.assertEqual(a.__parameters__, ())
def test_io_submodule(self):
@@ -4176,6 +4177,45 @@ class AnnotatedTests(BaseTestCase):
self.assertEqual(X[int], List[Annotated[int, 5]])
+class TypeAliasTests(BaseTestCase):
+ def test_canonical_usage_with_variable_annotation(self):
+ Alias: TypeAlias = Employee
+
+ def test_canonical_usage_with_type_comment(self):
+ Alias = Employee # type: TypeAlias
+
+ def test_cannot_instantiate(self):
+ with self.assertRaises(TypeError):
+ TypeAlias()
+
+ def test_no_isinstance(self):
+ with self.assertRaises(TypeError):
+ isinstance(42, TypeAlias)
+
+ def test_no_issubclass(self):
+ with self.assertRaises(TypeError):
+ issubclass(Employee, TypeAlias)
+
+ with self.assertRaises(TypeError):
+ issubclass(TypeAlias, Employee)
+
+ def test_cannot_subclass(self):
+ with self.assertRaises(TypeError):
+ class C(TypeAlias):
+ pass
+
+ with self.assertRaises(TypeError):
+ class C(type(TypeAlias)):
+ pass
+
+ def test_repr(self):
+ self.assertEqual(repr(TypeAlias), 'typing.TypeAlias')
+
+ def test_cannot_subscript(self):
+ with self.assertRaises(TypeError):
+ TypeAlias[int]
+
+
class AllTests(BaseTestCase):
"""Tests for __all__."""
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py
index e95f911d8e..cbfd5af2bb 100644
--- a/Lib/test/test_ucn.py
+++ b/Lib/test/test_ucn.py
@@ -7,6 +7,7 @@ Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com)
"""#"
+import ast
import unittest
import unicodedata
@@ -24,7 +25,7 @@ class UnicodeNamesTest(unittest.TestCase):
# Helper that put all \N escapes inside eval'd raw strings,
# to make sure this script runs even if the compiler
# chokes on \N escapes
- res = eval(r'"\N{%s}"' % name)
+ res = ast.literal_eval(r'"\N{%s}"' % name)
self.assertEqual(res, code)
return res
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index d485bc7ede..90b0965582 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -36,7 +36,6 @@ def search_function(encoding):
return (encode2, decode2, None, None)
else:
return None
-codecs.register(search_function)
def duplicate_string(text):
"""
@@ -58,6 +57,10 @@ class UnicodeTest(string_tests.CommonTest,
type2test = str
+ def setUp(self):
+ codecs.register(search_function)
+ self.addCleanup(codecs.unregister, search_function)
+
def checkequalnofix(self, result, object, methodname, *args):
method = getattr(object, methodname)
realresult = method(*args)
diff --git a/Lib/test/test_with.py b/Lib/test/test_with.py
index b1d7a15b5e..f21bf65fed 100644
--- a/Lib/test/test_with.py
+++ b/Lib/test/test_with.py
@@ -7,7 +7,7 @@ __email__ = "mbland at acm dot org"
import sys
import unittest
from collections import deque
-from contextlib import _GeneratorContextManager, contextmanager
+from contextlib import _GeneratorContextManager, contextmanager, nullcontext
class MockContextManager(_GeneratorContextManager):
@@ -641,6 +641,12 @@ class AssignmentTargetTestCase(unittest.TestCase):
self.assertEqual(blah.two, 2)
self.assertEqual(blah.three, 3)
+ def testWithExtendedTargets(self):
+ with nullcontext(range(1, 5)) as (a, *b, c):
+ self.assertEqual(a, 1)
+ self.assertEqual(b, [2, 3])
+ self.assertEqual(c, 4)
+
class ExitSwallowsExceptionTestCase(unittest.TestCase):
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index d22c35d92c..3f1f3781e4 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -3899,6 +3899,14 @@ class C14NTest(unittest.TestCase):
#self.assertEqual(c14n_roundtrip("<doc xmlns:x='http://example.com/x' xmlns='http://example.com/default'><b y:a1='1' xmlns='http://example.com/default' a3='3' xmlns:y='http://example.com/y' y:a2='2'/></doc>"),
#'<doc xmlns:x="http://example.com/x"><b xmlns:y="http://example.com/y" a3="3" y:a1="1" y:a2="2"></b></doc>')
+ # Namespace issues
+ xml = '<X xmlns="http://nps/a"><Y targets="abc,xyz"></Y></X>'
+ self.assertEqual(c14n_roundtrip(xml), xml)
+ xml = '<X xmlns="http://nps/a"><Y xmlns="http://nsp/b" targets="abc,xyz"></Y></X>'
+ self.assertEqual(c14n_roundtrip(xml), xml)
+ xml = '<X xmlns="http://nps/a"><Y xmlns:b="http://nsp/b" b:targets="abc,xyz"></Y></X>'
+ self.assertEqual(c14n_roundtrip(xml), xml)
+
def test_c14n_exclusion(self):
xml = textwrap.dedent("""\
<root xmlns:x="http://example.com/x">
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 2851051425..3bb9ce995c 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -1856,11 +1856,14 @@ class OtherTests(unittest.TestCase):
self.assertEqual(zipf.comment, b"an updated comment")
# check that comments are correctly shortened in append mode
+ # and the file is indeed truncated
with zipfile.ZipFile(TESTFN,mode="w") as zipf:
zipf.comment = b"original comment that's longer"
zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+ original_zip_size = os.path.getsize(TESTFN)
with zipfile.ZipFile(TESTFN,mode="a") as zipf:
zipf.comment = b"shorter comment"
+ self.assertTrue(original_zip_size > os.path.getsize(TESTFN))
with zipfile.ZipFile(TESTFN,mode="r") as zipf:
self.assertEqual(zipf.comment, b"shorter comment")
@@ -2886,6 +2889,33 @@ class TestPath(unittest.TestCase):
data = strm.read()
assert data == "content of a"
+ def test_open_write(self):
+ """
+ If the zipfile is open for write, it should be possible to
+ write bytes or text to it.
+ """
+ zf = zipfile.Path(zipfile.ZipFile(io.BytesIO(), mode='w'))
+ with zf.joinpath('file.bin').open('wb') as strm:
+ strm.write(b'binary contents')
+ with zf.joinpath('file.txt').open('w') as strm:
+ strm.write('text file')
+
+ def test_open_extant_directory(self):
+ """
+ Attempting to open a directory raises IsADirectoryError.
+ """
+ zf = zipfile.Path(add_dirs(build_alpharep_fixture()))
+ with self.assertRaises(IsADirectoryError):
+ zf.joinpath('b').open()
+
+ def test_open_missing_directory(self):
+ """
+ Attempting to open a missing directory raises FileNotFoundError.
+ """
+ zf = zipfile.Path(add_dirs(build_alpharep_fixture()))
+ with self.assertRaises(FileNotFoundError):
+ zf.joinpath('z').open()
+
def test_read(self):
for alpharep in self.zipfile_alpharep():
root = zipfile.Path(alpharep)
@@ -2983,6 +3013,12 @@ class TestPath(unittest.TestCase):
data = ['/'.join(string.ascii_lowercase + str(n)) for n in range(10000)]
zipfile.CompleteDirs._implied_dirs(data)
+ def test_read_does_not_close(self):
+ for alpharep in self.zipfile_ondisk():
+ with zipfile.ZipFile(alpharep) as file:
+ for rep in range(2):
+ zipfile.Path(file, 'a.txt').read_text()
+
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/textwrap.py b/Lib/textwrap.py
index 30e693c8de..841de9baec 100644
--- a/Lib/textwrap.py
+++ b/Lib/textwrap.py
@@ -215,8 +215,16 @@ class TextWrapper:
# If we're allowed to break long words, then do so: put as much
# of the next chunk onto the current line as will fit.
if self.break_long_words:
- cur_line.append(reversed_chunks[-1][:space_left])
- reversed_chunks[-1] = reversed_chunks[-1][space_left:]
+ end = space_left
+ chunk = reversed_chunks[-1]
+ if self.break_on_hyphens and len(chunk) > space_left:
+ # break after last hyphen, but only if there are
+ # non-hyphens before it
+ hyphen = chunk.rfind('-', 0, space_left)
+ if hyphen > 0 and any(c != '-' for c in chunk[:hyphen]):
+ end = hyphen + 1
+ cur_line.append(chunk[:end])
+ reversed_chunks[-1] = chunk[end:]
# Otherwise, we have to preserve the long word intact. Only add
# it to the current line if there's nothing already there --
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 3919397d3c..3bfeb7a017 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -185,8 +185,7 @@ class EventType(enum.StrEnum):
Deactivate = '37'
MouseWheel = '38'
- def __str__(self):
- return self.name
+ __str__ = str.__str__
class Event:
@@ -266,7 +265,7 @@ class Event:
'num', 'delta', 'focus',
'x', 'y', 'width', 'height')
return '<%s event%s>' % (
- self.type,
+ getattr(self.type, 'name', self.type),
''.join(' %s=%s' % (k, attrs[k]) for k in keys if k in attrs)
)
diff --git a/Lib/tkinter/font.py b/Lib/tkinter/font.py
index 15ad7ab4b6..a9f79d8e45 100644
--- a/Lib/tkinter/font.py
+++ b/Lib/tkinter/font.py
@@ -100,6 +100,10 @@ class Font:
def __str__(self):
return self.name
+ def __repr__(self):
+ return f"<{self.__class__.__module__}.{self.__class__.__qualname__}" \
+ f" object {self.name!r}>"
+
def __eq__(self, other):
if not isinstance(other, Font):
return NotImplemented
diff --git a/Lib/tkinter/test/test_tkinter/test_font.py b/Lib/tkinter/test/test_tkinter/test_font.py
index a021ea3368..6d1eea44b4 100644
--- a/Lib/tkinter/test/test_tkinter/test_font.py
+++ b/Lib/tkinter/test/test_tkinter/test_font.py
@@ -101,6 +101,12 @@ class FontTest(AbstractTkTest, unittest.TestCase):
self.assertTrue(name)
self.assertIn(fontname, names)
+ def test_repr(self):
+ self.assertEqual(
+ repr(self.font), f'<tkinter.font.Font object {fontname!r}>'
+ )
+
+
tests_gui = (FontTest, )
if __name__ == "__main__":
diff --git a/Lib/tkinter/test/test_tkinter/test_misc.py b/Lib/tkinter/test/test_tkinter/test_misc.py
index 1e089747a9..b8eea2544f 100644
--- a/Lib/tkinter/test/test_tkinter/test_misc.py
+++ b/Lib/tkinter/test/test_tkinter/test_misc.py
@@ -192,6 +192,54 @@ class MiscTest(AbstractTkTest, unittest.TestCase):
with self.assertRaises(tkinter.TclError):
root.clipboard_get()
+ def test_event_repr_defaults(self):
+ e = tkinter.Event()
+ e.serial = 12345
+ e.num = '??'
+ e.height = '??'
+ e.keycode = '??'
+ e.state = 0
+ e.time = 123456789
+ e.width = '??'
+ e.x = '??'
+ e.y = '??'
+ e.char = ''
+ e.keysym = '??'
+ e.keysym_num = '??'
+ e.type = '100'
+ e.widget = '??'
+ e.x_root = '??'
+ e.y_root = '??'
+ e.delta = 0
+ self.assertEqual(repr(e), '<100 event>')
+
+ def test_event_repr(self):
+ e = tkinter.Event()
+ e.serial = 12345
+ e.num = 3
+ e.focus = True
+ e.height = 200
+ e.keycode = 65
+ e.state = 0x30405
+ e.time = 123456789
+ e.width = 300
+ e.x = 10
+ e.y = 20
+ e.char = 'A'
+ e.send_event = True
+ e.keysym = 'Key-A'
+ e.keysym_num = ord('A')
+ e.type = tkinter.EventType.Configure
+ e.widget = '.text'
+ e.x_root = 1010
+ e.y_root = 1020
+ e.delta = -1
+ self.assertEqual(repr(e),
+ "<Configure event send_event=True"
+ " state=Shift|Control|Button3|0x30000"
+ " keysym=Key-A keycode=65 char='A'"
+ " num=3 delta=-1 focus=True"
+ " x=10 y=20 width=300 height=200>")
tests_gui = (MiscTest, )
diff --git a/Lib/typing.py b/Lib/typing.py
index 8c61bd8e08..0f457ab1f5 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -18,6 +18,7 @@ At large scale, the structure of the module is following:
"""
from abc import abstractmethod, ABCMeta
+import ast
import collections
import collections.abc
import contextlib
@@ -112,6 +113,7 @@ __all__ = [
'runtime_checkable',
'Text',
'TYPE_CHECKING',
+ 'TypeAlias',
]
# The pseudo-submodules 're' and 'io' are part of the public
@@ -459,6 +461,21 @@ def Literal(self, parameters):
return _GenericAlias(self, parameters)
+@_SpecialForm
+def TypeAlias(self, parameters):
+ """Special marker indicating that an assignment should
+ be recognized as a proper type alias definition by type
+ checkers.
+
+ For example::
+
+ Predicate: TypeAlias = Callable[..., bool]
+
+ It's invalid when used anywhere except as in the example above.
+ """
+ raise TypeError(f"{self} is not subscriptable")
+
+
class ForwardRef(_Final, _root=True):
"""Internal wrapper to hold a forward reference."""
@@ -469,6 +486,13 @@ class ForwardRef(_Final, _root=True):
def __init__(self, arg, is_argument=True):
if not isinstance(arg, str):
raise TypeError(f"Forward reference must be a string -- got {arg!r}")
+
+ # Double-stringified forward references is a result of activating
+ # the 'annotations' future by default. This way, we eliminate them in
+ # the runtime.
+ if arg.startswith(("'", '\"')) and arg.endswith(("'", '"')):
+ arg = arg[1:-1]
+
try:
code = compile(arg, '<string>', 'eval')
except SyntaxError:
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index da2bcad0b4..7a269001d6 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -1876,6 +1876,11 @@ class C14NWriterTarget:
self._declared_ns_stack[-1].append((uri, prefix))
return f'{prefix}:{tag}' if prefix else tag, tag, uri
+ if not uri:
+ # As soon as a default namespace is defined,
+ # anything that has no namespace (and thus, no prefix) goes there.
+ return tag, tag, uri
+
raise ValueError(f'Namespace "{uri}" is not declared in scope')
def data(self, data):
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 915698f9e0..da3e40e5db 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -1918,6 +1918,8 @@ class ZipFile:
centDirSize, centDirOffset, len(self._comment))
self.fp.write(endrec)
self.fp.write(self._comment)
+ if self.mode == "a":
+ self.fp.truncate()
self.fp.flush()
def _fpclose(self, fp):
@@ -2195,13 +2197,12 @@ class CompleteDirs(ZipFile):
if not isinstance(source, ZipFile):
return cls(source)
- # Only allow for FastPath when supplied zipfile is read-only
+ # Only allow for FastLookup when supplied zipfile is read-only
if 'r' not in source.mode:
cls = CompleteDirs
- res = cls.__new__(cls)
- vars(res).update(vars(source))
- return res
+ source.__class__ = cls
+ return source
class FastLookup(CompleteDirs):
@@ -2290,17 +2291,29 @@ class Path:
__repr = "{self.__class__.__name__}({self.root.filename!r}, {self.at!r})"
def __init__(self, root, at=""):
+ """
+ Construct a Path from a ZipFile or filename.
+
+ Note: When the source is an existing ZipFile object,
+ its type (__class__) will be mutated to a
+ specialized type. If the caller wishes to retain the
+ original type, the caller should either create a
+ separate ZipFile object or pass a filename.
+ """
self.root = FastLookup.make(root)
self.at = at
- def open(self, mode='r', *args, **kwargs):
+ def open(self, mode='r', *args, pwd=None, **kwargs):
"""
Open this entry as text or binary following the semantics
of ``pathlib.Path.open()`` by passing arguments through
to io.TextIOWrapper().
"""
- pwd = kwargs.pop('pwd', None)
+ if self.is_dir():
+ raise IsADirectoryError(self)
zip_mode = mode[0]
+ if not self.exists() and zip_mode == 'r':
+ raise FileNotFoundError(self)
stream = self.root.open(self.at, zip_mode, pwd=pwd)
if 'b' in mode:
if args or kwargs:
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index a58b922ce3..2548b212d9 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -307,9 +307,9 @@ def library_recipes():
),
),
dict(
- name="SQLite 3.32.3",
- url="https://sqlite.org/2020/sqlite-autoconf-3320300.tar.gz",
- checksum='2e3911a3c15e85c2f2d040154bbe5ce3',
+ name="SQLite 3.33.0",
+ url="https://sqlite.org/2020/sqlite-autoconf-3330000.tar.gz",
+ checksum='842a8a100d7b01b09e543deb2b7951dd',
extra_cflags=('-Os '
'-DSQLITE_ENABLE_FTS5 '
'-DSQLITE_ENABLE_FTS4 '
diff --git a/Misc/ACKS b/Misc/ACKS
index 7b743464c1..d81d0a2551 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -611,6 +611,7 @@ Christoph Gohlke
Tim Golden
Yonatan Goldschmidt
Mark Gollahon
+Mikhail Golubev
Guilherme Gonçalves
Tiago Gonçalves
Chris Gonnerman
@@ -786,6 +787,7 @@ Meador Inge
Peter Ingebretson
Tony Ingraldi
John Interrante
+Dean Inwood
Bob Ippolito
Roger Irwin
Atsuo Ishimoto
@@ -1257,6 +1259,7 @@ Grant Olson
Furkan Onder
Koray Oner
Ethan Onstott
+Ken Jin Ooi
Piet van Oostrum
Tomas Oppelstrup
Jason Orendorff
@@ -1351,6 +1354,7 @@ Zero Piraeus
Antoine Pitrou
Jean-François Piéronne
Oleg Plakhotnyuk
+Anatoliy Platonov
Marcel Plch
Remi Pointel
Jon Poler
@@ -1575,6 +1579,7 @@ Akash Shende
Charlie Shepherd
Bruce Sherwood
Gregory Shevchenko
+Hai Shi
Alexander Shigin
Pete Shinners
Michael Shiplett
diff --git a/Misc/NEWS.d/3.10.0a1.rst b/Misc/NEWS.d/3.10.0a1.rst
new file mode 100644
index 0000000000..044bd20594
--- /dev/null
+++ b/Misc/NEWS.d/3.10.0a1.rst
@@ -0,0 +1,3509 @@
+.. bpo: 41304
+.. date: 2020-07-15-20-15-08
+.. nonce: vNEeYA
+.. release date: 2020-10-05
+.. section: Security
+
+Fixes `python3x._pth` being ignored on Windows, caused by the fix for
+:issue:`29778` (CVE-2020-15801).
+
+..
+
+.. bpo: 41162
+.. date: 2020-07-03-20-41-29
+.. nonce: tb8pVj
+.. section: Security
+
+Audit hooks are now cleared later during finalization to avoid missing
+events.
+
+..
+
+.. bpo: 29778
+.. date: 2020-07-03-17-21-37
+.. nonce: cR_fGS
+.. section: Security
+
+Ensure :file:`python3.dll` is loaded from correct locations when Python is
+embedded (CVE-2020-15523).
+
+..
+
+.. bpo: 41004
+.. date: 2020-06-29-16-02-29
+.. nonce: ovF0KZ
+.. section: Security
+
+The __hash__() methods of ipaddress.IPv4Interface and
+ipaddress.IPv6Interface incorrectly generated constant hash values of 32 and
+128 respectively. This resulted in always causing hash collisions. The fix
+uses hash() to generate hash values for the tuple of (address, mask length,
+network address).
+
+..
+
+.. bpo: 39603
+.. date: 2020-02-12-14-17-39
+.. nonce: Gt3RSg
+.. section: Security
+
+Prevent http header injection by rejecting control characters in
+http.client.putrequest(...).
+
+..
+
+.. bpo: 41909
+.. date: 2020-10-04-10-55-12
+.. nonce: BqHPcm
+.. section: Core and Builtins
+
+Fixed stack overflow in :func:`issubclass` and :func:`isinstance` when
+getting the ``__bases__`` attribute leads to infinite recursion.
+
+..
+
+.. bpo: 41922
+.. date: 2020-10-04-01-02-58
+.. nonce: kHGT8I
+.. section: Core and Builtins
+
+Speed up calls to ``reversed()`` by using the :pep:`590` ``vectorcall``
+calling convention. Patch by Dong-hee Na.
+
+..
+
+.. bpo: 41873
+.. date: 2020-09-28-08-58-28
+.. nonce: VzEDhA
+.. section: Core and Builtins
+
+Calls to ``float()`` are now faster due to the ``vectorcall`` calling
+convention. Patch by Dennis Sweeney.
+
+..
+
+.. bpo: 41870
+.. date: 2020-09-27-22-23-14
+.. nonce: 2v6_v4
+.. section: Core and Builtins
+
+Speed up calls to ``bool()`` by using the :pep:`590` ``vectorcall`` calling
+convention. Patch by Dong-hee Na.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-26-14-43-30
+.. nonce: aJS9B3
+.. section: Core and Builtins
+
+Port the :mod:`_bisect` module to the multi-phase initialization API
+(:pep:`489`).
+
+..
+
+.. bpo: 39934
+.. date: 2020-09-24-12-15-45
+.. nonce: YVHTCF
+.. section: Core and Builtins
+
+Correctly count control blocks in 'except' in compiler. Ensures that a
+syntax error, rather a fatal error, occurs for deeply nested, named
+exception handlers.
+
+..
+
+.. bpo: 41780
+.. date: 2020-09-15-23-29-49
+.. nonce: bOBUIH
+.. section: Core and Builtins
+
+Fix :meth:`__dir__` of :class:`types.GenericAlias`. Patch by Batuhan
+Taskaya.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-12-18-34-34
+.. nonce: lh335O
+.. section: Core and Builtins
+
+Port the :mod:`_lsprof` extension module to multi-phase initialization
+(:pep:`489`).
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-08-21-58-47
+.. nonce: vdjSLH
+.. section: Core and Builtins
+
+Port the :mod:`cmath` extension module to multi-phase initialization
+(:pep:`489`).
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-08-20-39-43
+.. nonce: jiXmyT
+.. section: Core and Builtins
+
+Port the :mod:`_scproxy` extension module to multi-phase initialization
+(:pep:`489`).
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-07-11-35-02
+.. nonce: rvIexb
+.. section: Core and Builtins
+
+Port the :mod:`termios` extension module to multi-phase initialization
+(:pep:`489`).
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-07-09-45-47
+.. nonce: QuDIut
+.. section: Core and Builtins
+
+Convert the :mod:`_sha256` extension module types to heap types.
+
+..
+
+.. bpo: 41690
+.. date: 2020-09-02-12-00-57
+.. nonce: Ny-Sfy
+.. section: Core and Builtins
+
+Fix a possible stack overflow in the parser when parsing functions and
+classes with a huge ammount of arguments. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-01-17-22-35
+.. nonce: CnRME3
+.. section: Core and Builtins
+
+Port the :mod:`_overlapped` extension module to multi-phase initialization
+(:pep:`489`).
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-01-17-08-07
+.. nonce: X9CZgo
+.. section: Core and Builtins
+
+Port the :mod:`_curses_panel` extension module to multi-phase initialization
+(:pep:`489`).
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-01-17-06-02
+.. nonce: 5jZymK
+.. section: Core and Builtins
+
+Port the :mod:`_opcode` extension module to multi-phase initialization
+(:pep:`489`).
+
+..
+
+.. bpo: 41681
+.. date: 2020-08-31-17-49-02
+.. nonce: 3-VJiH
+.. section: Core and Builtins
+
+Fixes the wrong error description in the error raised by using 2 `,` in
+format string in f-string and :meth:`str.format`.
+
+..
+
+.. bpo: 41675
+.. date: 2020-08-31-14-53-17
+.. nonce: VSoqWU
+.. section: Core and Builtins
+
+The implementation of :func:`signal.siginterrupt` now uses
+:c:func:`sigaction` (if it is available in the system) instead of the
+deprecated :c:func:`siginterrupt`. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 41670
+.. date: 2020-08-31-11-37-59
+.. nonce: vmRJRx
+.. section: Core and Builtins
+
+Prevent line trace being skipped on platforms not compiled with
+``USE_COMPUTED_GOTOS``. Fixes issue where some lines nested within a
+try-except block were not being traced on Windows.
+
+..
+
+.. bpo: 41654
+.. date: 2020-08-30-20-38-33
+.. nonce: HtnhAM
+.. section: Core and Builtins
+
+Fix a crash that occurred when destroying subclasses of
+:class:`MemoryError`. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-08-28-20-54-04
+.. nonce: 7ijlcI
+.. section: Core and Builtins
+
+Port the :mod:`zlib` extension module to multi-phase initialization
+(:pep:`489`).
+
+..
+
+.. bpo: 41631
+.. date: 2020-08-26-11-23-31
+.. nonce: 3jZcd9
+.. section: Core and Builtins
+
+The ``_ast`` module uses again a global state. Using a module state per
+module instance is causing subtle practical problems. For example, the
+Mercurial project replaces the ``__import__()`` function to implement lazy
+import, whereas Python expected that ``import _ast`` always return a fully
+initialized ``_ast`` module.
+
+..
+
+.. bpo: 40077
+.. date: 2020-08-25-22-43-33
+.. nonce: vcxSUa
+.. section: Core and Builtins
+
+Convert :mod:`_operator` to use :c:func:`PyType_FromSpec`.
+
+..
+
+.. bpo: 1653741
+.. date: 2020-08-13-07-19-21
+.. nonce: fubBkb
+.. section: Core and Builtins
+
+Port :mod:`_sha3` to multi-phase init. Convert static types to heap types.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-08-13-07-18-05
+.. nonce: FC13e7
+.. section: Core and Builtins
+
+Port the :mod:`_blake2` extension module to the multi-phase initialization
+API (:pep:`489`).
+
+..
+
+.. bpo: 41533
+.. date: 2020-08-12-20-29-57
+.. nonce: 4pcVAc
+.. section: Core and Builtins
+
+Free the stack allocated in ``va_build_stack`` if ``do_mkstack`` fails and
+the stack is not a ``small_stack``.
+
+..
+
+.. bpo: 41531
+.. date: 2020-08-12-19-32-15
+.. nonce: WgPzjT
+.. section: Core and Builtins
+
+Fix a bug that was dropping keys when compiling dict literals with more than
+0xFFFF elements. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 41525
+.. date: 2020-08-12-07-35-07
+.. nonce: d9q3XL
+.. section: Core and Builtins
+
+The output of ``python --help`` contains now only ASCII characters.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-08-10-16-11-32
+.. nonce: O0d3ym
+.. section: Core and Builtins
+
+Port the :mod:`_sha1`, :mod:`_sha512`, and :mod:`_md5` extension modules to
+multi-phase initialization API (:pep:`489`).
+
+..
+
+.. bpo: 41431
+.. date: 2020-08-02-15-53-12
+.. nonce: TblUBT
+.. section: Core and Builtins
+
+Optimize ``dict_merge()`` for copying dict (e.g. ``dict(d)`` and
+``{}.update(d)``).
+
+..
+
+.. bpo: 41428
+.. date: 2020-07-28-22-43-27
+.. nonce: FM6xsI
+.. section: Core and Builtins
+
+Implement PEP 604. This supports (int | str) etc. in place of Union[str,
+int].
+
+..
+
+.. bpo: 41340
+.. date: 2020-07-27-01-50-06
+.. nonce: pZXfcF
+.. section: Core and Builtins
+
+Removed fallback implementation for ``strdup``.
+
+..
+
+.. bpo: 38156
+.. date: 2020-07-20-17-01-17
+.. nonce: ptcdRy
+.. section: Core and Builtins
+
+Handle interrupts that come after EOF correctly in ``PyOS_StdioReadline``.
+
+..
+
+.. bpo: 41342
+.. date: 2020-07-19-15-40-52
+.. nonce: RRk_m_
+.. section: Core and Builtins
+
+:func:`round` with integer argument is now faster (9--60%).
+
+..
+
+.. bpo: 41334
+.. date: 2020-07-18-18-01-10
+.. nonce: t5xMGp
+.. section: Core and Builtins
+
+Constructors :func:`str`, :func:`bytes` and :func:`bytearray` are now faster
+(around 30--40% for small objects).
+
+..
+
+.. bpo: 41295
+.. date: 2020-07-18-08-15-32
+.. nonce: pu8Ezo
+.. section: Core and Builtins
+
+Resolve a regression in CPython 3.8.4 where defining "__setattr__" in a
+multi-inheritance setup and calling up the hierarchy chain could fail if
+builtins/extension types were involved in the base types.
+
+..
+
+.. bpo: 41323
+.. date: 2020-07-17-11-31-54
+.. nonce: ChbZHh
+.. section: Core and Builtins
+
+Bytecode optimizations are performed directly on the control flow graph.
+This will result in slightly more compact code objects in some
+circumstances.
+
+..
+
+.. bpo: 41247
+.. date: 2020-07-08-22-03-54
+.. nonce: PndYIk
+.. section: Core and Builtins
+
+Always cache the running loop holder when running
+``asyncio.set_running_loop``.
+
+..
+
+.. bpo: 41252
+.. date: 2020-07-08-21-55-23
+.. nonce: nBWL-Y
+.. section: Core and Builtins
+
+Fix incorrect refcounting in _ssl.c's ``_servername_callback()``.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-07-07-16-10-52
+.. nonce: zU-H_n
+.. section: Core and Builtins
+
+Port :mod:`multiprocessing` to multi-phase initialization
+
+..
+
+.. bpo: 1635741
+.. date: 2020-07-06-20-43-19
+.. nonce: LYhsni
+.. section: Core and Builtins
+
+Port :mod:`winapi` to multiphase initialization
+
+..
+
+.. bpo: 41215
+.. date: 2020-07-06-18-36-33
+.. nonce: vFGFIz
+.. section: Core and Builtins
+
+Use non-NULL default values in the PEG parser keyword list to overcome a bug
+that was preventing Python from being properly compiled when using the XLC
+compiler. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 41218
+.. date: 2020-07-06-13-35-17
+.. nonce: oKnSr2
+.. section: Core and Builtins
+
+Python 3.8.3 had a regression where compiling with
+ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension
+with CO_COROUTINE. Now only list comprehension making use of async/await
+will tagged as so.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-07-03-23-10-02
+.. nonce: F5coWe
+.. section: Core and Builtins
+
+Port :mod:`faulthandler` to multiphase initialization.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-07-01-20-17-38
+.. nonce: -AtPYu
+.. section: Core and Builtins
+
+Port :mod:`sha256` to multiphase initialization
+
+..
+
+.. bpo: 41175
+.. date: 2020-06-30-20-17-31
+.. nonce: acJoXB
+.. section: Core and Builtins
+
+Guard against a NULL pointer dereference within bytearrayobject triggered by
+the ``bytearray() + bytearray()`` operation.
+
+..
+
+.. bpo: 41100
+.. date: 2020-06-30-04-44-29
+.. nonce: PJwA6F
+.. section: Core and Builtins
+
+add arm64 to the allowable Mac OS arches in mpdecimal.h
+
+..
+
+.. bpo: 41094
+.. date: 2020-06-23-23-26-42
+.. nonce: zEIJse
+.. section: Core and Builtins
+
+Fix decoding errors with audit when open files with non-ASCII names on
+non-UTF-8 locale.
+
+..
+
+.. bpo: 39960
+.. date: 2020-06-23-18-32-41
+.. nonce: Kez3fP
+.. section: Core and Builtins
+
+The "hackcheck" that prevents sneaking around a type's __setattr__() by
+calling the superclass method was rewritten to allow C implemented heap
+types.
+
+..
+
+.. bpo: 41084
+.. date: 2020-06-23-15-10-19
+.. nonce: pt3y7F
+.. section: Core and Builtins
+
+Prefix the error message with 'f-string: ', when parsing an f-string
+expression which throws a :exc:`SyntaxError`.
+
+..
+
+.. bpo: 40521
+.. date: 2020-06-23-07-35-11
+.. nonce: dMNA6k
+.. section: Core and Builtins
+
+Empty frozensets are no longer singletons.
+
+..
+
+.. bpo: 41076
+.. date: 2020-06-22-13-22-30
+.. nonce: eWYw2N
+.. section: Core and Builtins
+
+Pre-feed the parser with the location of the f-string expression, not the
+f-string itself, which allows us to skip the shifting of the AST node
+locations after the parsing is completed.
+
+..
+
+.. bpo: 41056
+.. date: 2020-06-21-19-53-33
+.. nonce: IDu_EK
+.. section: Core and Builtins
+
+Fixes a reference to deallocated stack space during startup when
+constructing sys.path involving a relative symlink when code was supplied
+via -c. (discovered via Coverity)
+
+..
+
+.. bpo: 41061
+.. date: 2020-06-21-10-54-02
+.. nonce: AHf9MU
+.. section: Core and Builtins
+
+Fix incorrect expressions and asserts in hashtable code and tests.
+
+..
+
+.. bpo: 41052
+.. date: 2020-06-20-22-46-18
+.. nonce: 46MPeF
+.. section: Core and Builtins
+
+Opt out serialization/deserialization for _random.Random
+
+..
+
+.. bpo: 40939
+.. date: 2020-06-20-19-27-47
+.. nonce: jxJ4yn
+.. section: Core and Builtins
+
+Rename `PyPegen*` functions to `PyParser*`, so that we can remove the old
+set of `PyParser*` functions that were using the old parser, but keep
+everything backwards-compatible.
+
+..
+
+.. bpo: 35975
+.. date: 2020-06-20-17-00-44
+.. nonce: UDHCHp
+.. section: Core and Builtins
+
+Stefan Behnel reported that cf_feature_version is used even when
+PyCF_ONLY_AST is not set. This is against the intention and against the
+documented behavior, so it's been fixed.
+
+..
+
+.. bpo: 40939
+.. date: 2020-06-20-16-59-02
+.. nonce: 6810Ak
+.. section: Core and Builtins
+
+Remove the remaining files from the old parser and the :mod:`symbol` module.
+
+..
+
+.. bpo: 40077
+.. date: 2020-06-18-19-04-30
+.. nonce: _yI-ax
+.. section: Core and Builtins
+
+Convert :mod:`_bz2` to use :c:func:`PyType_FromSpec`.
+
+..
+
+.. bpo: 41006
+.. date: 2020-06-18-00-07-09
+.. nonce: H-wN-d
+.. section: Core and Builtins
+
+The ``encodings.latin_1`` module is no longer imported at startup. Now it is
+only imported when it is the filesystem encoding or the stdio encoding.
+
+..
+
+.. bpo: 40636
+.. date: 2020-06-17-10-27-17
+.. nonce: MYaCIe
+.. section: Core and Builtins
+
+:func:`zip` now supports :pep:`618`'s ``strict`` parameter, which raises a
+:exc:`ValueError` if the arguments are exhausted at different lengths. Patch
+by Brandt Bucher.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-06-17-00-52-21
+.. nonce: 61iyYh
+.. section: Core and Builtins
+
+Port :mod:`_gdbm` to multiphase initialization.
+
+..
+
+.. bpo: 40985
+.. date: 2020-06-15-16-29-55
+.. nonce: IIN_xX
+.. section: Core and Builtins
+
+Fix a bug that caused the :exc:`SyntaxError` text to be empty when a file
+ends with a line ending in a line continuation character (i.e. backslash).
+The error text should contain the text of the last line.
+
+..
+
+.. bpo: 40958
+.. date: 2020-06-15-01-20-44
+.. nonce: 7O2Wh1
+.. section: Core and Builtins
+
+Fix a possible buffer overflow in the PEG parser when gathering information
+for emitting syntax errors. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-06-12-22-56-17
+.. nonce: mmlp3Q
+.. section: Core and Builtins
+
+Port :mod:`_dbm` to multiphase initialization.
+
+..
+
+.. bpo: 40957
+.. date: 2020-06-12-12-21-54
+.. nonce: Z8n6I6
+.. section: Core and Builtins
+
+Fix refleak in _Py_fopen_obj() when PySys_Audit() fails
+
+..
+
+.. bpo: 40950
+.. date: 2020-06-12-00-12-28
+.. nonce: tzMy7m
+.. section: Core and Builtins
+
+Add a state to the :mod:`nis` module (:pep:`3121`) and apply the multiphase
+initialization. Patch by Dong-hee Na.
+
+..
+
+.. bpo: 40947
+.. date: 2020-06-11-16-06-49
+.. nonce: 72cZcR
+.. section: Core and Builtins
+
+The Python :ref:`Path Configuration <init-path-config>` now takes
+:c:member:`PyConfig.platlibdir` in account.
+
+..
+
+.. bpo: 40939
+.. date: 2020-06-10-11-27-15
+.. nonce: DO-wAI
+.. section: Core and Builtins
+
+Remove the old parser, the :mod:`parser` module and all associated support
+code, command-line options and environment variables. Patch by Pablo
+Galindo.
+
+..
+
+.. bpo: 40847
+.. date: 2020-06-09-23-52-32
+.. nonce: 4XAACw
+.. section: Core and Builtins
+
+Fix a bug where a line with only a line continuation character is not
+considered a blank line at tokenizer level. In such cases, more than a
+single `NEWLINE` token was emitted. The old parser was working around the
+issue, but the new parser threw a :exc:`SyntaxError` for valid input due to
+this. For example, an empty line following a line continuation character was
+interpreted as a :exc:`SyntaxError`.
+
+..
+
+.. bpo: 40890
+.. date: 2020-06-09-00-20-13
+.. nonce: LoRV-g
+.. section: Core and Builtins
+
+Each dictionary view now has a ``mapping`` attribute that provides a
+:class:`types.MappingProxyType` wrapping the original dictionary. Patch
+contributed by Dennis Sweeney.
+
+..
+
+.. bpo: 40889
+.. date: 2020-06-08-22-46-33
+.. nonce: vIBl-W
+.. section: Core and Builtins
+
+Improved the performance of symmetric difference operations on dictionary
+item views. Patch by Dennis Sweeney.
+
+..
+
+.. bpo: 40904
+.. date: 2020-06-08-01-08-57
+.. nonce: 76qQzo
+.. section: Core and Builtins
+
+Fix possible segfault in the new PEG parser when parsing f-string containing
+yield statements with no value (:code:`f"{yield}"`). Patch by Pablo Galindo
+
+..
+
+.. bpo: 40903
+.. date: 2020-06-07-22-50-10
+.. nonce: 7dWejS
+.. section: Core and Builtins
+
+Fixed a possible segfault in the new PEG parser when producing error
+messages for invalid assignments of the form :code:`p=p=`. Patch by Pablo
+Galindo
+
+..
+
+.. bpo: 40880
+.. date: 2020-06-06-00-23-19
+.. nonce: fjdzSh
+.. section: Core and Builtins
+
+Fix invalid memory read in the new parser when checking newlines in string
+literals. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 40883
+.. date: 2020-06-05-23-25-00
+.. nonce: M6sQ-Q
+.. section: Core and Builtins
+
+Fix memory leak in when parsing f-strings in the new parser. Patch by Pablo
+Galindo
+
+..
+
+.. bpo: 40870
+.. date: 2020-06-05-12-48-28
+.. nonce: 9cd2sk
+.. section: Core and Builtins
+
+Raise :exc:`ValueError` when validating custom AST's where the constants
+``True``, ``False`` and ``None`` are used within a :class:`ast.Name` node.
+
+..
+
+.. bpo: 40854
+.. date: 2020-06-03-13-53-24
+.. nonce: O6vfQU
+.. section: Core and Builtins
+
+Allow overriding :data:`sys.platlibdir` via a new :envvar:`PYTHONPLATLIBDIR`
+environment variable.
+
+..
+
+.. bpo: 40826
+.. date: 2020-06-01-20-31-07
+.. nonce: XCI4M2
+.. section: Core and Builtins
+
+Fix GIL usage in :c:func:`PyOS_Readline`: lock the GIL to set an exception
+and pass the Python thread state when checking if there is a pending signal.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-05-30-23-23-35
+.. nonce: 0D-laM
+.. section: Core and Builtins
+
+Port :mod:`fcntl` to multiphase initialization.
+
+..
+
+.. bpo: 19468
+.. date: 2020-05-30-23-18-35
+.. nonce: S-TA7p
+.. section: Core and Builtins
+
+Delete unnecessary instance check in importlib.reload(). Patch by Furkan
+Önder.
+
+..
+
+.. bpo: 40824
+.. date: 2020-05-30-14-37-18
+.. nonce: XR3V5s
+.. section: Core and Builtins
+
+Unexpected errors in calling the ``__iter__`` method are no longer masked by
+``TypeError`` in the :keyword:`in` operator and functions
+:func:`~operator.contains`, :func:`~operator.indexOf` and
+:func:`~operator.countOf` of the :mod:`operator` module.
+
+..
+
+.. bpo: 40792
+.. date: 2020-05-27-22-37-58
+.. nonce: WEDqqU
+.. section: Core and Builtins
+
+Attributes ``start``, ``stop`` and ``step`` of the :class:`range` object now
+always has exact type :class:`int`. Previously, they could have been an
+instance of a subclass of ``int``.
+
+..
+
+.. bpo: 40780
+.. date: 2020-05-26-17-43-58
+.. nonce: 3Ckdgm
+.. section: Core and Builtins
+
+Fix a corner case where g-style string formatting of a float failed to
+remove trailing zeros.
+
+..
+
+.. bpo: 38964
+.. date: 2020-05-25-21-49-11
+.. nonce: lrml90
+.. section: Core and Builtins
+
+When there's a :exc:`SyntaxError` in the expression part of an fstring, the
+filename attribute of the :exc:`SyntaxError` gets correctly set to the name
+of the file the fstring resides in.
+
+..
+
+.. bpo: 40750
+.. date: 2020-05-24-02-42-26
+.. nonce: ZmO9Ev
+.. section: Core and Builtins
+
+Support the "-d" debug flag in the new PEG parser. Patch by Pablo Galindo
+
+..
+
+.. bpo: 40217
+.. date: 2020-05-23-01-15-51
+.. nonce: jZsHTc
+.. section: Core and Builtins
+
+Instances of types created with :c:func:`PyType_FromSpecWithBases` will no
+longer automatically visit their class object when traversing references in
+the garbage collector. The user is expected to manually visit the object's
+class. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 39573
+.. date: 2020-05-22-00-34-34
+.. nonce: QO2QHj
+.. section: Core and Builtins
+
+:c:func:`Py_TYPE()` is changed to the inline static function. Patch by
+Dong-hee Na.
+
+..
+
+.. bpo: 40696
+.. date: 2020-05-21-01-54-00
+.. nonce: u3n8Wx
+.. section: Core and Builtins
+
+Fix a hang that can arise after :meth:`generator.throw` due to a cycle in
+the exception context chain.
+
+..
+
+.. bpo: 40521
+.. date: 2020-05-20-01-17-34
+.. nonce: wvAehI
+.. section: Core and Builtins
+
+Each interpreter now its has own free lists, singletons and caches:
+
+* Free lists: float, tuple, list, dict, frame, context,
+ asynchronous generator, MemoryError.
+* Singletons: empty tuple, empty bytes string, empty Unicode string,
+ single byte character, single Unicode (latin1) character.
+* Slice cache.
+
+They are no longer shared by all interpreters.
+
+..
+
+.. bpo: 40679
+.. date: 2020-05-19-19-39-49
+.. nonce: SVzz9p
+.. section: Core and Builtins
+
+Certain :exc:`TypeError` messages about missing or extra arguments now
+include the function's :term:`qualified name`. Patch by Dennis Sweeney.
+
+..
+
+.. bpo: 29590
+.. date: 2020-05-03-22-26-00
+.. nonce: aRz3l7
+.. section: Core and Builtins
+
+Make the stack trace correct after calling :meth:`generator.throw` on a
+generator that has yielded from a ``yield from``.
+
+..
+
+.. bpo: 4022
+.. date: 2020-04-11-13-07-49
+.. nonce: Ctpn_F
+.. section: Core and Builtins
+
+Improve performance of generators by not raising internal StopIteration.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-04-10-23-54-57
+.. nonce: ZURqoN
+.. section: Core and Builtins
+
+Port :mod:`mmap` to multiphase initialization.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-04-05-02-35-08
+.. nonce: Kfe9fT
+.. section: Core and Builtins
+
+Port :mod:`_lzma` to multiphase initialization.
+
+..
+
+.. bpo: 37999
+.. date: 2019-09-01-14-26-02
+.. nonce: XPl6dn
+.. section: Core and Builtins
+
+Builtin and extension functions that take integer arguments no longer accept
+:class:`~decimal.Decimal`\ s, :class:`~fractions.Fraction`\ s and other
+objects that can be converted to integers only with a loss (e.g. that have
+the :meth:`~object.__int__` method but do not have the
+:meth:`~object.__index__` method).
+
+..
+
+.. bpo: 29882
+.. date: 2019-06-02-11-29-15
+.. nonce: AkRzjb
+.. section: Core and Builtins
+
+Add :meth:`int.bit_count()`, counting the number of ones in the binary
+representation of an integer. Patch by Niklas Fiekas.
+
+..
+
+.. bpo: 36982
+.. date: 2019-05-25-05-27-39
+.. nonce: 0UHgfB
+.. section: Core and Builtins
+
+Use ncurses extended color functions when available to support terminals
+with 256 colors, and add the new function
+:func:`curses.has_extended_color_support` to indicate whether extended color
+support is provided by the underlying ncurses library.
+
+..
+
+.. bpo: 19569
+.. date: 2018-08-29-15-57-07
+.. nonce: RGu2Kb
+.. section: Core and Builtins
+
+Add the private macros ``_Py_COMP_DIAG_PUSH``,
+``_Py_COMP_DIAG_IGNORE_DEPR_DECLS``, and ``_Py_COMP_DIAG_POP``.
+
+..
+
+.. bpo: 26680
+.. date: 2018-03-15-11-51-36
+.. nonce: wOWYps
+.. section: Core and Builtins
+
+The int type now supports the x.is_integer() method for compatibility with
+float.
+
+..
+
+.. bpo: 41900
+.. date: 2020-10-01-10-50-12
+.. nonce: Cho7oh
+.. section: Library
+
+C14N 2.0 serialisation in xml.etree.ElementTree failed for unprefixed
+attributes when a default namespace was defined.
+
+..
+
+.. bpo: 41887
+.. date: 2020-09-30-23-49-42
+.. nonce: -ee2S-
+.. section: Library
+
+Strip leading spaces and tabs on :func:`ast.literal_eval`. Also document
+stripping of spaces and tabs for :func:`eval`.
+
+..
+
+.. bpo: 41773
+.. date: 2020-09-28-23-22-25
+.. nonce: oKkus0
+.. section: Library
+
+Note in documentation that :func:`random.choices` doesn't support non-finite
+weights, raise :exc:`ValueError` when given non-finite weights.
+
+..
+
+.. bpo: 41840
+.. date: 2020-09-23-23-17-59
+.. nonce: QRFr4L
+.. section: Library
+
+Fix a bug in the :mod:`symtable` module that was causing module-scope global
+variables to not be reported as both local and global. Patch by Pablo
+Galindo.
+
+..
+
+.. bpo: 41842
+.. date: 2020-09-23-22-52-24
+.. nonce: lIuhC9
+.. section: Library
+
+Add :func:`codecs.unregister` function to unregister a codec search
+function.
+
+..
+
+.. bpo: 40564
+.. date: 2020-09-23-03-33-37
+.. nonce: iXQqMq
+.. section: Library
+
+In ``zipfile.Path``, mutate the passed ZipFile object type instead of making
+a copy. Prevents issues when both the local copy and the caller’s copy
+attempt to close the same file handle.
+
+..
+
+.. bpo: 40670
+.. date: 2020-09-22-14-55-34
+.. nonce: R5sm68
+.. section: Library
+
+More reliable validation of statements in :class:`timeit.Timer`. It now
+accepts "empty" statements (only whitespaces and comments) and rejects
+misindentent statements.
+
+..
+
+.. bpo: 41833
+.. date: 2020-09-22-13-51-14
+.. nonce: 6HVDjT
+.. section: Library
+
+The :class:`threading.Thread` constructor now uses the target name if the
+*target* argument is specified but the *name* argument is omitted.
+
+..
+
+.. bpo: 41817
+.. date: 2020-09-22-00-23-30
+.. nonce: bnh-VG
+.. section: Library
+
+fix `tkinter.EventType` Enum so all members are strings, and none are tuples
+
+..
+
+.. bpo: 41810
+.. date: 2020-09-20-15-14-05
+.. nonce: 7l8lyV
+.. section: Library
+
+:data:`types.EllipsisType`, :data:`types.NotImplementedType` and
+:data:`types.NoneType` have been reintroduced, providing a new set of types
+readily interpretable by static type checkers.
+
+..
+
+.. bpo: 41815
+.. date: 2020-09-19-23-14-54
+.. nonce: RNpuX3
+.. section: Library
+
+Fix SQLite3 segfault when backing up closed database. Patch contributed by
+Peter David McCormick.
+
+..
+
+.. bpo: 41816
+.. date: 2020-09-19-12-22-08
+.. nonce: ynynXJ
+.. section: Library
+
+StrEnum added: it ensures that all members are already strings or string
+candidates
+
+..
+
+.. bpo: 41517
+.. date: 2020-09-15-22-43-30
+.. nonce: sLBH7g
+.. section: Library
+
+fix bug allowing Enums to be extended via multiple inheritance
+
+..
+
+.. bpo: 39587
+.. date: 2020-09-15-14-56-13
+.. nonce: 69xzuh
+.. section: Library
+
+use the correct mix-in data type when constructing Enums
+
+..
+
+.. bpo: 41792
+.. date: 2020-09-15-07-55-35
+.. nonce: qMpSlU
+.. section: Library
+
+Add is_typeddict function to typing.py to check if a type is a TypedDict
+class
+
+Previously there was no way to check that without using private API. See the
+`relevant issue in python/typing
+<https://github.com/python/typing/issues/751>`
+
+..
+
+.. bpo: 41789
+.. date: 2020-09-14-19-27-46
+.. nonce: pI_uZQ
+.. section: Library
+
+Honor `object` overrides in `Enum` class creation (specifically, `__str__`,
+`__repr__`, `__format__`, and `__reduce_ex__`).
+
+..
+
+.. bpo: 32218
+.. date: 2020-09-12-16-18-42
+.. nonce: IpYkEe
+.. section: Library
+
+`enum.Flag` and `enum.IntFlag` members are now iterable
+
+..
+
+.. bpo: 39651
+.. date: 2020-09-11-12-38-55
+.. nonce: JMp9l2
+.. section: Library
+
+Fix a race condition in the ``call_soon_threadsafe()`` method of
+``asyncio.ProactorEventLoop``: do nothing if the self-pipe socket has been
+closed.
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-08-13-55-34
+.. nonce: 56MLP-
+.. section: Library
+
+Port the ``mashal`` extension module to the multi-phase initialization API
+(:pep:`489`).
+
+..
+
+.. bpo: 1635741
+.. date: 2020-09-08-13-51-16
+.. nonce: wkPeoT
+.. section: Library
+
+Port the ``_string`` extension module to the multi-phase initialization API
+(:pep:`489`).
+
+..
+
+.. bpo: 41732
+.. date: 2020-09-06-20-27-10
+.. nonce: 1SKv26
+.. section: Library
+
+Added an :term:`iterator` to :class:`memoryview`.
+
+..
+
+.. bpo: 41720
+.. date: 2020-09-04-20-45-38
+.. nonce: PW9MzZ
+.. section: Library
+
+Fixed :meth:`turtle.Vec2D.__rmul__` for arguments which are not int or
+float.
+
+..
+
+.. bpo: 41696
+.. date: 2020-09-03-01-35-32
+.. nonce: zkYGre
+.. section: Library
+
+Fix handling of debug mode in :func:`asyncio.run`. This allows setting
+``PYTHONASYNCIODEBUG`` or ``-X dev`` to enable asyncio debug mode when using
+:func:`asyncio.run`.
+
+..
+
+.. bpo: 41687
+.. date: 2020-09-01-15-57-51
+.. nonce: m1b1KA
+.. section: Library
+
+Fix implementation of sendfile to be compatible with Solaris.
+
+..
+
+.. bpo: 41662
+.. date: 2020-08-30-21-38-57
+.. nonce: 6e9iZn
+.. section: Library
+
+No longer override exceptions raised in ``__len__()`` of a sequence of
+parameters in :mod:`sqlite3` with :exc:`~sqlite3.ProgrammingError`.
+
+..
+
+.. bpo: 39010
+.. date: 2020-08-30-10-24-26
+.. nonce: _mzXJW
+.. section: Library
+
+Restarting a ``ProactorEventLoop`` on Windows no longer logs spurious
+``ConnectionResetErrors``.
+
+..
+
+.. bpo: 41638
+.. date: 2020-08-29-16-45-12
+.. nonce: iZfW5N
+.. section: Library
+
+:exc:`~sqlite3.ProgrammingError` message for absent parameter in
+:mod:`sqlite3` contains now the name of the parameter instead of its index
+when parameters are supplied as a dict.
+
+..
+
+.. bpo: 41662
+.. date: 2020-08-29-16-07-36
+.. nonce: Mn79zh
+.. section: Library
+
+Fixed crash when mutate list of parameters during iteration in
+:mod:`sqlite3`.
+
+..
+
+.. bpo: 41513
+.. date: 2020-08-23-14-23-18
+.. nonce: DGqc_I
+.. section: Library
+
+Improved the accuracy of math.hypot(). Internally, each step is computed
+with extra precision so that the result is now almost always correctly
+rounded.
+
+..
+
+.. bpo: 41609
+.. date: 2020-08-21-15-51-15
+.. nonce: JmiUKG
+.. section: Library
+
+The pdb whatis command correctly reports instance methods as 'Method' rather
+than 'Function'.
+
+..
+
+.. bpo: 39994
+.. date: 2020-08-15-18-17-21
+.. nonce: dOgPOh
+.. section: Library
+
+Fixed pprint's handling of dict subclasses that override __repr__.
+
+..
+
+.. bpo: 32751
+.. date: 2020-08-15-15-50-12
+.. nonce: 85je5X
+.. section: Library
+
+When cancelling the task due to a timeout, :meth:`asyncio.wait_for` will now
+wait until the cancellation is complete also in the case when *timeout* is
+<= 0, like it does with positive timeouts.
+
+..
+
+.. bpo: 37658
+.. date: 2020-08-15-15-21-40
+.. nonce: f9nivB
+.. section: Library
+
+:meth:`asyncio.wait_for` now properly handles races between cancellation of
+itself and the completion of the wrapped awaitable.
+
+..
+
+.. bpo: 40782
+.. date: 2020-08-13-08-07-25
+.. nonce: aGZqmB
+.. section: Library
+
+Change the method asyncio.AbstractEventLoop.run_in_executor to not be a
+coroutine.
+
+..
+
+.. bpo: 41520
+.. date: 2020-08-12-13-25-16
+.. nonce: BEUWa4
+.. section: Library
+
+Fix :mod:`codeop` regression that prevented turning compile warnings into
+errors.
+
+..
+
+.. bpo: 41528
+.. date: 2020-08-12-07-43-31
+.. nonce: bu83oD
+.. section: Library
+
+turtle uses math module functions to convert degrees to radians and vice
+versa and to calculate vector norm
+
+..
+
+.. bpo: 41513
+.. date: 2020-08-09-18-16-05
+.. nonce: e6K6EK
+.. section: Library
+
+Minor algorithmic improvement to math.hypot() and math.dist() giving small
+gains in speed and accuracy.
+
+..
+
+.. bpo: 41503
+.. date: 2020-08-07-15-18-16
+.. nonce: IYftcu
+.. section: Library
+
+Fixed a race between setTarget and flush in logging.handlers.MemoryHandler.
+
+..
+
+.. bpo: 41497
+.. date: 2020-08-07-06-06-29
+.. nonce: aBtsWz
+.. section: Library
+
+Fix potential UnicodeDecodeError in dis module.
+
+..
+
+.. bpo: 41467
+.. date: 2020-08-04-00-20-30
+.. nonce: Z8DgTL
+.. section: Library
+
+On Windows, fix asyncio ``recv_into()`` return value when the socket/pipe is
+closed (:exc:`BrokenPipeError`): return ``0`` rather than an empty byte
+string (``b''``).
+
+..
+
+.. bpo: 41425
+.. date: 2020-08-03-01-59-48
+.. nonce: KJo6zF
+.. section: Library
+
+Make tkinter doc example runnable.
+
+..
+
+.. bpo: 41421
+.. date: 2020-08-01-00-51-15
+.. nonce: dHKRVB
+.. section: Library
+
+Make an algebraic simplification to random.paretovariate(). It now is
+slightly less subject to round-off error and is slightly faster. Inputs that
+used to cause ZeroDivisionError now cause an OverflowError instead.
+
+..
+
+.. bpo: 41440
+.. date: 2020-07-30-14-56-58
+.. nonce: rju34k
+.. section: Library
+
+Add :func:`os.cpu_count()` support for VxWorks RTOS.
+
+..
+
+.. bpo: 41316
+.. date: 2020-07-28-12-08-58
+.. nonce: bSCbK4
+.. section: Library
+
+Fix the :mod:`tarfile` module to write only basename of TAR file to GZIP
+compression header.
+
+..
+
+.. bpo: 41384
+.. date: 2020-07-26-21-18-43
+.. nonce: MlzIgV
+.. section: Library
+
+Raise TclError instead of TypeError when an unknown option is passed to
+tkinter.OptionMenu.
+
+..
+
+.. bpo: 41317
+.. date: 2020-07-23-01-18-34
+.. nonce: O17Z6x
+.. section: Library
+
+Use add_done_callback() in asyncio.loop.sock_accept() to unsubscribe reader
+early on cancellation.
+
+..
+
+.. bpo: 41364
+.. date: 2020-07-21-21-45-55
+.. nonce: 5O-k7A
+.. section: Library
+
+Reduce import overhead of :mod:`uuid`.
+
+..
+
+.. bpo: 35328
+.. date: 2020-07-21-16-20-55
+.. nonce: jXovHb
+.. section: Library
+
+Set the environment variable ``VIRTUAL_ENV_PROMPT`` at :mod:`venv`
+activation.
+
+..
+
+.. bpo: 41341
+.. date: 2020-07-20-19-13-17
+.. nonce: wqrj8C
+.. section: Library
+
+Recursive evaluation of `typing.ForwardRef` in `get_type_hints`.
+
+..
+
+.. bpo: 41344
+.. date: 2020-07-20-13-27-48
+.. nonce: iKipNd
+.. section: Library
+
+Prevent creating :class:`shared_memory.SharedMemory` objects with
+:code:`size=0`.
+
+..
+
+.. bpo: 41333
+.. date: 2020-07-18-18-07-40
+.. nonce: upkHIm
+.. section: Library
+
+:meth:`collections.OrderedDict.pop` is now 2 times faster.
+
+..
+
+.. bpo: 41288
+.. date: 2020-07-13-15-06-35
+.. nonce: 8mn5P-
+.. section: Library
+
+Unpickling invalid NEWOBJ_EX opcode with the C implementation raises now
+UnpicklingError instead of crashing.
+
+..
+
+.. bpo: 39017
+.. date: 2020-07-12-22-16-58
+.. nonce: x3Cg-9
+.. section: Library
+
+Avoid infinite loop when reading specially crafted TAR files using the
+tarfile module (CVE-2019-20907).
+
+..
+
+.. bpo: 41273
+.. date: 2020-07-11-00-15-01
+.. nonce: SVrsJh
+.. section: Library
+
+Speed up any transport using ``_ProactorReadPipeTransport`` by calling
+``recv_into`` instead of ``recv``, thus not creating a new buffer for each
+``recv`` call in the transport's read loop.
+
+..
+
+.. bpo: 41235
+.. date: 2020-07-07-21-56-26
+.. nonce: H2csMU
+.. section: Library
+
+Fix the error handling in :meth:`ssl.SSLContext.load_dh_params`.
+
+..
+
+.. bpo: 41207
+.. date: 2020-07-06-16-58-53
+.. nonce: Emw7Nk
+.. section: Library
+
+In distutils.spawn, restore expectation that DistutilsExecError is raised
+when the command is not found.
+
+..
+
+.. bpo: 29727
+.. date: 2020-07-05-19-16-02
+.. nonce: Q6Z2rg
+.. section: Library
+
+Register :class:`array.array` as a
+:class:`~collections.abc.MutableSequence`. Patch by Pablo Galindo.
+
+..
+
+.. bpo: 39168
+.. date: 2020-07-04-21-56-46
+.. nonce: DQWsXj
+.. section: Library
+
+Remove the ``__new__`` method of :class:`typing.Generic`.
+
+..
+
+.. bpo: 41194
+.. date: 2020-07-03-13-15-08
+.. nonce: djrKjs
+.. section: Library
+
+Fix a crash in the ``_ast`` module: it can no longer be loaded more than
+once. It now uses a global state rather than a module state.
+
+..
+
+.. bpo: 41195
+.. date: 2020-07-02-15-03-04
+.. nonce: cEnpO3
+.. section: Library
+
+Add read-only ssl.SSLContext.security_level attribute to retrieve the
+context's security level.
+
+..
+
+.. bpo: 41193
+.. date: 2020-07-02-11-53-45
+.. nonce: 8-Tnql
+.. section: Library
+
+The ``write_history()`` atexit function of the readline completer now
+ignores any :exc:`OSError` to ignore error if the filesystem is read-only,
+instead of only ignoring :exc:`FileNotFoundError` and
+:exc:`PermissionError`.
+
+..
+
+.. bpo: 41182
+.. date: 2020-07-01-17-33-50
+.. nonce: FPFI0N
+.. section: Library
+
+selector: use DefaultSelector based upon implementation
+
+..
+
+.. bpo: 41161
+.. date: 2020-06-30-20-50-51
+.. nonce: QTdJjz
+.. section: Library
+
+The decimal module now requires libmpdec-2.5.0. Users of
+--with-system-libmpdec should update their system library.
+
+..
+
+.. bpo: 40874
+.. date: 2020-06-28-21-16-51
+.. nonce: YImvzA
+.. section: Library
+
+The decimal module now requires libmpdec-2.5.0.
+
+..
+
+.. bpo: 41138
+.. date: 2020-06-27-13-51-36
+.. nonce: bIpf7g
+.. section: Library
+
+Fixed the :mod:`trace` module CLI for Python source files with non-UTF-8
+encoding.
+
+..
+
+.. bpo: 31082
+.. date: 2020-06-25-10-11-47
+.. nonce: HsgDkx
+.. section: Library
+
+Use the term "iterable" in the docstring for :func:`functools.reduce`.
+
+..
+
+.. bpo: 40521
+.. date: 2020-06-23-06-09-59
+.. nonce: HUfxP7
+.. section: Library
+
+Remove freelist from collections.deque().
+
+..
+
+.. bpo: 31938
+.. date: 2020-06-22-20-08-40
+.. nonce: EVuko9
+.. section: Library
+
+Fix default-value signatures of several functions in the :mod:`select`
+module - by Anthony Sottile.
+
+..
+
+.. bpo: 41068
+.. date: 2020-06-22-10-25-39
+.. nonce: _bX2BW
+.. section: Library
+
+Fixed reading files with non-ASCII names from ZIP archive directly after
+writing them.
+
+..
+
+.. bpo: 41058
+.. date: 2020-06-20-21-03-55
+.. nonce: gztdZy
+.. section: Library
+
+:func:`pdb.find_function` now correctly determines the source file encoding.
+
+..
+
+.. bpo: 41056
+.. date: 2020-06-20-18-37-29
+.. nonce: d9v_uL
+.. section: Library
+
+Invalid file descriptor values are now prevented from being passed to
+os.fpathconf. (discovered by Coverity)
+
+..
+
+.. bpo: 41056
+.. date: 2020-06-20-18-35-43
+.. nonce: Garcle
+.. section: Library
+
+Fix a NULL pointer dereference within the ssl module during a MemoryError in
+the keylog callback. (discovered by Coverity)
+
+..
+
+.. bpo: 41056
+.. date: 2020-06-20-18-33-03
+.. nonce: gTH4Bq
+.. section: Library
+
+Fixed an instance where a MemoryError within the zoneinfo module might not
+be reported or not reported at its source. (found by Coverity)
+
+..
+
+.. bpo: 41048
+.. date: 2020-06-20-10-16-57
+.. nonce: hEXB-B
+.. section: Library
+
+:func:`mimetypes.read_mime_types` function reads the rule file using UTF-8
+encoding, not the locale encoding. Patch by Srinivas Reddy Thatiparthy.
+
+..
+
+.. bpo: 41043
+.. date: 2020-06-20-00-19-30
+.. nonce: p-Pk-H
+.. section: Library
+
+Fixed the use of :func:`~glob.glob` in the stdlib: literal part of the path
+is now always correctly escaped.
+
+..
+
+.. bpo: 41025
+.. date: 2020-06-18-10-34-59
+.. nonce: elf_nz
+.. section: Library
+
+Fixed an issue preventing the C implementation of :class:`zoneinfo.ZoneInfo`
+from being subclassed.
+
+..
+
+.. bpo: 35018
+.. date: 2020-06-17-23-49-45
+.. nonce: NP5_Qk
+.. section: Library
+
+Add the :class:`xml.sax.handler.LexicalHandler` class that is present in
+other SAX XML implementations.
+
+..
+
+.. bpo: 41002
+.. date: 2020-06-17-17-26-24
+.. nonce: NPBItE
+.. section: Library
+
+Improve performance of HTTPResponse.read with a given amount. Patch by Bruce
+Merry.
+
+..
+
+.. bpo: 40448
+.. date: 2020-06-15-12-22-53
+.. nonce: 1dk8Bu
+.. section: Library
+
+:mod:`ensurepip` now disables the use of `pip` cache when installing the
+bundled versions of `pip` and `setuptools`. Patch by Krzysztof Konopko.
+
+..
+
+.. bpo: 40967
+.. date: 2020-06-15-00-13-57
+.. nonce: _dx3OO
+.. section: Library
+
+Removed :meth:`asyncio.Task.current_task` and
+:meth:`asyncio.Task.all_tasks`. Patch contributed by Rémi Lapeyre.
+
+..
+
+.. bpo: 40924
+.. date: 2020-06-13-12-04-50
+.. nonce: SM_luS
+.. section: Library
+
+Ensure ``importlib.resources.path`` returns an extant path for the
+SourceFileLoader's resource reader. Avoids the regression identified in
+master while a long-term solution is devised.
+
+..
+
+.. bpo: 40955
+.. date: 2020-06-12-11-55-30
+.. nonce: huixCg
+.. section: Library
+
+Fix a minor memory leak in :mod:`subprocess` module when extra_groups was
+specified.
+
+..
+
+.. bpo: 40855
+.. date: 2020-06-12-10-44-15
+.. nonce: jSot83
+.. section: Library
+
+The standard deviation and variance functions in the statistics module were
+ignoring their mu and xbar arguments.
+
+..
+
+.. bpo: 40939
+.. date: 2020-06-11-11-07-10
+.. nonce: -D5Asl
+.. section: Library
+
+Use the new PEG parser when generating the stdlib :mod:`keyword` module.
+
+..
+
+.. bpo: 23427
+.. date: 2020-06-08-18-59-16
+.. nonce: ilg1Cz
+.. section: Library
+
+Add :data:`sys.orig_argv` attribute: the list of the original command line
+arguments passed to the Python executable.
+
+..
+
+.. bpo: 33689
+.. date: 2020-06-06-14-09-55
+.. nonce: EFUDH7
+.. section: Library
+
+Ignore empty or whitespace-only lines in .pth files. This matches the
+documentated behavior. Before, empty lines caused the site-packages dir to
+appear multiple times in sys.path. By Ido Michael, contributors Malcolm
+Smith and Tal Einat.
+
+..
+
+.. bpo: 40884
+.. date: 2020-06-06-02-42-26
+.. nonce: n7fOwS
+.. section: Library
+
+Added a `defaults` parameter to :class:`logging.Formatter`, to allow
+specifying default values for custom fields. Patch by Asaf Alon and Bar
+Harel.
+
+..
+
+.. bpo: 40876
+.. date: 2020-06-05-20-00-18
+.. nonce: zDhiZj
+.. section: Library
+
+Clarify error message in the :mod:`csv` module.
+
+..
+
+.. bpo: 39791
+.. date: 2020-06-05-19-29-10
+.. nonce: _CcO3d
+.. section: Library
+
+Refresh importlib.metadata from importlib_metadata 1.6.1.
+
+..
+
+.. bpo: 40807
+.. date: 2020-06-04-16-25-15
+.. nonce: yYyLWx
+.. section: Library
+
+Stop codeop._maybe_compile, used by code.InteractiveInterpreter (and IDLE).
+from emitting each warning three times.
+
+..
+
+.. bpo: 32604
+.. date: 2020-06-02-23-49-07
+.. nonce: ZN4V4l
+.. section: Library
+
+Fix reference leak in the :mod:`select` module when the module is imported
+in a subinterpreter.
+
+..
+
+.. bpo: 39791
+.. date: 2020-06-02-02-16-02
+.. nonce: StCJlA
+.. section: Library
+
+Built-in loaders (SourceFileLoader and ZipImporter) now supply
+``TraversableResources`` implementations for ``ResourceReader``, and the
+fallback function has been removed.
+
+..
+
+.. bpo: 39314
+.. date: 2020-06-01-02-16-29
+.. nonce: 0T9hlA
+.. section: Library
+
+:class:`rlcompleter.Completer` and the standard Python shell now close the
+parenthesis for functions that take no arguments. Patch contributed by Rémi
+Lapeyre.
+
+..
+
+.. bpo: 17005
+.. date: 2020-05-31-23-32-36
+.. nonce: JlRUGB
+.. section: Library
+
+The topological sort functionality that was introduced initially in the
+:mod:`functools` module has been moved to a new :mod:`graphlib` module to
+better accommodate the new tools and keep the original scope of the
+:mod:`functools` module. Patch by Pablo Galindo
+
+..
+
+.. bpo: 40834
+.. date: 2020-05-31-15-52-18
+.. nonce: MO9_hb
+.. section: Library
+
+Fix truncate when sending str object with_xxsubinterpreters.channel_send.
+
+..
+
+.. bpo: 40755
+.. date: 2020-05-30-18-48-58
+.. nonce: IyOe2J
+.. section: Library
+
+Add rich comparisons to collections.Counter().
+
+..
+
+.. bpo: 26407
+.. date: 2020-05-30-14-19-47
+.. nonce: MjWLO1
+.. section: Library
+
+Unexpected errors in calling the ``__iter__`` method are no longer masked by
+``TypeError`` in :func:`csv.reader`, :func:`csv.writer.writerow` and
+:meth:`csv.writer.writerows`.
+
+..
+
+.. bpo: 39384
+.. date: 2020-05-30-12-44-29
+.. nonce: Iqxy3q
+.. section: Library
+
+Fixed email.contentmanager to allow set_content() to set a null string.
+
+..
+
+.. bpo: 40744
+.. date: 2020-05-30-08-10-23
+.. nonce: jKURVV
+.. section: Library
+
+The :mod:`sqlite3` module uses SQLite API functions that require SQLite
+v3.7.3 or higher. This patch removes support for older SQLite versions, and
+explicitly requires SQLite 3.7.3 both at build, compile and runtime. Patch
+by Sergey Fedoseev and Erlend E. Aasland.
+
+..
+
+.. bpo: 40777
+.. date: 2020-05-28-17-32-29
+.. nonce: 1kJU6N
+.. section: Library
+
+Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time to avoid
+errors on some compilers.
+
+..
+
+.. bpo: 38488
+.. date: 2020-05-28-16-51-00
+.. nonce: hFQNgA
+.. section: Library
+
+Update ensurepip to install pip 20.1.1 and setuptools 47.1.0.
+
+..
+
+.. bpo: 40792
+.. date: 2020-05-27-22-19-42
+.. nonce: 87Yx01
+.. section: Library
+
+The result of :func:`operator.index` now always has exact type :class:`int`.
+Previously, the result could have been an instance of a subclass of ``int``.
+
+..
+
+.. bpo: 40767
+.. date: 2020-05-27-21-27-01
+.. nonce: L5MnVV
+.. section: Library
+
+:mod:`webbrowser` now properly finds the default browser in pure Wayland
+systems by checking the WAYLAND_DISPLAY environment variable. Patch
+contributed by Jérémy Attali.
+
+..
+
+.. bpo: 40791
+.. date: 2020-05-27-18-04-52
+.. nonce: IzpNor
+.. section: Library
+
+:func:`hashlib.compare_digest` uses OpenSSL's ``CRYPTO_memcmp()`` function
+when OpenSSL is available.
+
+..
+
+.. bpo: 40795
+.. date: 2020-05-27-17-00-18
+.. nonce: eZSnHA
+.. section: Library
+
+:mod:`ctypes` module: If ctypes fails to convert the result of a callback or
+if a ctypes callback function raises an exception, sys.unraisablehook is now
+called with an exception set. Previously, the error was logged into stderr
+by :c:func:`PyErr_Print`.
+
+..
+
+.. bpo: 16995
+.. date: 2020-05-27-00-09-52
+.. nonce: 4niOT7
+.. section: Library
+
+Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` to support
+the Base32 Encoding with Extended Hex Alphabet.
+
+..
+
+.. bpo: 30008
+.. date: 2020-05-25-22-18-38
+.. nonce: CKC3td
+.. section: Library
+
+Fix :mod:`ssl` code to be compatible with OpenSSL 1.1.x builds that use
+``no-deprecated`` and ``--api=1.1.0``.
+
+..
+
+.. bpo: 30064
+.. date: 2020-05-25-11-52-23
+.. nonce: 6CICsH
+.. section: Library
+
+Fix asyncio ``loop.sock_*`` race condition issue
+
+..
+
+.. bpo: 40759
+.. date: 2020-05-24-23-52-35
+.. nonce: DdZdaw
+.. section: Library
+
+Deprecate the :mod:`symbol` module.
+
+..
+
+.. bpo: 40756
+.. date: 2020-05-24-11-06-37
+.. nonce: 7ZH83z
+.. section: Library
+
+The second argument (extra) of ``LoggerAdapter.__init__`` now defaults to
+None.
+
+..
+
+.. bpo: 37129
+.. date: 2020-05-23-04-18-00
+.. nonce: YoYoYo
+.. section: Library
+
+Add a new :data:`os.RWF_APPEND` flag for :func:`os.pwritev`.
+
+..
+
+.. bpo: 40737
+.. date: 2020-05-23-00-22-11
+.. nonce: iph-CM
+.. section: Library
+
+Fix possible reference leak for :mod:`sqlite3` initialization.
+
+..
+
+.. bpo: 40726
+.. date: 2020-05-22-12-45-58
+.. nonce: 7oBdMw
+.. section: Library
+
+Handle cases where the ``end_lineno`` is ``None`` on
+:func:`ast.increment_lineno`.
+
+..
+
+.. bpo: 40698
+.. date: 2020-05-20-14-38-04
+.. nonce: zwl5Hc
+.. section: Library
+
+:mod:`distutils` upload creates SHA2-256 and Blake2b-256 digests. MD5
+digests is skipped if platform blocks MD5.
+
+..
+
+.. bpo: 40695
+.. date: 2020-05-20-13-03-28
+.. nonce: lr4aIS
+.. section: Library
+
+:mod:`hashlib` no longer falls back to builtin hash implementations when
+OpenSSL provides a hash digest and the algorithm is blocked by security
+policy.
+
+..
+
+.. bpo: 9216
+.. date: 2020-05-20-12-53-20
+.. nonce: ps7Yf1
+.. section: Library
+
+func:`hashlib.new` passed ``usedforsecurity`` to OpenSSL EVP constructor
+``_hashlib.new()``. test_hashlib and test_smtplib handle strict security
+policy better.
+
+..
+
+.. bpo: 40614
+.. date: 2020-05-18-22-41-02
+.. nonce: 8j3kmq
+.. section: Library
+
+:func:`ast.parse` will not parse self documenting expressions in f-strings
+when passed ``feature_version`` is less than ``(3, 8)``.
+
+..
+
+.. bpo: 40626
+.. date: 2020-05-18-17-29-30
+.. nonce: NeZufF
+.. section: Library
+
+Add h5 file extension as MIME Type application/x-hdf5, as per HDF Group
+recommendation for HDF5 formatted data files. Patch contributed by Mark
+Schwab.
+
+..
+
+.. bpo: 25920
+.. date: 2020-05-18-15-38-25
+.. nonce: PxrLY8
+.. section: Library
+
+On macOS, when building Python for macOS 10.4 and older, which wasn't the
+case for python.org macOS installer, :func:`socket.getaddrinfo` no longer
+uses an internal lock to prevent race conditions when calling
+``getaddrinfo()`` which is thread-safe since macOS 10.5. Python 3.9 requires
+macOS 10.6 or newer. The internal lock caused random hang on fork when
+another thread was calling :func:`socket.getaddrinfo`. The lock was also
+used on FreeBSD older than 5.3, OpenBSD older than 201311 and NetBSD older
+than 4.
+
+..
+
+.. bpo: 40671
+.. date: 2020-05-18-15-26-31
+.. nonce: NeZ9Cy
+.. section: Library
+
+Prepare ``_hashlib`` for :pep:`489` and use :c:func:`PyModule_AddType`.
+
+..
+
+.. bpo: 32309
+.. date: 2020-05-17-02-03-09
+.. nonce: KM9psl
+.. section: Library
+
+Added a new :term:`coroutine` :func:`asyncio.to_thread`. It is mainly used
+for running IO-bound functions in a separate thread to avoid blocking the
+event loop, and essentially works as a high-level version of
+:meth:`~asyncio.loop.run_in_executor` that can directly take keyword
+arguments.
+
+..
+
+.. bpo: 36543
+.. date: 2020-05-15-21-14-45
+.. nonce: Jt-eSX
+.. section: Library
+
+Restored the deprecated :mod:`xml.etree.cElementTree` module.
+
+..
+
+.. bpo: 40611
+.. date: 2020-05-13-16-28-33
+.. nonce: ZCk0_c
+.. section: Library
+
+:data:`~mmap.MAP_POPULATE` constant has now been added to the list of
+exported :mod:`mmap` module flags.
+
+..
+
+.. bpo: 39881
+.. date: 2020-05-07-22-00-12
+.. nonce: E1xsNv
+.. section: Library
+
+PEP 554 for use in the test suite. (Patch By Joannah Nanjekye)
+
+..
+
+.. bpo: 13097
+.. date: 2020-05-06-02-01-25
+.. nonce: Wh5xSK
+.. section: Library
+
+``ctypes`` now raises an ``ArgumentError`` when a callback is invoked with
+more than 1024 arguments.
+
+..
+
+.. bpo: 39385
+.. date: 2020-04-23-18-21-19
+.. nonce: MIAyS7
+.. section: Library
+
+A new test assertion context-manager, :func:`unittest.assertNoLogs` will
+ensure a given block of code emits no log messages using the logging module.
+Contributed by Kit Yan Choi.
+
+..
+
+.. bpo: 23082
+.. date: 2020-04-20-22-08-36
+.. nonce: iX90Id
+.. section: Library
+
+Updated the error message and docs of PurePath.relative_to() to better
+reflect the function behaviour.
+
+..
+
+.. bpo: 40318
+.. date: 2020-04-18-14-16-02
+.. nonce: K2UdRx
+.. section: Library
+
+Use SQLite3 trace v2 API, if it is available.
+
+..
+
+.. bpo: 40105
+.. date: 2020-04-03-16-13-59
+.. nonce: hfM2c0
+.. section: Library
+
+ZipFile truncates files to avoid corruption when a shorter comment is
+provided in append ("a") mode. Patch by Jan Mazur.
+
+..
+
+.. bpo: 40084
+.. date: 2020-03-29-21-32-00
+.. nonce: MCYwcv
+.. section: Library
+
+Fix ``Enum.__dir__``: dir(Enum.member) now includes attributes as well as
+methods.
+
+..
+
+.. bpo: 31122
+.. date: 2020-03-11-07-44-06
+.. nonce: zIQ80l
+.. section: Library
+
+ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer
+closes connection during TLS negotiation
+
+..
+
+.. bpo: 39728
+.. date: 2020-02-24-10-58-34
+.. nonce: kOOaHn
+.. section: Library
+
+fix default `_missing_` so a duplicate `ValueError` is not set as the
+`__context__` of the original `ValueError`
+
+..
+
+.. bpo: 39244
+.. date: 2020-02-23-15-09-47
+.. nonce: aBK5IM
+.. section: Library
+
+Fixed :class:`multiprocessing.context.get_all_start_methods` to properly
+return the default method first on macOS.
+
+..
+
+.. bpo: 39040
+.. date: 2019-12-15-18-47-20
+.. nonce: tKa0Qs
+.. section: Library
+
+Fix parsing of invalid mime headers parameters by collapsing whitespace
+between encoded words in a bare-quote-string.
+
+..
+
+.. bpo: 38731
+.. date: 2019-11-13-07-37-11
+.. nonce: 9qmcSx
+.. section: Library
+
+Add ``--quiet`` option to command-line interface of :mod:`py_compile`. Patch
+by Gregory Schevchenko.
+
+..
+
+.. bpo: 35714
+.. date: 2019-10-25-23-45-49
+.. nonce: fw3xb7
+.. section: Library
+
+:exc:`struct.error` is now raised if there is a null character in a
+:mod:`struct` format string.
+
+..
+
+.. bpo: 38144
+.. date: 2019-09-12-21-34-03
+.. nonce: 8uQCdd
+.. section: Library
+
+Added the *root_dir* and *dir_fd* parameters in :func:`glob.glob`.
+
+..
+
+.. bpo: 26543
+.. date: 2019-08-11-16-28-03
+.. nonce: X-TJZO
+.. section: Library
+
+Fix :meth:`IMAP4.noop()` when debug mode is enabled (ex: ``imaplib.Debug =
+3``).
+
+..
+
+.. bpo: 12178
+.. date: 2019-05-31-23-54-28
+.. nonce: N6FLCZ
+.. section: Library
+
+:func:`csv.writer` now correctly escapes *escapechar* when input contains
+*escapechar*. Patch by Catalin Iacob, Berker Peksag, and Itay Elbirt.
+
+..
+
+.. bpo: 36290
+.. date: 2019-03-17-19-01-53
+.. nonce: 7VXo_K
+.. section: Library
+
+AST nodes are now raising :exc:`TypeError` on conflicting keyword arguments.
+Patch contributed by Rémi Lapeyre.
+
+..
+
+.. bpo: 33944
+.. date: 2019-03-01-01-56-23
+.. nonce: -82Pkt
+.. section: Library
+
+Added site.py site-packages tracing in verbose mode.
+
+..
+
+.. bpo: 35078
+.. date: 2018-10-27-09-37-03
+.. nonce: kweA3R
+.. section: Library
+
+Refactor formatweekday, formatmonthname methods in LocaleHTMLCalendar and
+LocaleTextCalendar classes in calendar module to call the base class
+methods.This enables customizable CSS classes for LocaleHTMLCalendar. Patch
+by Srinivas Reddy Thatiparthy
+
+..
+
+.. bpo: 29620
+.. date: 2018-08-21-16-20-33
+.. nonce: xxx666
+.. section: Library
+
+:func:`~unittest.TestCase.assertWarns` no longer raises a
+``RuntimeException`` when accessing a module's ``__warningregistry__``
+causes importation of a new module, or when a new module is imported in
+another thread. Patch by Kernc.
+
+..
+
+.. bpo: 31844
+.. date: 2018-07-30-12-48-17
+.. nonce: 0_GKsD
+.. section: Library
+
+Remove ``ParserBase.error()`` method from the private and undocumented
+``_markupbase`` module. :class:`html.parser.HTMLParser` is the only
+subclass of ``ParserBase`` and its ``error()`` implementation was deprecated
+in Python 3.4 and removed in Python 3.5.
+
+..
+
+.. bpo: 34226
+.. date: 2018-07-29-12-14-54
+.. nonce: BE7zbu
+.. section: Library
+
+Fix `cgi.parse_multipart` without content_length. Patch by Roger Duran
+
+..
+
+.. bpo: 33660
+.. date: 2018-06-12-23-30-41
+.. nonce: AdDn5Z
+.. section: Library
+
+Fix pathlib.PosixPath to resolve a relative path located on the root
+directory properly.
+
+..
+
+.. bpo: 28557
+.. date: 2018-06-07-22-04-01
+.. nonce: ViNJnK
+.. section: Library
+
+Improve the error message for a misbehaving ``rawio.readinto``
+
+..
+
+.. bpo: 26680
+.. date: 2018-03-15-11-56-48
+.. nonce: Udkhn4
+.. section: Library
+
+The d.is_integer() method is added to the Decimal type, for compatibility
+with other number types.
+
+..
+
+.. bpo: 26680
+.. date: 2018-03-15-11-55-04
+.. nonce: eKAi85
+.. section: Library
+
+The x.is_integer() method is incorporated into the abstract types of the
+numeric tower, Real, Rational and Integral, with appropriate default
+implementations.
+
+..
+
+.. bpo: 41428
+.. date: 2020-10-03-18-20-46
+.. nonce: _ju1NE
+.. section: Documentation
+
+Add documentation for :pep:`604` (Allow writing union types as ``X | Y``).
+
+..
+
+.. bpo: 41774
+.. date: 2020-09-24-15-35-13
+.. nonce: 5IqdGP
+.. section: Documentation
+
+In Programming FAQ "Sequences (Tuples/Lists)" section, add "How do you
+remove multiple items from a list".
+
+..
+
+.. bpo: 35293
+.. date: 2020-09-12-17-37-13
+.. nonce: _cOwPD
+.. section: Documentation
+
+Fix RemovedInSphinx40Warning when building the documentation. Patch by
+Dong-hee Na.
+
+..
+
+.. bpo: 37149
+.. date: 2020-09-10-07-48-02
+.. nonce: VD0rCv
+.. section: Documentation
+
+Change Shipman tkinter doc link from archive.org to TkDocs. (The doc has
+been removed from the NMT server.) The new link responds much faster and
+includes a short explanatory note.
+
+..
+
+.. bpo: 41726
+.. date: 2020-09-08-16-57-09
+.. nonce: g0UXrn
+.. section: Documentation
+
+Update the refcounts info of ``PyType_FromModuleAndSpec``.
+
+..
+
+.. bpo: 41624
+.. date: 2020-08-25-15-11-23
+.. nonce: ddjJlN
+.. section: Documentation
+
+Fix the signature of :class:`typing.Coroutine`.
+
+..
+
+.. bpo: 40204
+.. date: 2020-08-12-18-35-40
+.. nonce: C8A_pe
+.. section: Documentation
+
+Enable Sphinx 3.2 ``c_allow_pre_v3`` option and disable
+``c_warn_on_allowed_pre_v3`` option to make the documentation compatible
+with Sphinx 2 and Sphinx 3.
+
+..
+
+.. bpo: 41045
+.. date: 2020-07-27-20-46-17
+.. nonce: GFF6Ul
+.. section: Documentation
+
+Add documentation for debug feature of f-strings.
+
+..
+
+.. bpo: 41314
+.. date: 2020-07-25-14-20-00
+.. nonce: yrjko0
+.. section: Documentation
+
+Changed the release when ``from __future__ import annotations`` becomes the
+default from ``4.0`` to ``3.10`` (following a change in PEP 563).
+
+..
+
+.. bpo: 40979
+.. date: 2020-07-21-15-23-30
+.. nonce: pLA8rO
+.. section: Documentation
+
+Refactored typing.rst, arranging more than 70 classes, functions, and
+decorators into new sub-sections.
+
+..
+
+.. bpo: 40552
+.. date: 2020-05-09-12-10-31
+.. nonce: _0uB73
+.. section: Documentation
+
+Fix in tutorial section 4.2. Code snippet is now correct.
+
+..
+
+.. bpo: 39883
+.. date: 2020-03-07-03-53-39
+.. nonce: 1tnb4-
+.. section: Documentation
+
+Make code, examples, and recipes in the Python documentation be licensed
+under the more permissive BSD0 license in addition to the existing Python
+2.0 license.
+
+..
+
+.. bpo: 37703
+.. date: 2019-08-16-20-25-42
+.. nonce: Qm_l_H
+.. section: Documentation
+
+Updated Documentation to comprehensively elaborate on the behaviour of
+gather.cancel()
+
+..
+
+.. bpo: 41939
+.. date: 2020-10-05-09-37-43
+.. nonce: P4OlbA
+.. section: Tests
+
+Fix test_site.test_license_exists_at_url(): call
+``urllib.request.urlcleanup()`` to reset the global
+``urllib.request._opener``. Patch by Victor Stinner.
+
+..
+
+.. bpo: 41731
+.. date: 2020-09-11-19-12-31
+.. nonce: Ivxh4U
+.. section: Tests
+
+Make test_cmd_line_script pass with option '-vv'.
+
+..
+
+.. bpo: 41602
+.. date: 2020-08-25-19-25-36
+.. nonce: Z64s0I
+.. section: Tests
+
+Add tests for SIGINT handling in the runpy module.
+
+..
+
+.. bpo: 41521
+.. date: 2020-08-11-14-59-13
+.. nonce: w2UYK7
+.. section: Tests
+
+:mod:`test.support`: Rename ``blacklist`` parameter of
+:func:`~test.support.check__all__` to ``not_exported``.
+
+..
+
+.. bpo: 41477
+.. date: 2020-08-07-17-28-49
+.. nonce: GrFexU
+.. section: Tests
+
+Make ctypes optional in test_genericalias.
+
+..
+
+.. bpo: 41085
+.. date: 2020-06-23-12-02-45
+.. nonce: JZKsyz
+.. section: Tests
+
+Fix integer overflow in the :meth:`array.array.index` method on 64-bit
+Windows for index larger than ``2**31``.
+
+..
+
+.. bpo: 41069
+.. date: 2020-06-22-00-21-12
+.. nonce: bLZkX-
+.. section: Tests
+
+:data:`test.support.TESTFN` and the current directory for tests when run via
+``test.regrtest`` contain now non-ascii characters if possible.
+
+..
+
+.. bpo: 38377
+.. date: 2020-06-17-18-00-21
+.. nonce: jfg4TH
+.. section: Tests
+
+On Linux, skip tests using multiprocessing if the current user cannot create
+a file in ``/dev/shm/`` directory. Add the
+:func:`~test.support.skip_if_broken_multiprocessing_synchronize` function to
+the :mod:`test.support` module.
+
+..
+
+.. bpo: 41009
+.. date: 2020-06-17-17-27-07
+.. nonce: Rvn6OQ
+.. section: Tests
+
+Fix use of ``support.require_{linux|mac|freebsd}_version()`` decorators as
+class decorator.
+
+..
+
+.. bpo: 41003
+.. date: 2020-06-17-15-07-14
+.. nonce: tiH_Fy
+.. section: Tests
+
+Fix ``test_copyreg`` when ``numpy`` is installed: ``test.pickletester`` now
+saves/restores warnings filters when importing ``numpy``, to ignore filters
+installed by ``numpy``.
+
+..
+
+.. bpo: 40964
+.. date: 2020-06-12-20-46-23
+.. nonce: OBzf2c
+.. section: Tests
+
+Disable remote :mod:`imaplib` tests, host cyrus.andrew.cmu.edu is blocking
+incoming connections.
+
+..
+
+.. bpo: 40927
+.. date: 2020-06-09-18-48-18
+.. nonce: 67ylLg
+.. section: Tests
+
+Fix test_binhex when run twice: it now uses import_fresh_module() to ensure
+that it raises DeprecationWarning each time.
+
+..
+
+.. bpo: 17258
+.. date: 2020-05-26-07-53-31
+.. nonce: X_IKTQ
+.. section: Tests
+
+Skip some :mod:`multiprocessing` tests when MD5 hash digest is blocked.
+
+..
+
+.. bpo: 31904
+.. date: 2020-04-09-15-40-03
+.. nonce: TJ4k3d
+.. section: Tests
+
+Increase LOOPBACK_TIMEOUT to 10 for VxWorks RTOS.
+
+..
+
+.. bpo: 38169
+.. date: 2019-09-14-13-20-27
+.. nonce: hurq4B
+.. section: Tests
+
+Increase code coverage for SharedMemory and ShareableList
+
+..
+
+.. bpo: 34401
+.. date: 2018-08-20-09-38-52
+.. nonce: eGxMPm
+.. section: Tests
+
+Make test_gdb properly run on HP-UX. Patch by Michael Osipov.
+
+..
+
+.. bpo: 38249
+.. date: 2020-09-28-21-56-51
+.. nonce: uzMCaZ
+.. section: Build
+
+Update :c:macro:`Py_UNREACHABLE` to use __builtin_unreachable() if only the
+compiler is able to use it. Patch by Dong-hee Na.
+
+..
+
+.. bpo: 41617
+.. date: 2020-08-24-18-34-01
+.. nonce: sKKXz7
+.. section: Build
+
+Fix ``pycore_bitutils.h`` header file to support old clang versions:
+``__builtin_bswap16()`` is not available in LLVM clang 3.0.
+
+..
+
+.. bpo: 40204
+.. date: 2020-06-25-06-59-13
+.. nonce: GpD04D
+.. section: Build
+
+Pin Sphinx version to 2.3.1 in ``Doc/Makefile``.
+
+..
+
+.. bpo: 36020
+.. date: 2020-06-15-22-14-25
+.. nonce: wbiv0P
+.. section: Build
+
+The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now
+required to build Python.
+
+..
+
+.. bpo: 40684
+.. date: 2020-06-08-19-57-05
+.. nonce: WIY2-i
+.. section: Build
+
+``make install`` now uses the ``PLATLIBDIR`` variable for the destination
+``lib-dynload/`` directory when ``./configure --with-platlibdir`` is used.
+
+..
+
+.. bpo: 40683
+.. date: 2020-05-19-10-54-08
+.. nonce: W8JHrr
+.. section: Build
+
+Fixed an issue where the :mod:`zoneinfo` module and its tests were not
+included when Python is installed with ``make``.
+
+..
+
+.. bpo: 41744
+.. date: 2020-09-11-17-59-33
+.. nonce: e_ugDQ
+.. section: Windows
+
+Fixes automatic import of props file when using the Nuget package.
+
+..
+
+.. bpo: 41627
+.. date: 2020-09-04-21-35-28
+.. nonce: sx2KN1
+.. section: Windows
+
+The user site directory for 32-bit now includes a ``-32`` suffix to
+distinguish it from the 64-bit interpreter's directory.
+
+..
+
+.. bpo: 41526
+.. date: 2020-08-13-22-40-58
+.. nonce: -i2bwb
+.. section: Windows
+
+Fixed layout of final page of the installer by removing the special thanks
+to Mark Hammond (with his permission).
+
+..
+
+.. bpo: 41492
+.. date: 2020-08-06-16-59-10
+.. nonce: 2FQ9cM
+.. section: Windows
+
+Fixes the description that appears in UAC prompts.
+
+..
+
+.. bpo: 40948
+.. date: 2020-07-28-12-39-32
+.. nonce: ISUFO6
+.. section: Windows
+
+Improve post-install message to direct people to the "py" command.
+
+..
+
+.. bpo: 41412
+.. date: 2020-07-28-11-55-43
+.. nonce: ME20KB
+.. section: Windows
+
+The installer will now fail to install on Windows 7 and Windows 8. Further,
+the UCRT dependency is now always downloaded on demand.
+
+..
+
+.. bpo: 40741
+.. date: 2020-07-20-23-26-26
+.. nonce: C9sc_d
+.. section: Windows
+
+Update Windows release to include SQLite 3.32.3.
+
+..
+
+.. bpo: 41142
+.. date: 2020-06-28-12-40-41
+.. nonce: jpZzzh
+.. section: Windows
+
+:mod:`msilib` now supports creating CAB files with non-ASCII file path and
+adding files with non-ASCII file path to them.
+
+..
+
+.. bpo: 41074
+.. date: 2020-06-24-21-30-42
+.. nonce: gaQc3C
+.. section: Windows
+
+Fixed support of non-ASCII names in functions :func:`msilib.OpenDatabase`
+and :func:`msilib.init_database` and non-ASCII SQL in method
+:meth:`msilib.Database.OpenView`.
+
+..
+
+.. bpo: 41039
+.. date: 2020-06-23-03-12-57
+.. nonce: 0hgd0s
+.. section: Windows
+
+Stable ABI redirection DLL (python3.dll) now uses ``#pragma
+comment(linker)`` for re-exporting.
+
+..
+
+.. bpo: 40164
+.. date: 2020-06-12-13-13-44
+.. nonce: SPrSn5
+.. section: Windows
+
+Updates Windows OpenSSL to 1.1.1g
+
+..
+
+.. bpo: 39631
+.. date: 2020-05-19-14-43-33
+.. nonce: Z5yXam
+.. section: Windows
+
+Changes the registered MIME type for ``.py`` files on Windows to
+``text/x-python`` instead of ``text/plain``.
+
+..
+
+.. bpo: 40677
+.. date: 2020-05-19-04-11-12
+.. nonce: qQbLW8
+.. section: Windows
+
+Manually define IO_REPARSE_TAG_APPEXECLINK in case some old Windows SDK
+doesn't have it.
+
+..
+
+.. bpo: 37556
+.. date: 2019-07-11-06-11-09
+.. nonce: sygMUU
+.. section: Windows
+
+Extend py.exe help to mention overrides via venv, shebang, environmental
+variables & ini files.
+
+..
+
+.. bpo: 41557
+.. date: 2020-08-26-09-31-37
+.. nonce: mcQ75z
+.. section: macOS
+
+Update macOS installer to use SQLite 3.33.0.
+
+..
+
+.. bpo: 39580
+.. date: 2020-06-25-06-09-00
+.. nonce: N_vJ9h
+.. section: macOS
+
+Avoid opening Finder window if running installer from the command line.
+Patch contributed by Rick Heil.
+
+..
+
+.. bpo: 41100
+.. date: 2020-06-24-13-51-57
+.. nonce: mcHdc5
+.. section: macOS
+
+Fix configure error when building on macOS 11. Note that the current Python
+release was released shortly after the first developer preview of macOS 11
+(Big Sur); there are other known issues with building and running on the
+developer preview. Big Sur is expected to be fully supported in a future
+bugfix release of Python 3.8.x and with 3.9.0.
+
+..
+
+.. bpo: 40741
+.. date: 2020-06-19-14-19-08
+.. nonce: L7yTbm
+.. section: macOS
+
+Update macOS installer to use SQLite 3.32.3.
+
+..
+
+.. bpo: 41005
+.. date: 2020-06-17-13-45-15
+.. nonce: zZegdV
+.. section: macOS
+
+fixed an XDG settings issue not allowing macos to open browser in
+webbrowser.py
+
+..
+
+.. bpo: 40741
+.. date: 2020-06-07-20-10-56
+.. nonce: 80A2BW
+.. section: macOS
+
+Update macOS installer to use SQLite 3.32.2.
+
+..
+
+.. bpo: 41775
+.. date: 2020-09-24-14-31-16
+.. nonce: sB8Vre
+.. section: IDLE
+
+Use 'IDLE Shell' as shell title
+
+..
+
+.. bpo: 35764
+.. date: 2020-09-22-11-13-45
+.. nonce: VoNa8y
+.. section: IDLE
+
+Rewrite the Calltips doc section.
+
+..
+
+.. bpo: 40181
+.. date: 2020-09-22-00-45-40
+.. nonce: hhQi3z
+.. section: IDLE
+
+In calltips, stop reminding that '/' marks the end of positional-only
+arguments.
+
+..
+
+.. bpo: 41468
+.. date: 2020-08-09-13-42-55
+.. nonce: zkP0_Y
+.. section: IDLE
+
+Improve IDLE run crash error message (which users should never see).
+
+..
+
+.. bpo: 41373
+.. date: 2020-07-24-17-49-58
+.. nonce: YQIPu_
+.. section: IDLE
+
+Save files loaded with no line ending, as when blank, or different line
+endings, by setting its line ending to the system default. Fix regression in
+3.8.4 and 3.9.0b4.
+
+..
+
+.. bpo: 41300
+.. date: 2020-07-16-17-39-06
+.. nonce: wRixNb
+.. section: IDLE
+
+Save files with non-ascii chars. Fix regression released in 3.9.0b4 and
+3.8.4.
+
+..
+
+.. bpo: 37765
+.. date: 2020-07-07-18-44-30
+.. nonce: umc1o8
+.. section: IDLE
+
+Add keywords to module name completion list. Rewrite Completions section of
+IDLE doc.
+
+..
+
+.. bpo: 41152
+.. date: 2020-06-29-14-51-15
+.. nonce: d6mV0C
+.. section: IDLE
+
+The encoding of ``stdin``, ``stdout`` and ``stderr`` in IDLE is now always
+UTF-8.
+
+..
+
+.. bpo: 41144
+.. date: 2020-06-27-17-02-00
+.. nonce: JoFGIX
+.. section: IDLE
+
+Make Open Module open a special module such as os.path.
+
+..
+
+.. bpo: 39885
+.. date: 2020-05-29-18-21-58
+.. nonce: zB_-bN
+.. section: IDLE
+
+Make context menu Cut and Copy work again when right-clicking within a
+selection.
+
+..
+
+.. bpo: 40723
+.. date: 2020-05-24-06-19-43
+.. nonce: AJLd4U
+.. section: IDLE
+
+Make test_idle pass when run after import.
+
+..
+
+.. bpo: 41936
+.. date: 2020-10-05-01-25-23
+.. nonce: 1gb5ra
+.. section: C API
+
+Removed undocumented macros ``Py_ALLOW_RECURSION`` and
+``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the
+:c:type:`PyInterpreterState` structure.
+
+..
+
+.. bpo: 41692
+.. date: 2020-10-02-00-57-34
+.. nonce: fDScsF
+.. section: C API
+
+The ``PyUnicode_InternImmortal()`` function is now deprecated and will be
+removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` instead. Patch
+by Victor Stinner.
+
+..
+
+.. bpo: 41842
+.. date: 2020-09-27-20-43-16
+.. nonce: bCakAj
+.. section: C API
+
+Add :c:func:`PyCodec_Unregister` function to unregister a codec search
+function.
+
+..
+
+.. bpo: 41834
+.. date: 2020-09-22-14-47-12
+.. nonce: nrOrDU
+.. section: C API
+
+Remove the ``_Py_CheckRecursionLimit`` variable: it has been replaced by
+``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` structure.
+Patch by Victor Stinner.
+
+..
+
+.. bpo: 41689
+.. date: 2020-09-01-23-39-45
+.. nonce: zxHbLB
+.. section: C API
+
+Types created with :c:func:`PyType_FromSpec` now make any signature in their
+``tp_doc`` slot accessible from ``__text_signature__``.
+
+..
+
+.. bpo: 41524
+.. date: 2020-08-12-17-09-06
+.. nonce: u6Xfr2
+.. section: C API
+
+Fix bug in PyOS_mystrnicmp and PyOS_mystricmp that incremented pointers
+beyond the end of a string.
+
+..
+
+.. bpo: 41324
+.. date: 2020-08-10-16-05-08
+.. nonce: waZD35
+.. section: C API
+
+Add a minimal decimal capsule API. The API supports fast conversions
+between Decimals up to 38 digits and their triple representation as a C
+struct.
+
+..
+
+.. bpo: 30155
+.. date: 2020-07-26-19-39-45
+.. nonce: rHZRJ_
+.. section: C API
+
+Add :c:func:`PyDateTime_DATE_GET_TZINFO` and
+:c:func:`PyDateTime_TIME_GET_TZINFO` macros for accessing the ``tzinfo``
+attributes of :class:`datetime.datetime` and :class:`datetime.time` objects.
+
+..
+
+.. bpo: 40170
+.. date: 2020-07-08-10-14-52
+.. nonce: N6Qx1i
+.. section: C API
+
+Revert :c:func:`PyType_HasFeature` change: it reads again directly the
+:c:member:`PyTypeObject.tp_flags` member when the limited C API is not used,
+rather than always calling :c:func:`PyType_GetFlags` which hides
+implementation details.
+
+..
+
+.. bpo: 41123
+.. date: 2020-06-29-15-49-36
+.. nonce: wYY4E1
+.. section: C API
+
+Remove ``PyUnicode_AsUnicodeCopy``.
+
+..
+
+.. bpo: 41123
+.. date: 2020-06-29-11-33-49
+.. nonce: qFevek
+.. section: C API
+
+Removed ``PyLong_FromUnicode()``.
+
+..
+
+.. bpo: 41123
+.. date: 2020-06-28-11-39-22
+.. nonce: sjJWjQ
+.. section: C API
+
+Removed ``PyUnicode_GetMax()``.
+
+..
+
+.. bpo: 41123
+.. date: 2020-06-26-13-29-25
+.. nonce: bRa1oy
+.. section: C API
+
+Removed ``Py_UNICODE_str*`` functions manipulating ``Py_UNICODE*`` strings.
+
+..
+
+.. bpo: 41103
+.. date: 2020-06-24-22-57-07
+.. nonce: doojgE
+.. section: C API
+
+``PyObject_AsCharBuffer()``, ``PyObject_AsReadBuffer()``,
+``PyObject_CheckReadBuffer()``, and ``PyObject_AsWriteBuffer()`` are
+removed. Please migrate to new buffer protocol; :c:func:`PyObject_GetBuffer`
+and :c:func:`PyBuffer_Release`.
+
+..
+
+.. bpo: 36346
+.. date: 2020-06-17-20-31-12
+.. nonce: mwIyxi
+.. section: C API
+
+Raises DeprecationWarning for ``PyUnicode_FromUnicode(NULL, size)`` and
+``PyUnicode_FromStringAndSize(NULL, size)`` with ``size > 0``.
+
+..
+
+.. bpo: 36346
+.. date: 2020-06-17-11-24-00
+.. nonce: fTMr3S
+.. section: C API
+
+Mark ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``,
+``PyUnicode_FromUnicode``, ``PyUnicode_AsUnicode``, and
+``PyUnicode_AsUnicodeAndSize`` as deprecated in C. Remove
+``Py_UNICODE_MATCH`` which was deprecated and broken since Python 3.3.
+
+..
+
+.. bpo: 40989
+.. date: 2020-06-15-23-17-51
+.. nonce: tlzG3r
+.. section: C API
+
+The :c:func:`PyObject_INIT` and :c:func:`PyObject_INIT_VAR` macros become
+aliases to, respectively, :c:func:`PyObject_Init` and
+:c:func:`PyObject_InitVar` functions.
+
+..
+
+.. bpo: 36020
+.. date: 2020-06-15-16-46-01
+.. nonce: djI6jw
+.. section: C API
+
+On Windows, ``#include "pyerrors.h"`` no longer defines ``snprintf`` and
+``vsnprintf`` macros.
+
+..
+
+.. bpo: 40943
+.. date: 2020-06-10-18-37-26
+.. nonce: i4q7rK
+.. section: C API
+
+The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use
+:c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use
+``#``: ``es#``, ``et#``, ``s#``, ``u#``, ``y#``, ``z#``, ``U#`` and ``Z#``.
+See :ref:`Parsing arguments and building values <arg-parsing>` and the
+:pep:`353`.
+
+..
+
+.. bpo: 40910
+.. date: 2020-06-08-15-59-06
+.. nonce: L56oI0
+.. section: C API
+
+Export explicitly the :c:func:`Py_GetArgcArgv` function to the C API and
+document the function. Previously, it was exported implicitly which no
+longer works since Python is built with ``-fvisibility=hidden``.
+
+..
+
+.. bpo: 40724
+.. date: 2020-06-04-08-01-23
+.. nonce: qIIdSi
+.. section: C API
+
+Allow defining buffer slots in type specs.
+
+..
+
+.. bpo: 40679
+.. date: 2020-06-03-17-48-13
+.. nonce: 3sgWma
+.. section: C API
+
+Fix a ``_PyEval_EvalCode()`` crash if *qualname* argument is NULL.
+
+..
+
+.. bpo: 40839
+.. date: 2020-06-01-20-47-49
+.. nonce: bAi52Z
+.. section: C API
+
+Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had been allowed
+for historical reason. It is no longer allowed.
+
+..
+
+.. bpo: 40826
+.. date: 2020-06-01-16-12-37
+.. nonce: zQzFoK
+.. section: C API
+
+:c:func:`PyOS_InterruptOccurred` now fails with a fatal error if it is
+called with the GIL released.
+
+..
+
+.. bpo: 40792
+.. date: 2020-05-27-11-02-15
+.. nonce: pBw2Bb
+.. section: C API
+
+The result of :c:func:`PyNumber_Index` now always has exact type
+:class:`int`. Previously, the result could have been an instance of a
+subclass of ``int``.
+
+..
+
+.. bpo: 39573
+.. date: 2020-05-26-16-21-47
+.. nonce: depAgq
+.. section: C API
+
+Convert :c:func:`Py_REFCNT` and :c:func:`Py_SIZE` macros to static inline
+functions. They cannot be used as l-value anymore: use
+:c:func:`Py_SET_REFCNT` and :c:func:`Py_SET_SIZE` to set an object reference
+count and size. This change is backward incompatible on purpose, to prepare
+the C API for an opaque :c:type:`PyObject` structure.
+
+..
+
+.. bpo: 40703
+.. date: 2020-05-20-19-11-12
+.. nonce: qQXfW8
+.. section: C API
+
+The PyType_FromSpec*() functions no longer overwrite the type's "__module__"
+attribute if it is set via "Py_tp_members" or "Py_tp_getset".
+
+..
+
+.. bpo: 39583
+.. date: 2020-02-08-08-01-35
+.. nonce: qURKSl
+.. section: C API
+
+Remove superfluous "extern C" declarations from ``Include/cpython/*.h``.
diff --git a/Misc/NEWS.d/3.9.0a2.rst b/Misc/NEWS.d/3.9.0a2.rst
index 1fd23b763e..226ea0d3df 100644
--- a/Misc/NEWS.d/3.9.0a2.rst
+++ b/Misc/NEWS.d/3.9.0a2.rst
@@ -236,7 +236,7 @@ coroutine of an asynchronous generator.
Removed WITH_CLEANUP_START, WITH_CLEANUP_FINISH, BEGIN_FINALLY, END_FINALLY,
CALL_FINALLY and POP_FINALLY bytecodes. Replaced with RERAISE and
-WITH_EXCEPT_FINISH bytecodes. The compiler now generates different code for
+WITH_EXCEPT_START bytecodes. The compiler now generates different code for
exceptional and non-exceptional branches for 'with' and 'try-except'
statements. For 'try-finally' statements the 'finally' block is replicated
for each exit from the 'try' body.
diff --git a/Misc/NEWS.d/next/Build/2020-05-19-10-54-08.bpo-40683.W8JHrr.rst b/Misc/NEWS.d/next/Build/2020-05-19-10-54-08.bpo-40683.W8JHrr.rst
deleted file mode 100644
index d57e064c03..0000000000
--- a/Misc/NEWS.d/next/Build/2020-05-19-10-54-08.bpo-40683.W8JHrr.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixed an issue where the :mod:`zoneinfo` module and its tests were not
-included when Python is installed with ``make``.
diff --git a/Misc/NEWS.d/next/Build/2020-06-08-19-57-05.bpo-40684.WIY2-i.rst b/Misc/NEWS.d/next/Build/2020-06-08-19-57-05.bpo-40684.WIY2-i.rst
deleted file mode 100644
index 0495e5e413..0000000000
--- a/Misc/NEWS.d/next/Build/2020-06-08-19-57-05.bpo-40684.WIY2-i.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-``make install`` now uses the ``PLATLIBDIR`` variable for the destination
-``lib-dynload/`` directory when ``./configure --with-platlibdir`` is used.
diff --git a/Misc/NEWS.d/next/Build/2020-06-15-22-14-25.bpo-36020.wbiv0P.rst b/Misc/NEWS.d/next/Build/2020-06-15-22-14-25.bpo-36020.wbiv0P.rst
deleted file mode 100644
index de50dff3b1..0000000000
--- a/Misc/NEWS.d/next/Build/2020-06-15-22-14-25.bpo-36020.wbiv0P.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now required
-to build Python.
diff --git a/Misc/NEWS.d/next/Build/2020-06-25-06-59-13.bpo-40204.GpD04D.rst b/Misc/NEWS.d/next/Build/2020-06-25-06-59-13.bpo-40204.GpD04D.rst
deleted file mode 100644
index 25a6d751e5..0000000000
--- a/Misc/NEWS.d/next/Build/2020-06-25-06-59-13.bpo-40204.GpD04D.rst
+++ /dev/null
@@ -1 +0,0 @@
-Pin Sphinx version to 2.3.1 in ``Doc/Makefile``.
diff --git a/Misc/NEWS.d/next/Build/2020-08-24-18-34-01.bpo-41617.sKKXz7.rst b/Misc/NEWS.d/next/Build/2020-08-24-18-34-01.bpo-41617.sKKXz7.rst
deleted file mode 100644
index 715eadbee8..0000000000
--- a/Misc/NEWS.d/next/Build/2020-08-24-18-34-01.bpo-41617.sKKXz7.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix ``pycore_bitutils.h`` header file to support old clang versions:
-``__builtin_bswap16()`` is not available in LLVM clang 3.0.
diff --git a/Misc/NEWS.d/next/C API/2020-02-08-08-01-35.bpo-39583.qURKSl.rst b/Misc/NEWS.d/next/C API/2020-02-08-08-01-35.bpo-39583.qURKSl.rst
deleted file mode 100644
index 1c9f44f744..0000000000
--- a/Misc/NEWS.d/next/C API/2020-02-08-08-01-35.bpo-39583.qURKSl.rst
+++ /dev/null
@@ -1 +0,0 @@
-Remove superfluous "extern C" declarations from ``Include/cpython/*.h``.
diff --git a/Misc/NEWS.d/next/C API/2020-05-20-19-11-12.bpo-40703.qQXfW8.rst b/Misc/NEWS.d/next/C API/2020-05-20-19-11-12.bpo-40703.qQXfW8.rst
deleted file mode 100644
index 5385a2d8dc..0000000000
--- a/Misc/NEWS.d/next/C API/2020-05-20-19-11-12.bpo-40703.qQXfW8.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The PyType_FromSpec*() functions no longer overwrite the type's "__module__" attribute
-if it is set via "Py_tp_members" or "Py_tp_getset".
diff --git a/Misc/NEWS.d/next/C API/2020-05-26-16-21-47.bpo-39573.depAgq.rst b/Misc/NEWS.d/next/C API/2020-05-26-16-21-47.bpo-39573.depAgq.rst
deleted file mode 100644
index f8f675cebc..0000000000
--- a/Misc/NEWS.d/next/C API/2020-05-26-16-21-47.bpo-39573.depAgq.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-Convert :c:func:`Py_REFCNT` and :c:func:`Py_SIZE` macros to static inline
-functions. They cannot be used as l-value anymore: use
-:c:func:`Py_SET_REFCNT` and :c:func:`Py_SET_SIZE` to set an object reference
-count and size. This change is backward incompatible on purpose, to prepare
-the C API for an opaque :c:type:`PyObject` structure.
diff --git a/Misc/NEWS.d/next/C API/2020-05-27-11-02-15.bpo-40792.pBw2Bb.rst b/Misc/NEWS.d/next/C API/2020-05-27-11-02-15.bpo-40792.pBw2Bb.rst
deleted file mode 100644
index 4cfe09bc77..0000000000
--- a/Misc/NEWS.d/next/C API/2020-05-27-11-02-15.bpo-40792.pBw2Bb.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The result of :c:func:`PyNumber_Index` now always has exact type :class:`int`.
-Previously, the result could have been an instance of a subclass of ``int``.
diff --git a/Misc/NEWS.d/next/C API/2020-06-01-16-12-37.bpo-40826.zQzFoK.rst b/Misc/NEWS.d/next/C API/2020-06-01-16-12-37.bpo-40826.zQzFoK.rst
deleted file mode 100644
index 0d7a36c3eb..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-01-16-12-37.bpo-40826.zQzFoK.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:c:func:`PyOS_InterruptOccurred` now fails with a fatal error if it is
-called with the GIL released.
diff --git a/Misc/NEWS.d/next/C API/2020-06-01-20-47-49.bpo-40839.bAi52Z.rst b/Misc/NEWS.d/next/C API/2020-06-01-20-47-49.bpo-40839.bAi52Z.rst
deleted file mode 100644
index 5de2f40c14..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-01-20-47-49.bpo-40839.bAi52Z.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had been allowed for
-historical reason. It is no longer allowed.
diff --git a/Misc/NEWS.d/next/C API/2020-06-03-17-48-13.bpo-40679.3sgWma.rst b/Misc/NEWS.d/next/C API/2020-06-03-17-48-13.bpo-40679.3sgWma.rst
deleted file mode 100644
index ccf908cef1..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-03-17-48-13.bpo-40679.3sgWma.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix a ``_PyEval_EvalCode()`` crash if *qualname* argument is NULL.
diff --git a/Misc/NEWS.d/next/C API/2020-06-04-08-01-23.bpo-40724.qIIdSi.rst b/Misc/NEWS.d/next/C API/2020-06-04-08-01-23.bpo-40724.qIIdSi.rst
deleted file mode 100644
index 82793dbf7a..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-04-08-01-23.bpo-40724.qIIdSi.rst
+++ /dev/null
@@ -1 +0,0 @@
-Allow defining buffer slots in type specs.
diff --git a/Misc/NEWS.d/next/C API/2020-06-08-15-59-06.bpo-40910.L56oI0.rst b/Misc/NEWS.d/next/C API/2020-06-08-15-59-06.bpo-40910.L56oI0.rst
deleted file mode 100644
index 1d0cb0b023..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-08-15-59-06.bpo-40910.L56oI0.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Export explicitly the :c:func:`Py_GetArgcArgv` function to the C API and
-document the function. Previously, it was exported implicitly which no
-longer works since Python is built with ``-fvisibility=hidden``.
diff --git a/Misc/NEWS.d/next/C API/2020-06-10-18-37-26.bpo-40943.i4q7rK.rst b/Misc/NEWS.d/next/C API/2020-06-10-18-37-26.bpo-40943.i4q7rK.rst
deleted file mode 100644
index 360ddae34c..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-10-18-37-26.bpo-40943.i4q7rK.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use
-:c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use ``#``:
-``es#``, ``et#``, ``s#``, ``u#``, ``y#``, ``z#``, ``U#`` and ``Z#``.
-See :ref:`Parsing arguments and building values <arg-parsing>` and the
-:pep:`353`.
diff --git a/Misc/NEWS.d/next/C API/2020-06-15-16-46-01.bpo-36020.djI6jw.rst b/Misc/NEWS.d/next/C API/2020-06-15-16-46-01.bpo-36020.djI6jw.rst
deleted file mode 100644
index 1f91dce460..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-15-16-46-01.bpo-36020.djI6jw.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-On Windows, ``#include "pyerrors.h"`` no longer defines ``snprintf`` and
-``vsnprintf`` macros.
diff --git a/Misc/NEWS.d/next/C API/2020-06-15-23-17-51.bpo-40989.tlzG3r.rst b/Misc/NEWS.d/next/C API/2020-06-15-23-17-51.bpo-40989.tlzG3r.rst
deleted file mode 100644
index 1be473d142..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-15-23-17-51.bpo-40989.tlzG3r.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-The :c:func:`PyObject_INIT` and :c:func:`PyObject_INIT_VAR` macros become
-aliases to, respectively, :c:func:`PyObject_Init` and
-:c:func:`PyObject_InitVar` functions.
diff --git a/Misc/NEWS.d/next/C API/2020-06-17-11-24-00.bpo-36346.fTMr3S.rst b/Misc/NEWS.d/next/C API/2020-06-17-11-24-00.bpo-36346.fTMr3S.rst
deleted file mode 100644
index 1e448303a8..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-17-11-24-00.bpo-36346.fTMr3S.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Mark ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``,
-``PyUnicode_FromUnicode``, ``PyUnicode_AsUnicode``,
-and ``PyUnicode_AsUnicodeAndSize`` as deprecated in C. Remove ``Py_UNICODE_MATCH``
-which was deprecated and broken since Python 3.3.
diff --git a/Misc/NEWS.d/next/C API/2020-06-17-20-31-12.bpo-36346.mwIyxi.rst b/Misc/NEWS.d/next/C API/2020-06-17-20-31-12.bpo-36346.mwIyxi.rst
deleted file mode 100644
index 9b0400399b..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-17-20-31-12.bpo-36346.mwIyxi.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Raises DeprecationWarning for ``PyUnicode_FromUnicode(NULL, size)`` and
-``PyUnicode_FromStringAndSize(NULL, size)`` with ``size > 0``.
diff --git a/Misc/NEWS.d/next/C API/2020-06-24-22-57-07.bpo-41103.doojgE.rst b/Misc/NEWS.d/next/C API/2020-06-24-22-57-07.bpo-41103.doojgE.rst
deleted file mode 100644
index 082b77b903..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-24-22-57-07.bpo-41103.doojgE.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-``PyObject_AsCharBuffer()``, ``PyObject_AsReadBuffer()``,
-``PyObject_CheckReadBuffer()``, and ``PyObject_AsWriteBuffer()`` are
-removed. Please migrate to new buffer protocol; :c:func:`PyObject_GetBuffer`
-and :c:func:`PyBuffer_Release`.
diff --git a/Misc/NEWS.d/next/C API/2020-06-26-13-29-25.bpo-41123.bRa1oy.rst b/Misc/NEWS.d/next/C API/2020-06-26-13-29-25.bpo-41123.bRa1oy.rst
deleted file mode 100644
index 1261a8708d..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-26-13-29-25.bpo-41123.bRa1oy.rst
+++ /dev/null
@@ -1 +0,0 @@
-Removed ``Py_UNICODE_str*`` functions manipulating ``Py_UNICODE*`` strings.
diff --git a/Misc/NEWS.d/next/C API/2020-06-28-11-39-22.bpo-41123.sjJWjQ.rst b/Misc/NEWS.d/next/C API/2020-06-28-11-39-22.bpo-41123.sjJWjQ.rst
deleted file mode 100644
index 97331458c6..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-28-11-39-22.bpo-41123.sjJWjQ.rst
+++ /dev/null
@@ -1 +0,0 @@
-Removed ``PyUnicode_GetMax()``.
diff --git a/Misc/NEWS.d/next/C API/2020-06-29-11-33-49.bpo-41123.qFevek.rst b/Misc/NEWS.d/next/C API/2020-06-29-11-33-49.bpo-41123.qFevek.rst
deleted file mode 100644
index 1f5813594b..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-29-11-33-49.bpo-41123.qFevek.rst
+++ /dev/null
@@ -1 +0,0 @@
-Removed ``PyLong_FromUnicode()``.
diff --git a/Misc/NEWS.d/next/C API/2020-06-29-15-49-36.bpo-41123.wYY4E1.rst b/Misc/NEWS.d/next/C API/2020-06-29-15-49-36.bpo-41123.wYY4E1.rst
deleted file mode 100644
index 74ac454627..0000000000
--- a/Misc/NEWS.d/next/C API/2020-06-29-15-49-36.bpo-41123.wYY4E1.rst
+++ /dev/null
@@ -1 +0,0 @@
-Remove ``PyUnicode_AsUnicodeCopy``.
diff --git a/Misc/NEWS.d/next/C API/2020-07-08-10-14-52.bpo-40170.N6Qx1i.rst b/Misc/NEWS.d/next/C API/2020-07-08-10-14-52.bpo-40170.N6Qx1i.rst
deleted file mode 100644
index 760a3ff4d1..0000000000
--- a/Misc/NEWS.d/next/C API/2020-07-08-10-14-52.bpo-40170.N6Qx1i.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Revert :c:func:`PyType_HasFeature` change: it reads again directly the
-:c:member:`PyTypeObject.tp_flags` member when the limited C API is not used,
-rather than always calling :c:func:`PyType_GetFlags` which hides implementation
-details.
diff --git a/Misc/NEWS.d/next/C API/2020-07-26-19-39-45.bpo-30155.rHZRJ_.rst b/Misc/NEWS.d/next/C API/2020-07-26-19-39-45.bpo-30155.rHZRJ_.rst
deleted file mode 100644
index a276759da7..0000000000
--- a/Misc/NEWS.d/next/C API/2020-07-26-19-39-45.bpo-30155.rHZRJ_.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Add :c:func:`PyDateTime_DATE_GET_TZINFO` and
-:c:func:`PyDateTime_TIME_GET_TZINFO` macros for accessing the ``tzinfo``
-attributes of :class:`datetime.datetime` and :class:`datetime.time` objects.
diff --git a/Misc/NEWS.d/next/C API/2020-08-10-16-05-08.bpo-41324.waZD35.rst b/Misc/NEWS.d/next/C API/2020-08-10-16-05-08.bpo-41324.waZD35.rst
deleted file mode 100644
index e09332ab11..0000000000
--- a/Misc/NEWS.d/next/C API/2020-08-10-16-05-08.bpo-41324.waZD35.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Add a minimal decimal capsule API. The API supports fast conversions
-between Decimals up to 38 digits and their triple representation as a C
-struct.
diff --git a/Misc/NEWS.d/next/C API/2020-08-12-17-09-06.bpo-41524.u6Xfr2.rst b/Misc/NEWS.d/next/C API/2020-08-12-17-09-06.bpo-41524.u6Xfr2.rst
deleted file mode 100644
index 4704e29be2..0000000000
--- a/Misc/NEWS.d/next/C API/2020-08-12-17-09-06.bpo-41524.u6Xfr2.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix bug in PyOS_mystrnicmp and PyOS_mystricmp that incremented
-pointers beyond the end of a string. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/C API/2020-09-01-23-39-45.bpo-41689.zxHbLB.rst b/Misc/NEWS.d/next/C API/2020-09-01-23-39-45.bpo-41689.zxHbLB.rst
deleted file mode 100644
index 44cf58a4b0..0000000000
--- a/Misc/NEWS.d/next/C API/2020-09-01-23-39-45.bpo-41689.zxHbLB.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Types created with :c:func:`PyType_FromSpec` now make any signature in their
-``tp_doc`` slot accessible from ``__text_signature__``.
diff --git a/Misc/NEWS.d/next/C API/2020-09-22-14-47-12.bpo-41834.nrOrDU.rst b/Misc/NEWS.d/next/C API/2020-09-22-14-47-12.bpo-41834.nrOrDU.rst
deleted file mode 100644
index 07043dce5a..0000000000
--- a/Misc/NEWS.d/next/C API/2020-09-22-14-47-12.bpo-41834.nrOrDU.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Remove the ``_Py_CheckRecursionLimit`` variable: it has been replaced by
-``ceval.recursion_limit`` of the :c:type:`PyInterpreterState`
-structure. Patch by Victor Stinner.
diff --git a/Misc/NEWS.d/next/C API/2020-09-28-14-31-07.bpo-41756.ZZ5wJG.rst b/Misc/NEWS.d/next/C API/2020-09-28-14-31-07.bpo-41756.ZZ5wJG.rst
new file mode 100644
index 0000000000..f7e27b4401
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2020-09-28-14-31-07.bpo-41756.ZZ5wJG.rst
@@ -0,0 +1,3 @@
+Add `PyIter_Send` function to allow sending value into
+generator/coroutine/iterator without raising StopIteration exception to
+signal return.
diff --git a/Misc/NEWS.d/next/C API/2020-10-09-22-50-46.bpo-41986.JUPE59.rst b/Misc/NEWS.d/next/C API/2020-10-09-22-50-46.bpo-41986.JUPE59.rst
new file mode 100644
index 0000000000..d456ba66ba
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2020-10-09-22-50-46.bpo-41986.JUPE59.rst
@@ -0,0 +1,2 @@
+:c:data:`Py_FileSystemDefaultEncodeErrors` and :c:data:`Py_UTF8Mode` are
+available again in limited API.
diff --git a/Misc/NEWS.d/next/C API/2020-10-10-14-05-24.bpo-40422.sh8IDY.rst b/Misc/NEWS.d/next/C API/2020-10-10-14-05-24.bpo-40422.sh8IDY.rst
new file mode 100644
index 0000000000..1b6d9e034b
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2020-10-10-14-05-24.bpo-40422.sh8IDY.rst
@@ -0,0 +1 @@
+Add `_Py_closerange` function to provide performant closing of a range of file descriptors. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/C API/2020-10-11-19-17-44.bpo-40423.GsmgEj.rst b/Misc/NEWS.d/next/C API/2020-10-11-19-17-44.bpo-40423.GsmgEj.rst
new file mode 100644
index 0000000000..44e571ebf8
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2020-10-11-19-17-44.bpo-40423.GsmgEj.rst
@@ -0,0 +1,3 @@
+The :mod:`subprocess` module and ``os.closerange`` will now use the
+``close_range(low, high, flags)`` syscall when it is available for more
+efficient closing of ranges of descriptors. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/C API/2020-10-12-20-13-58.bpo-42015.X4H2_V.rst b/Misc/NEWS.d/next/C API/2020-10-12-20-13-58.bpo-42015.X4H2_V.rst
new file mode 100644
index 0000000000..d77619f64b
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2020-10-12-20-13-58.bpo-42015.X4H2_V.rst
@@ -0,0 +1,3 @@
+Fix potential crash in deallocating method objects when dynamically
+allocated `PyMethodDef`'s lifetime is managed through the ``self``
+argument of a `PyCFunction`.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-08-29-15-57-07.bpo-19569.RGu2Kb.rst b/Misc/NEWS.d/next/Core and Builtins/2018-08-29-15-57-07.bpo-19569.RGu2Kb.rst
deleted file mode 100644
index 1b76bd8e24..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2018-08-29-15-57-07.bpo-19569.RGu2Kb.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add the private macros ``_Py_COMP_DIAG_PUSH``,
-``_Py_COMP_DIAG_IGNORE_DEPR_DECLS``, and ``_Py_COMP_DIAG_POP``.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-05-25-05-27-39.bpo-36982.0UHgfB.rst b/Misc/NEWS.d/next/Core and Builtins/2019-05-25-05-27-39.bpo-36982.0UHgfB.rst
deleted file mode 100644
index f105f1857d..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2019-05-25-05-27-39.bpo-36982.0UHgfB.rst
+++ /dev/null
@@ -1 +0,0 @@
-Use ncurses extended color functions when available to support terminals with 256 colors, and add the new function :func:`curses.has_extended_color_support` to indicate whether extended color support is provided by the underlying ncurses library. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-06-02-11-29-15.bpo-29882.AkRzjb.rst b/Misc/NEWS.d/next/Core and Builtins/2019-06-02-11-29-15.bpo-29882.AkRzjb.rst
deleted file mode 100644
index 240b5680b3..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2019-06-02-11-29-15.bpo-29882.AkRzjb.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add :meth:`int.bit_count()`, counting the number of ones in the binary
-representation of an integer. Patch by Niklas Fiekas.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-09-01-14-26-02.bpo-37999.XPl6dn.rst b/Misc/NEWS.d/next/Core and Builtins/2019-09-01-14-26-02.bpo-37999.XPl6dn.rst
deleted file mode 100644
index 8d7e9369af..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2019-09-01-14-26-02.bpo-37999.XPl6dn.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-Builtin and extension functions that take integer arguments no longer accept
-:class:`~decimal.Decimal`\ s, :class:`~fractions.Fraction`\ s and other
-objects that can be converted to integers only with a loss (e.g. that have
-the :meth:`~object.__int__` method but do not have the
-:meth:`~object.__index__` method).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-05-02-35-08.bpo-1635741.Kfe9fT.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-05-02-35-08.bpo-1635741.Kfe9fT.rst
deleted file mode 100644
index 956d0b68a8..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-04-05-02-35-08.bpo-1635741.Kfe9fT.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port :mod:`_lzma` to multiphase initialization.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-10-23-54-57.bpo-1635741.ZURqoN.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-10-23-54-57.bpo-1635741.ZURqoN.rst
deleted file mode 100644
index cb849fb9b4..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-04-10-23-54-57.bpo-1635741.ZURqoN.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port :mod:`mmap` to multiphase initialization.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-11-13-07-49.bpo-4022.Ctpn_F.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-11-13-07-49.bpo-4022.Ctpn_F.rst
deleted file mode 100644
index a13a8e8822..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-04-11-13-07-49.bpo-4022.Ctpn_F.rst
+++ /dev/null
@@ -1 +0,0 @@
-Improve performance of generators by not raising internal StopIteration.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-03-22-26-00.bpo-29590.aRz3l7.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-03-22-26-00.bpo-29590.aRz3l7.rst
deleted file mode 100644
index 2570c4f2c7..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-03-22-26-00.bpo-29590.aRz3l7.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Make the stack trace correct after calling :meth:`generator.throw`
-on a generator that has yielded from a ``yield from``.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-19-19-39-49.bpo-40679.SVzz9p.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-19-19-39-49.bpo-40679.SVzz9p.rst
deleted file mode 100644
index 2d0a432b6f..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-19-19-39-49.bpo-40679.SVzz9p.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Certain :exc:`TypeError` messages about missing or extra arguments now include the function's
-:term:`qualified name`. Patch by Dennis Sweeney.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-20-01-17-34.bpo-40521.wvAehI.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-20-01-17-34.bpo-40521.wvAehI.rst
deleted file mode 100644
index 43226931cc..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-20-01-17-34.bpo-40521.wvAehI.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-Each interpreter now its has own free lists, singletons and caches:
-
-* Free lists: float, tuple, list, dict, frame, context,
- asynchronous generator, MemoryError.
-* Singletons: empty tuple, empty bytes string, empty Unicode string,
- single byte character, single Unicode (latin1) character.
-* Slice cache.
-
-They are no longer shared by all interpreters.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-21-01-54-00.bpo-40696.u3n8Wx.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-21-01-54-00.bpo-40696.u3n8Wx.rst
deleted file mode 100644
index f99bdea2e3..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-21-01-54-00.bpo-40696.u3n8Wx.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix a hang that can arise after :meth:`generator.throw` due to a cycle
-in the exception context chain.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-22-00-34-34.bpo-39573.QO2QHj.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-22-00-34-34.bpo-39573.QO2QHj.rst
deleted file mode 100644
index 2430030304..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-22-00-34-34.bpo-39573.QO2QHj.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:c:func:`Py_TYPE()` is changed to the inline static function. Patch by
-Dong-hee Na.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-23-01-15-51.bpo-40217.jZsHTc.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-23-01-15-51.bpo-40217.jZsHTc.rst
deleted file mode 100644
index b13e8eeb06..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-23-01-15-51.bpo-40217.jZsHTc.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Instances of types created with :c:func:`PyType_FromSpecWithBases` will no
-longer automatically visit their class object when traversing references in
-the garbage collector. The user is expected to manually visit the object's
-class. Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-24-02-42-26.bpo-40750.ZmO9Ev.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-24-02-42-26.bpo-40750.ZmO9Ev.rst
deleted file mode 100644
index 4032b80169..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-24-02-42-26.bpo-40750.ZmO9Ev.rst
+++ /dev/null
@@ -1 +0,0 @@
-Support the "-d" debug flag in the new PEG parser. Patch by Pablo Galindo
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-25-21-49-11.bpo-38964.lrml90.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-25-21-49-11.bpo-38964.lrml90.rst
deleted file mode 100644
index 1200764306..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-25-21-49-11.bpo-38964.lrml90.rst
+++ /dev/null
@@ -1 +0,0 @@
-When there's a :exc:`SyntaxError` in the expression part of an fstring, the filename attribute of the :exc:`SyntaxError` gets correctly set to the name of the file the fstring resides in. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-26-17-43-58.bpo-40780.3Ckdgm.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-26-17-43-58.bpo-40780.3Ckdgm.rst
deleted file mode 100644
index ed6020c2e2..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-26-17-43-58.bpo-40780.3Ckdgm.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix a corner case where g-style string formatting of a float failed to
-remove trailing zeros.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-27-16-08-16.bpo-38605.rcs2uK.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-27-16-08-16.bpo-38605.rcs2uK.rst
new file mode 100644
index 0000000000..cbfe6e2352
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-05-27-16-08-16.bpo-38605.rcs2uK.rst
@@ -0,0 +1,3 @@
+Enable ``from __future__ import annotations`` (:pep:`563`) by default.
+The values found in :attr:`__annotations__` dicts are now strings, e.g.
+``{"x": "int"}`` instead of ``{"x": int}``.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-27-22-37-58.bpo-40792.WEDqqU.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-27-22-37-58.bpo-40792.WEDqqU.rst
deleted file mode 100644
index 5986a221f5..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-27-22-37-58.bpo-40792.WEDqqU.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Attributes ``start``, ``stop`` and ``step`` of the :class:`range` object now
-always has exact type :class:`int`. Previously, they could have been an
-instance of a subclass of ``int``.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-30-14-37-18.bpo-40824.XR3V5s.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-30-14-37-18.bpo-40824.XR3V5s.rst
deleted file mode 100644
index 73c593c04a..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-30-14-37-18.bpo-40824.XR3V5s.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Unexpected errors in calling the ``__iter__`` method are no longer masked by
-``TypeError`` in the :keyword:`in` operator and functions
-:func:`~operator.contains`, :func:`~operator.indexOf` and
-:func:`~operator.countOf` of the :mod:`operator` module.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-30-23-18-35.bpo-19468.S-TA7p.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-30-23-18-35.bpo-19468.S-TA7p.rst
deleted file mode 100644
index e35750e37f..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-30-23-18-35.bpo-19468.S-TA7p.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Delete unnecessary instance check in importlib.reload().
-Patch by Furkan Önder.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-30-23-23-35.bpo-1635741.0D-laM.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-30-23-23-35.bpo-1635741.0D-laM.rst
deleted file mode 100644
index cd2bcb6e60..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-05-30-23-23-35.bpo-1635741.0D-laM.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port :mod:`fcntl` to multiphase initialization.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-01-20-31-07.bpo-40826.XCI4M2.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-01-20-31-07.bpo-40826.XCI4M2.rst
deleted file mode 100644
index a03ed180eb..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-01-20-31-07.bpo-40826.XCI4M2.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix GIL usage in :c:func:`PyOS_Readline`: lock the GIL to set an exception
-and pass the Python thread state when checking if there is a pending signal.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-03-13-53-24.bpo-40854.O6vfQU.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-03-13-53-24.bpo-40854.O6vfQU.rst
deleted file mode 100644
index 6ef4ed5af7..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-03-13-53-24.bpo-40854.O6vfQU.rst
+++ /dev/null
@@ -1 +0,0 @@
-Allow overriding :data:`sys.platlibdir` via a new :envvar:`PYTHONPLATLIBDIR` environment variable.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-05-12-48-28.bpo-40870.9cd2sk.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-05-12-48-28.bpo-40870.9cd2sk.rst
deleted file mode 100644
index 8e943a29f3..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-05-12-48-28.bpo-40870.9cd2sk.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Raise :exc:`ValueError` when validating custom AST's where the constants
-``True``, ``False`` and ``None`` are used within a :class:`ast.Name` node.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-05-23-25-00.bpo-40883.M6sQ-Q.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-05-23-25-00.bpo-40883.M6sQ-Q.rst
deleted file mode 100644
index ebeb0cc60d..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-05-23-25-00.bpo-40883.M6sQ-Q.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix memory leak in when parsing f-strings in the new parser. Patch by Pablo Galindo \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-06-00-23-19.bpo-40880.fjdzSh.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-06-00-23-19.bpo-40880.fjdzSh.rst
deleted file mode 100644
index ab42f5c205..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-06-00-23-19.bpo-40880.fjdzSh.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix invalid memory read in the new parser when checking newlines in string
-literals. Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-07-22-50-10.bpo-40903.7dWejS.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-07-22-50-10.bpo-40903.7dWejS.rst
deleted file mode 100644
index 5ee72c14ad..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-07-22-50-10.bpo-40903.7dWejS.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixed a possible segfault in the new PEG parser when producing error messages for invalid assignments of the form :code:`p=p=`. Patch by Pablo Galindo \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-08-01-08-57.bpo-40904.76qQzo.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-08-01-08-57.bpo-40904.76qQzo.rst
deleted file mode 100644
index 09009b18c6..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-08-01-08-57.bpo-40904.76qQzo.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix possible segfault in the new PEG parser when parsing f-string containing
-yield statements with no value (:code:`f"{yield}"`). Patch by Pablo Galindo
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-08-22-46-33.bpo-40889.vIBl-W.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-08-22-46-33.bpo-40889.vIBl-W.rst
deleted file mode 100644
index 0ab1a261e3..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-08-22-46-33.bpo-40889.vIBl-W.rst
+++ /dev/null
@@ -1 +0,0 @@
-Improved the performance of symmetric difference operations on dictionary item views. Patch by Dennis Sweeney. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-09-00-20-13.bpo-40890.LoRV-g.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-09-00-20-13.bpo-40890.LoRV-g.rst
deleted file mode 100644
index eaefc894a1..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-09-00-20-13.bpo-40890.LoRV-g.rst
+++ /dev/null
@@ -1 +0,0 @@
-Each dictionary view now has a ``mapping`` attribute that provides a :class:`types.MappingProxyType` wrapping the original dictionary. Patch contributed by Dennis Sweeney. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-09-23-52-32.bpo-40847.4XAACw.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-09-23-52-32.bpo-40847.4XAACw.rst
deleted file mode 100644
index 0b489f2483..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-09-23-52-32.bpo-40847.4XAACw.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Fix a bug where a line with only a line continuation character is not considered a blank line at tokenizer level.
-In such cases, more than a single `NEWLINE` token was emitted. The old parser was working around the issue,
-but the new parser threw a :exc:`SyntaxError` for valid input due to this. For example, an empty line following
-a line continuation character was interpreted as a :exc:`SyntaxError`.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-10-11-27-15.bpo-40939.DO-wAI.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-10-11-27-15.bpo-40939.DO-wAI.rst
deleted file mode 100644
index b12985d081..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-10-11-27-15.bpo-40939.DO-wAI.rst
+++ /dev/null
@@ -1 +0,0 @@
-Remove the old parser, the :mod:`parser` module and all associated support code, command-line options and environment variables. Patch by Pablo Galindo. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-11-16-06-49.bpo-40947.72cZcR.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-11-16-06-49.bpo-40947.72cZcR.rst
deleted file mode 100644
index e7dfe06531..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-11-16-06-49.bpo-40947.72cZcR.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The Python :ref:`Path Configuration <init-path-config>` now takes
-:c:member:`PyConfig.platlibdir` in account.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-12-00-12-28.bpo-40950.tzMy7m.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-12-00-12-28.bpo-40950.tzMy7m.rst
deleted file mode 100644
index 925b5790f7..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-12-00-12-28.bpo-40950.tzMy7m.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add a state to the :mod:`nis` module (:pep:`3121`) and apply
-the multiphase initialization. Patch by Dong-hee Na.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-12-12-21-54.bpo-40957.Z8n6I6.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-12-12-21-54.bpo-40957.Z8n6I6.rst
deleted file mode 100644
index f99c374f94..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-12-12-21-54.bpo-40957.Z8n6I6.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix refleak in _Py_fopen_obj() when PySys_Audit() fails
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-12-22-56-17.bpo-1635741.mmlp3Q.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-12-22-56-17.bpo-1635741.mmlp3Q.rst
deleted file mode 100644
index ae12d25baa..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-12-22-56-17.bpo-1635741.mmlp3Q.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port :mod:`_dbm` to multiphase initialization.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-15-01-20-44.bpo-40958.7O2Wh1.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-15-01-20-44.bpo-40958.7O2Wh1.rst
deleted file mode 100644
index 8e36897948..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-15-01-20-44.bpo-40958.7O2Wh1.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix a possible buffer overflow in the PEG parser when gathering information
-for emitting syntax errors. Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-15-16-29-55.bpo-40985.IIN_xX.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-15-16-29-55.bpo-40985.IIN_xX.rst
deleted file mode 100644
index e07134c716..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-15-16-29-55.bpo-40985.IIN_xX.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix a bug that caused the :exc:`SyntaxError` text to be empty when a file ends with a line ending in a line continuation character (i.e. backslash). The error text should contain the text of the last line.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-17-00-52-21.bpo-1635741.61iyYh.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-17-00-52-21.bpo-1635741.61iyYh.rst
deleted file mode 100644
index cffe70dd71..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-17-00-52-21.bpo-1635741.61iyYh.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port :mod:`_gdbm` to multiphase initialization.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-17-10-27-17.bpo-40636.MYaCIe.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-17-10-27-17.bpo-40636.MYaCIe.rst
deleted file mode 100644
index ba26ad9373..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-17-10-27-17.bpo-40636.MYaCIe.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-:func:`zip` now supports :pep:`618`'s ``strict`` parameter, which raises a
-:exc:`ValueError` if the arguments are exhausted at different lengths.
-Patch by Brandt Bucher.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-18-00-07-09.bpo-41006.H-wN-d.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-18-00-07-09.bpo-41006.H-wN-d.rst
deleted file mode 100644
index 4593e6bb89..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-18-00-07-09.bpo-41006.H-wN-d.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The ``encodings.latin_1`` module is no longer imported at startup. Now it is
-only imported when it is the filesystem encoding or the stdio encoding.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-18-19-04-30.bpo-40077._yI-ax.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-18-19-04-30.bpo-40077._yI-ax.rst
deleted file mode 100644
index 2e0258a7b3..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-18-19-04-30.bpo-40077._yI-ax.rst
+++ /dev/null
@@ -1 +0,0 @@
-Convert :mod:`_bz2` to use :c:func:`PyType_FromSpec`.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-20-16-59-02.bpo-40939.6810Ak.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-20-16-59-02.bpo-40939.6810Ak.rst
deleted file mode 100644
index 8a626d479a..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-20-16-59-02.bpo-40939.6810Ak.rst
+++ /dev/null
@@ -1 +0,0 @@
-Remove the remaining files from the old parser and the :mod:`symbol` module. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-20-17-00-44.bpo-35975.UDHCHp.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-20-17-00-44.bpo-35975.UDHCHp.rst
deleted file mode 100644
index 73f4a6da2e..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-20-17-00-44.bpo-35975.UDHCHp.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Stefan Behnel reported that cf_feature_version is used even when
-PyCF_ONLY_AST is not set. This is against the intention and against the
-documented behavior, so it's been fixed.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-20-19-27-47.bpo-40939.jxJ4yn.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-20-19-27-47.bpo-40939.jxJ4yn.rst
deleted file mode 100644
index 7024dfe47a..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-20-19-27-47.bpo-40939.jxJ4yn.rst
+++ /dev/null
@@ -1 +0,0 @@
-Rename `PyPegen*` functions to `PyParser*`, so that we can remove the old set of `PyParser*` functions that were using the old parser, but keep everything backwards-compatible. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-20-22-46-18.bpo-41052.46MPeF.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-20-22-46-18.bpo-41052.46MPeF.rst
deleted file mode 100644
index 82969bf4a7..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-20-22-46-18.bpo-41052.46MPeF.rst
+++ /dev/null
@@ -1 +0,0 @@
-Opt out serialization/deserialization for _random.Random
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-21-10-54-02.bpo-41061.AHf9MU.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-21-10-54-02.bpo-41061.AHf9MU.rst
deleted file mode 100644
index b5bb81621b..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-21-10-54-02.bpo-41061.AHf9MU.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix incorrect expressions and asserts in hashtable code and tests.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-21-19-53-33.bpo-41056.IDu_EK.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-21-19-53-33.bpo-41056.IDu_EK.rst
deleted file mode 100644
index 25f93c9da3..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-21-19-53-33.bpo-41056.IDu_EK.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixes a reference to deallocated stack space during startup when constructing sys.path involving a relative symlink when code was supplied via -c. (discovered via Coverity) \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-22-13-22-30.bpo-41076.eWYw2N.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-22-13-22-30.bpo-41076.eWYw2N.rst
deleted file mode 100644
index f13560ad9d..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-22-13-22-30.bpo-41076.eWYw2N.rst
+++ /dev/null
@@ -1 +0,0 @@
-Pre-feed the parser with the location of the f-string expression, not the f-string itself, which allows us to skip the shifting of the AST node locations after the parsing is completed. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-07-35-11.bpo-40521.dMNA6k.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-23-07-35-11.bpo-40521.dMNA6k.rst
deleted file mode 100644
index 25f146e35e..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-07-35-11.bpo-40521.dMNA6k.rst
+++ /dev/null
@@ -1 +0,0 @@
-Empty frozensets are no longer singletons.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-15-10-19.bpo-41084.pt3y7F.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-23-15-10-19.bpo-41084.pt3y7F.rst
deleted file mode 100644
index cd349af770..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-15-10-19.bpo-41084.pt3y7F.rst
+++ /dev/null
@@ -1 +0,0 @@
-Prefix the error message with 'f-string: ', when parsing an f-string expression which throws a :exc:`SyntaxError`.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst
deleted file mode 100644
index f69fccfa4d..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The "hackcheck" that prevents sneaking around a type's __setattr__() by calling the
-superclass method was rewritten to allow C implemented heap types.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-23-26-42.bpo-41094.zEIJse.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-23-23-26-42.bpo-41094.zEIJse.rst
deleted file mode 100644
index 6dd45e21d1..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-23-26-42.bpo-41094.zEIJse.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix decoding errors with audit when open files with non-ASCII names on non-UTF-8
-locale.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
deleted file mode 100644
index d6176d69f0..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
+++ /dev/null
@@ -1 +0,0 @@
-add arm64 to the allowable Mac OS arches in mpdecimal.h \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst
deleted file mode 100644
index 844fb804c0..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Guard against a NULL pointer dereference within bytearrayobject triggered by
-the ``bytearray() + bytearray()`` operation.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-01-20-17-38.bpo-1635741.-AtPYu.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-01-20-17-38.bpo-1635741.-AtPYu.rst
deleted file mode 100644
index c529923779..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-01-20-17-38.bpo-1635741.-AtPYu.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port :mod:`sha256` to multiphase initialization
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-03-23-10-02.bpo-1635741.F5coWe.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-03-23-10-02.bpo-1635741.F5coWe.rst
deleted file mode 100644
index 927c8e5b70..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-03-23-10-02.bpo-1635741.F5coWe.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port :mod:`faulthandler` to multiphase initialization.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst
deleted file mode 100644
index d98b3433ef..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Python 3.8.3 had a regression where compiling with
-ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension
-with CO_COROUTINE. Now only list comprehension making use of async/await
-will tagged as so.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-18-36-33.bpo-41215.vFGFIz.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-18-36-33.bpo-41215.vFGFIz.rst
deleted file mode 100644
index 7343da31e9..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-18-36-33.bpo-41215.vFGFIz.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Use non-NULL default values in the PEG parser keyword list to overcome a bug that was preventing
-Python from being properly compiled when using the XLC compiler. Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-20-43-19.bpo-1635741.LYhsni.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-20-43-19.bpo-1635741.LYhsni.rst
deleted file mode 100644
index 956fcd5d1e..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-20-43-19.bpo-1635741.LYhsni.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port :mod:`winapi` to multiphase initialization
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-07-16-10-52.bpo-1635741.zU-H_n.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-07-16-10-52.bpo-1635741.zU-H_n.rst
deleted file mode 100644
index 52e184dc31..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-07-16-10-52.bpo-1635741.zU-H_n.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port :mod:`multiprocessing` to multi-phase initialization
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst
deleted file mode 100644
index 65f3189c83..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix incorrect refcounting in _ssl.c's ``_servername_callback()``.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst
deleted file mode 100644
index 08699b6e4a..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Always cache the running loop holder when running
-``asyncio.set_running_loop``.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-17-11-31-54.bpo-41323.ChbZHh.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-17-11-31-54.bpo-41323.ChbZHh.rst
deleted file mode 100644
index 671d874b53..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-17-11-31-54.bpo-41323.ChbZHh.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Bytecode optimizations are performed directly on the control flow graph.
-This will result in slightly more compact code objects in some
-circumstances.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-18-08-15-32.bpo-41295.pu8Ezo.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-18-08-15-32.bpo-41295.pu8Ezo.rst
deleted file mode 100644
index d61fd8f0a2..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-18-08-15-32.bpo-41295.pu8Ezo.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Resolve a regression in CPython 3.8.4 where defining "__setattr__" in a
-multi-inheritance setup and calling up the hierarchy chain could fail
-if builtins/extension types were involved in the base types.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-18-18-01-10.bpo-41334.t5xMGp.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-18-18-01-10.bpo-41334.t5xMGp.rst
deleted file mode 100644
index 5d44527a56..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-18-18-01-10.bpo-41334.t5xMGp.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Constructors :func:`str`, :func:`bytes` and :func:`bytearray` are now faster
-(around 30--40% for small objects).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-19-15-40-52.bpo-41342.RRk_m_.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-19-15-40-52.bpo-41342.RRk_m_.rst
deleted file mode 100644
index 38851a7f7f..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-19-15-40-52.bpo-41342.RRk_m_.rst
+++ /dev/null
@@ -1 +0,0 @@
-:func:`round` with integer argument is now faster (9--60%).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-20-17-01-17.bpo-38156.ptcdRy.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-20-17-01-17.bpo-38156.ptcdRy.rst
deleted file mode 100644
index 254d13cf3e..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-20-17-01-17.bpo-38156.ptcdRy.rst
+++ /dev/null
@@ -1 +0,0 @@
-Handle interrupts that come after EOF correctly in ``PyOS_StdioReadline``.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-27-01-50-06.bpo-41340.pZXfcF.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-27-01-50-06.bpo-41340.pZXfcF.rst
deleted file mode 100644
index 3a93a57693..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-27-01-50-06.bpo-41340.pZXfcF.rst
+++ /dev/null
@@ -1 +0,0 @@
-Removed fallback implementation for ``strdup``.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-28-22-43-27.bpo-41428.FM6xsI.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-28-22-43-27.bpo-41428.FM6xsI.rst
deleted file mode 100644
index a6652de927..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-07-28-22-43-27.bpo-41428.FM6xsI.rst
+++ /dev/null
@@ -1 +0,0 @@
-Implement PEP 604. This supports (int | str) etc. in place of Union[str, int]. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-02-15-53-12.bpo-41431.TblUBT.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-02-15-53-12.bpo-41431.TblUBT.rst
deleted file mode 100644
index fa9d047edc..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-02-15-53-12.bpo-41431.TblUBT.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Optimize ``dict_merge()`` for copying dict (e.g. ``dict(d)`` and
-``{}.update(d)``).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-10-16-11-32.bpo-1635741.O0d3ym.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-10-16-11-32.bpo-1635741.O0d3ym.rst
deleted file mode 100644
index 12af3d01ed..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-10-16-11-32.bpo-1635741.O0d3ym.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Port the :mod:`_sha1`, :mod:`_sha512`, and :mod:`_md5` extension modules
-to multi-phase initialization API (:pep:`489`).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-12-07-35-07.bpo-41525.d9q3XL.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-12-07-35-07.bpo-41525.d9q3XL.rst
deleted file mode 100644
index acc00f8b99..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-12-07-35-07.bpo-41525.d9q3XL.rst
+++ /dev/null
@@ -1 +0,0 @@
-The output of ``python --help`` contains now only ASCII characters.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-12-19-32-15.bpo-41531.WgPzjT.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-12-19-32-15.bpo-41531.WgPzjT.rst
deleted file mode 100644
index 8544664f39..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-12-19-32-15.bpo-41531.WgPzjT.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix a bug that was dropping keys when compiling dict literals with more than
-0xFFFF elements. Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-12-20-29-57.bpo-41533.4pcVAc.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-12-20-29-57.bpo-41533.4pcVAc.rst
deleted file mode 100644
index e166f0c0b6..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-12-20-29-57.bpo-41533.4pcVAc.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Free the stack allocated in ``va_build_stack`` if ``do_mkstack`` fails and
-the stack is not a ``small_stack``.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-13-07-18-05.bpo-1635741.FC13e7.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-13-07-18-05.bpo-1635741.FC13e7.rst
deleted file mode 100644
index cdfee87409..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-13-07-18-05.bpo-1635741.FC13e7.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port the :mod:`_blake2` extension module to the multi-phase initialization API (:pep:`489`).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-13-07-19-21.bpo-1653741.fubBkb.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-13-07-19-21.bpo-1653741.fubBkb.rst
deleted file mode 100644
index 73a4fdbac4..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-13-07-19-21.bpo-1653741.fubBkb.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port :mod:`_sha3` to multi-phase init. Convert static types to heap types.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-25-22-43-33.bpo-40077.vcxSUa.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-25-22-43-33.bpo-40077.vcxSUa.rst
deleted file mode 100644
index ee950010e6..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-25-22-43-33.bpo-40077.vcxSUa.rst
+++ /dev/null
@@ -1 +0,0 @@
-Convert :mod:`_operator` to use :c:func:`PyType_FromSpec`.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-26-11-23-31.bpo-41631.3jZcd9.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-26-11-23-31.bpo-41631.3jZcd9.rst
deleted file mode 100644
index 68bb51024d..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-26-11-23-31.bpo-41631.3jZcd9.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-The ``_ast`` module uses again a global state. Using a module state per module
-instance is causing subtle practical problems. For example, the Mercurial
-project replaces the ``__import__()`` function to implement lazy import,
-whereas Python expected that ``import _ast`` always return a fully initialized
-``_ast`` module.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-28-20-54-04.bpo-1635741.7ijlcI.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-28-20-54-04.bpo-1635741.7ijlcI.rst
deleted file mode 100644
index 4d6ce1185e..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-28-20-54-04.bpo-1635741.7ijlcI.rst
+++ /dev/null
@@ -1 +0,0 @@
-Port the :mod:`zlib` extension module to multi-phase initialization (:pep:`489`).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-30-20-38-33.bpo-41654.HtnhAM.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-30-20-38-33.bpo-41654.HtnhAM.rst
deleted file mode 100644
index e05c3133e1..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-30-20-38-33.bpo-41654.HtnhAM.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix a crash that occurred when destroying subclasses of
-:class:`MemoryError`. Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-31-14-53-17.bpo-41675.VSoqWU.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-31-14-53-17.bpo-41675.VSoqWU.rst
deleted file mode 100644
index aa102f8fe4..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-31-14-53-17.bpo-41675.VSoqWU.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-The implementation of :func:`signal.siginterrupt` now uses :c:func:`sigaction`
-(if it is available in the system) instead of the deprecated :c:func:`siginterrupt`.
-Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-31-17-49-02.bpo-41681.3-VJiH.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-31-17-49-02.bpo-41681.3-VJiH.rst
deleted file mode 100644
index ed557f92d8..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-08-31-17-49-02.bpo-41681.3-VJiH.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixes the wrong error description in the error raised by using 2 `,` in
-format string in f-string and :meth:`str.format`.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-06-02.bpo-1635741.5jZymK.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-06-02.bpo-1635741.5jZymK.rst
deleted file mode 100644
index c3bc9a78a2..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-06-02.bpo-1635741.5jZymK.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Port the :mod:`_opcode` extension module to multi-phase initialization
-(:pep:`489`).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-08-07.bpo-1635741.X9CZgo.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-08-07.bpo-1635741.X9CZgo.rst
deleted file mode 100644
index a39673a263..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-08-07.bpo-1635741.X9CZgo.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Port the :mod:`_curses_panel` extension module to multi-phase initialization
-(:pep:`489`).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-22-35.bpo-1635741.CnRME3.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-22-35.bpo-1635741.CnRME3.rst
deleted file mode 100644
index 76f985bb87..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-01-17-22-35.bpo-1635741.CnRME3.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Port the :mod:`_overlapped` extension module to multi-phase initialization
-(:pep:`489`).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-02-12-00-57.bpo-41690.Ny-Sfy.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-02-12-00-57.bpo-41690.Ny-Sfy.rst
deleted file mode 100644
index 5711aa5a55..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-02-12-00-57.bpo-41690.Ny-Sfy.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix a possible stack overflow in the parser when parsing functions and
-classes with a huge ammount of arguments. Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-07-09-45-47.bpo-1635741.QuDIut.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-07-09-45-47.bpo-1635741.QuDIut.rst
deleted file mode 100644
index 90e56542d1..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-07-09-45-47.bpo-1635741.QuDIut.rst
+++ /dev/null
@@ -1 +0,0 @@
-Convert the :mod:`_sha256` extension module types to heap types.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-07-11-35-02.bpo-1635741.rvIexb.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-07-11-35-02.bpo-1635741.rvIexb.rst
deleted file mode 100644
index 1e19b34b37..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-07-11-35-02.bpo-1635741.rvIexb.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Port the :mod:`termios` extension module to multi-phase initialization
-(:pep:`489`).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-08-20-39-43.bpo-1635741.jiXmyT.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-08-20-39-43.bpo-1635741.jiXmyT.rst
deleted file mode 100644
index 17752b2ccd..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-08-20-39-43.bpo-1635741.jiXmyT.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Port the :mod:`_scproxy` extension module to multi-phase initialization
-(:pep:`489`).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-08-21-58-47.bpo-1635741.vdjSLH.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-08-21-58-47.bpo-1635741.vdjSLH.rst
deleted file mode 100644
index bc1a6c888e..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-08-21-58-47.bpo-1635741.vdjSLH.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Port the :mod:`cmath` extension module to multi-phase initialization
-(:pep:`489`).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-12-12-55-45.bpo-41756.1h0tbV.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-12-12-55-45.bpo-41756.1h0tbV.rst
deleted file mode 100644
index b387cfd940..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-12-12-55-45.bpo-41756.1h0tbV.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add PyGen_Send function to allow sending value into generator/coroutine
-without raising StopIteration exception to signal return
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-12-18-34-34.bpo-1635741.lh335O.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-12-18-34-34.bpo-1635741.lh335O.rst
deleted file mode 100644
index ba61819df9..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-12-18-34-34.bpo-1635741.lh335O.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Port the :mod:`_lsprof` extension module to multi-phase initialization
-(:pep:`489`).
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-15-23-29-49.bpo-41780.bOBUIH.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-15-23-29-49.bpo-41780.bOBUIH.rst
deleted file mode 100644
index 9a7594fc45..0000000000
--- a/Misc/NEWS.d/next/Core and Builtins/2020-09-15-23-29-49.bpo-41780.bOBUIH.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix :meth:`__dir__` of :class:`types.GenericAlias`. Patch by Batuhan
-Taskaya.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-02-11-35-33.bpo-41894.ffmtOt.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-02-11-35-33.bpo-41894.ffmtOt.rst
new file mode 100644
index 0000000000..571f5dae1a
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-10-02-11-35-33.bpo-41894.ffmtOt.rst
@@ -0,0 +1,3 @@
+When loading a native module and a load failure occurs, prevent a possible
+UnicodeDecodeError when not running in a UTF-8 locale by decoding the load
+error message using the current locale's encoding.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-08-09-58-19.bpo-41974.8B-q8O.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-08-09-58-19.bpo-41974.8B-q8O.rst
new file mode 100644
index 0000000000..034cfede84
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-10-08-09-58-19.bpo-41974.8B-q8O.rst
@@ -0,0 +1,4 @@
+Removed special methods ``__int__``, ``__float__``, ``__floordiv__``,
+``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and
+``__rdivmod__`` of the :class:`complex` class. They always raised
+a :exc:`TypeError`.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-09-10-55-50.bpo-41979.ImXIk2.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-09-10-55-50.bpo-41979.ImXIk2.rst
new file mode 100644
index 0000000000..3250309ca2
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-10-09-10-55-50.bpo-41979.ImXIk2.rst
@@ -0,0 +1 @@
+Star-unpacking is now allowed for with item's targets in the PEG parser.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-10-13-53-52.bpo-41993.YMzixQ.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-10-13-53-52.bpo-41993.YMzixQ.rst
new file mode 100644
index 0000000000..3669cf11ea
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-10-10-13-53-52.bpo-41993.YMzixQ.rst
@@ -0,0 +1,2 @@
+Fixed potential issues with removing not completely initialized module from
+``sys.modules`` when import fails.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-14-16-19-43.bpo-41984.SEtKMr.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-14-16-19-43.bpo-41984.SEtKMr.rst
new file mode 100644
index 0000000000..e70d5dc2b8
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-10-14-16-19-43.bpo-41984.SEtKMr.rst
@@ -0,0 +1,2 @@
+The garbage collector now tracks all user-defined classes. Patch by Brandt
+Bucher.
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-15-21-55-32.bpo-42030.PmU2CA.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-15-21-55-32.bpo-42030.PmU2CA.rst
new file mode 100644
index 0000000000..e8c691d809
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-10-15-21-55-32.bpo-42030.PmU2CA.rst
@@ -0,0 +1,3 @@
+Support for the legacy AIX-specific shared library loading support has been
+removed. All versions of AIX since 4.3 have supported and defaulted to using
+the common Unix mechanism instead.
diff --git a/Misc/NEWS.d/next/Documentation/2019-08-16-20-25-42.bpo-37703.Qm_l_H.rst b/Misc/NEWS.d/next/Documentation/2019-08-16-20-25-42.bpo-37703.Qm_l_H.rst
deleted file mode 100644
index a1a1c354b1..0000000000
--- a/Misc/NEWS.d/next/Documentation/2019-08-16-20-25-42.bpo-37703.Qm_l_H.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Updated Documentation to comprehensively elaborate on the behaviour of
-gather.cancel()
diff --git a/Misc/NEWS.d/next/Documentation/2020-03-07-03-53-39.bpo-39883.1tnb4-.rst b/Misc/NEWS.d/next/Documentation/2020-03-07-03-53-39.bpo-39883.1tnb4-.rst
deleted file mode 100644
index 4941d50a56..0000000000
--- a/Misc/NEWS.d/next/Documentation/2020-03-07-03-53-39.bpo-39883.1tnb4-.rst
+++ /dev/null
@@ -1 +0,0 @@
-Make code, examples, and recipes in the Python documentation be licensed under the more permissive BSD0 license in addition to the existing Python 2.0 license. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Documentation/2020-05-09-12-10-31.bpo-40552._0uB73.rst b/Misc/NEWS.d/next/Documentation/2020-05-09-12-10-31.bpo-40552._0uB73.rst
deleted file mode 100644
index 5ed9c31834..0000000000
--- a/Misc/NEWS.d/next/Documentation/2020-05-09-12-10-31.bpo-40552._0uB73.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix in tutorial section 4.2.
-Code snippet is now correct. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Documentation/2020-07-21-15-23-30.bpo-40979.pLA8rO.rst b/Misc/NEWS.d/next/Documentation/2020-07-21-15-23-30.bpo-40979.pLA8rO.rst
deleted file mode 100644
index b0ca4327ad..0000000000
--- a/Misc/NEWS.d/next/Documentation/2020-07-21-15-23-30.bpo-40979.pLA8rO.rst
+++ /dev/null
@@ -1 +0,0 @@
-Refactored typing.rst, arranging more than 70 classes, functions, and decorators into new sub-sections. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Documentation/2020-07-25-14-20-00.bpo-41314.yrjko0.rst b/Misc/NEWS.d/next/Documentation/2020-07-25-14-20-00.bpo-41314.yrjko0.rst
deleted file mode 100644
index 48f9c93382..0000000000
--- a/Misc/NEWS.d/next/Documentation/2020-07-25-14-20-00.bpo-41314.yrjko0.rst
+++ /dev/null
@@ -1 +0,0 @@
-Changed the release when ``from __future__ import annotations`` becomes the default from ``4.0`` to ``3.10`` (following a change in PEP 563).
diff --git a/Misc/NEWS.d/next/Documentation/2020-07-27-20-46-17.bpo-41045.GFF6Ul.rst b/Misc/NEWS.d/next/Documentation/2020-07-27-20-46-17.bpo-41045.GFF6Ul.rst
deleted file mode 100644
index dfc9891bb8..0000000000
--- a/Misc/NEWS.d/next/Documentation/2020-07-27-20-46-17.bpo-41045.GFF6Ul.rst
+++ /dev/null
@@ -1 +0,0 @@
-Add documentation for debug feature of f-strings. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst b/Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst
deleted file mode 100644
index 152f6c98b9..0000000000
--- a/Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Enable Sphinx 3.2 ``c_allow_pre_v3`` option and disable
-``c_warn_on_allowed_pre_v3`` option to make the documentation compatible
-with Sphinx 2 and Sphinx 3.
diff --git a/Misc/NEWS.d/next/Documentation/2020-08-25-15-11-23.bpo-41624.ddjJlN.rst b/Misc/NEWS.d/next/Documentation/2020-08-25-15-11-23.bpo-41624.ddjJlN.rst
deleted file mode 100644
index bdbc5a445f..0000000000
--- a/Misc/NEWS.d/next/Documentation/2020-08-25-15-11-23.bpo-41624.ddjJlN.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix the signature of :class:`typing.Coroutine`.
diff --git a/Misc/NEWS.d/next/Documentation/2020-09-08-16-57-09.bpo-41726.g0UXrn.rst b/Misc/NEWS.d/next/Documentation/2020-09-08-16-57-09.bpo-41726.g0UXrn.rst
deleted file mode 100644
index 1079a757c0..0000000000
--- a/Misc/NEWS.d/next/Documentation/2020-09-08-16-57-09.bpo-41726.g0UXrn.rst
+++ /dev/null
@@ -1 +0,0 @@
-Update the refcounts info of ``PyType_FromModuleAndSpec``.
diff --git a/Misc/NEWS.d/next/Documentation/2020-09-10-07-48-02.bpo-37149.VD0rCv.rst b/Misc/NEWS.d/next/Documentation/2020-09-10-07-48-02.bpo-37149.VD0rCv.rst
deleted file mode 100644
index aeca652b4e..0000000000
--- a/Misc/NEWS.d/next/Documentation/2020-09-10-07-48-02.bpo-37149.VD0rCv.rst
+++ /dev/null
@@ -1 +0,0 @@
-Change Shipman tkinter doc link from archive.org to TkDocs. (The doc has been removed from the NMT server.) The new link responds much faster and includes a short explanatory note.
diff --git a/Misc/NEWS.d/next/Documentation/2020-09-12-17-37-13.bpo-35293._cOwPD.rst b/Misc/NEWS.d/next/Documentation/2020-09-12-17-37-13.bpo-35293._cOwPD.rst
deleted file mode 100644
index 089d44e35d..0000000000
--- a/Misc/NEWS.d/next/Documentation/2020-09-12-17-37-13.bpo-35293._cOwPD.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix RemovedInSphinx40Warning when building the documentation. Patch by Dong-hee Na.
diff --git a/Misc/NEWS.d/next/IDLE/2020-05-24-06-19-43.bpo-40723.AJLd4U.rst b/Misc/NEWS.d/next/IDLE/2020-05-24-06-19-43.bpo-40723.AJLd4U.rst
deleted file mode 100644
index e0de2f9d83..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-05-24-06-19-43.bpo-40723.AJLd4U.rst
+++ /dev/null
@@ -1 +0,0 @@
-Make test_idle pass when run after import.
diff --git a/Misc/NEWS.d/next/IDLE/2020-05-29-18-21-58.bpo-39885.zB_-bN.rst b/Misc/NEWS.d/next/IDLE/2020-05-29-18-21-58.bpo-39885.zB_-bN.rst
deleted file mode 100644
index a847b75997..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-05-29-18-21-58.bpo-39885.zB_-bN.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Make context menu Cut and Copy work again when right-clicking within a
-selection.
diff --git a/Misc/NEWS.d/next/IDLE/2020-06-27-17-02-00.bpo-41144.JoFGIX.rst b/Misc/NEWS.d/next/IDLE/2020-06-27-17-02-00.bpo-41144.JoFGIX.rst
deleted file mode 100644
index ed558d3e7d..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-06-27-17-02-00.bpo-41144.JoFGIX.rst
+++ /dev/null
@@ -1 +0,0 @@
-Make Open Module open a special module such as os.path.
diff --git a/Misc/NEWS.d/next/IDLE/2020-06-29-14-51-15.bpo-41152.d6mV0C.rst b/Misc/NEWS.d/next/IDLE/2020-06-29-14-51-15.bpo-41152.d6mV0C.rst
deleted file mode 100644
index 434be10b53..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-06-29-14-51-15.bpo-41152.d6mV0C.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The encoding of ``stdin``, ``stdout`` and ``stderr`` in IDLE is now always
-UTF-8.
diff --git a/Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst b/Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst
deleted file mode 100644
index f8b53ca482..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add keywords to module name completion list. Rewrite Completions
-section of IDLE doc.
diff --git a/Misc/NEWS.d/next/IDLE/2020-07-16-17-39-06.bpo-41300.wRixNb.rst b/Misc/NEWS.d/next/IDLE/2020-07-16-17-39-06.bpo-41300.wRixNb.rst
deleted file mode 100644
index 080775f7d7..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-07-16-17-39-06.bpo-41300.wRixNb.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Save files with non-ascii chars. Fix regression released in 3.9.0b4 and
-3.8.4.
diff --git a/Misc/NEWS.d/next/IDLE/2020-07-24-17-49-58.bpo-41373.YQIPu_.rst b/Misc/NEWS.d/next/IDLE/2020-07-24-17-49-58.bpo-41373.YQIPu_.rst
deleted file mode 100644
index b50a72fe67..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-07-24-17-49-58.bpo-41373.YQIPu_.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Save files loaded with no line ending, as when blank, or different line
-endings, by setting its line ending to the system default. Fix regression in
-3.8.4 and 3.9.0b4.
diff --git a/Misc/NEWS.d/next/IDLE/2020-08-09-13-42-55.bpo-41468.zkP0_Y.rst b/Misc/NEWS.d/next/IDLE/2020-08-09-13-42-55.bpo-41468.zkP0_Y.rst
deleted file mode 100644
index e41c7d5749..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-08-09-13-42-55.bpo-41468.zkP0_Y.rst
+++ /dev/null
@@ -1 +0,0 @@
-Improve IDLE run crash error message (which users should never see).
diff --git a/Misc/NEWS.d/next/IDLE/2020-09-22-00-45-40.bpo-40181.hhQi3z.rst b/Misc/NEWS.d/next/IDLE/2020-09-22-00-45-40.bpo-40181.hhQi3z.rst
deleted file mode 100644
index b6866e19c4..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-09-22-00-45-40.bpo-40181.hhQi3z.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-In calltips, stop reminding that '/' marks the end of positional-only
-arguments.
diff --git a/Misc/NEWS.d/next/IDLE/2020-09-22-11-13-45.bpo-35764.VoNa8y.rst b/Misc/NEWS.d/next/IDLE/2020-09-22-11-13-45.bpo-35764.VoNa8y.rst
deleted file mode 100644
index eb62d3699d..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-09-22-11-13-45.bpo-35764.VoNa8y.rst
+++ /dev/null
@@ -1 +0,0 @@
-Rewrite the Calltips doc section.
diff --git a/Misc/NEWS.d/next/IDLE/2020-09-24-14-31-16.bpo-41775.sB8Vre.rst b/Misc/NEWS.d/next/IDLE/2020-09-24-14-31-16.bpo-41775.sB8Vre.rst
deleted file mode 100644
index 59605fa402..0000000000
--- a/Misc/NEWS.d/next/IDLE/2020-09-24-14-31-16.bpo-41775.sB8Vre.rst
+++ /dev/null
@@ -1 +0,0 @@
-Use 'IDLE Shell' as shell title
diff --git a/Misc/NEWS.d/next/Library/2018-06-07-22-04-01.bpo-28557.ViNJnK.rst b/Misc/NEWS.d/next/Library/2018-06-07-22-04-01.bpo-28557.ViNJnK.rst
deleted file mode 100644
index 4137e2ff89..0000000000
--- a/Misc/NEWS.d/next/Library/2018-06-07-22-04-01.bpo-28557.ViNJnK.rst
+++ /dev/null
@@ -1 +0,0 @@
-Improve the error message for a misbehaving ``rawio.readinto``
diff --git a/Misc/NEWS.d/next/Library/2018-06-12-23-30-41.bpo-33660.AdDn5Z.rst b/Misc/NEWS.d/next/Library/2018-06-12-23-30-41.bpo-33660.AdDn5Z.rst
deleted file mode 100644
index cce3dbb1c6..0000000000
--- a/Misc/NEWS.d/next/Library/2018-06-12-23-30-41.bpo-33660.AdDn5Z.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix pathlib.PosixPath to resolve a relative path located on the root
-directory properly.
diff --git a/Misc/NEWS.d/next/Library/2018-07-29-12-14-54.bpo-34226.BE7zbu.rst b/Misc/NEWS.d/next/Library/2018-07-29-12-14-54.bpo-34226.BE7zbu.rst
deleted file mode 100644
index 2656b4bf22..0000000000
--- a/Misc/NEWS.d/next/Library/2018-07-29-12-14-54.bpo-34226.BE7zbu.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix `cgi.parse_multipart` without content_length. Patch by Roger Duran
diff --git a/Misc/NEWS.d/next/Library/2018-07-30-12-48-17.bpo-31844.0_GKsD.rst b/Misc/NEWS.d/next/Library/2018-07-30-12-48-17.bpo-31844.0_GKsD.rst
deleted file mode 100644
index 9034afd328..0000000000
--- a/Misc/NEWS.d/next/Library/2018-07-30-12-48-17.bpo-31844.0_GKsD.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Remove ``ParserBase.error()`` method from the private and undocumented
-``_markupbase`` module. :class:`html.parser.HTMLParser` is the only
-subclass of ``ParserBase`` and its ``error()`` implementation was deprecated
-in Python 3.4 and removed in Python 3.5.
diff --git a/Misc/NEWS.d/next/Library/2018-08-21-16-20-33.bpo-29620.xxx666.rst b/Misc/NEWS.d/next/Library/2018-08-21-16-20-33.bpo-29620.xxx666.rst
deleted file mode 100644
index d781919504..0000000000
--- a/Misc/NEWS.d/next/Library/2018-08-21-16-20-33.bpo-29620.xxx666.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-:func:`~unittest.TestCase.assertWarns` no longer raises a ``RuntimeException``
-when accessing a module's ``__warningregistry__`` causes importation of a new
-module, or when a new module is imported in another thread. Patch by Kernc.
diff --git a/Misc/NEWS.d/next/Library/2018-10-27-09-37-03.bpo-35078.kweA3R.rst b/Misc/NEWS.d/next/Library/2018-10-27-09-37-03.bpo-35078.kweA3R.rst
deleted file mode 100644
index 123f9dabde..0000000000
--- a/Misc/NEWS.d/next/Library/2018-10-27-09-37-03.bpo-35078.kweA3R.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Refactor formatweekday, formatmonthname methods in LocaleHTMLCalendar and LocaleTextCalendar classes in calendar module to call the base class methods.This enables customizable CSS classes for LocaleHTMLCalendar.
-Patch by Srinivas Reddy Thatiparthy
-
diff --git a/Misc/NEWS.d/next/Library/2019-03-01-01-56-23.bpo-33944.-82Pkt.rst b/Misc/NEWS.d/next/Library/2019-03-01-01-56-23.bpo-33944.-82Pkt.rst
deleted file mode 100644
index b0c953dd67..0000000000
--- a/Misc/NEWS.d/next/Library/2019-03-01-01-56-23.bpo-33944.-82Pkt.rst
+++ /dev/null
@@ -1 +0,0 @@
-Added site.py site-packages tracing in verbose mode.
diff --git a/Misc/NEWS.d/next/Library/2019-03-17-19-01-53.bpo-36290.7VXo_K.rst b/Misc/NEWS.d/next/Library/2019-03-17-19-01-53.bpo-36290.7VXo_K.rst
deleted file mode 100644
index a9afe62b0c..0000000000
--- a/Misc/NEWS.d/next/Library/2019-03-17-19-01-53.bpo-36290.7VXo_K.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-AST nodes are now raising :exc:`TypeError` on conflicting keyword arguments.
-Patch contributed by Rémi Lapeyre.
diff --git a/Misc/NEWS.d/next/Library/2019-05-31-23-54-28.bpo-12178.N6FLCZ.rst b/Misc/NEWS.d/next/Library/2019-05-31-23-54-28.bpo-12178.N6FLCZ.rst
deleted file mode 100644
index 80e2a7b5fb..0000000000
--- a/Misc/NEWS.d/next/Library/2019-05-31-23-54-28.bpo-12178.N6FLCZ.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-:func:`csv.writer` now correctly escapes *escapechar* when input
-contains *escapechar*. Patch by Catalin Iacob, Berker Peksag,
-and Itay Elbirt.
diff --git a/Misc/NEWS.d/next/Library/2019-08-11-16-28-03.bpo-26543.X-TJZO.rst b/Misc/NEWS.d/next/Library/2019-08-11-16-28-03.bpo-26543.X-TJZO.rst
deleted file mode 100644
index 8715b8d79c..0000000000
--- a/Misc/NEWS.d/next/Library/2019-08-11-16-28-03.bpo-26543.X-TJZO.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix :meth:`IMAP4.noop()` when debug mode is enabled (ex: ``imaplib.Debug = 3``).
diff --git a/Misc/NEWS.d/next/Library/2019-09-12-21-34-03.bpo-38144.8uQCdd.rst b/Misc/NEWS.d/next/Library/2019-09-12-21-34-03.bpo-38144.8uQCdd.rst
deleted file mode 100644
index 2c335bf29c..0000000000
--- a/Misc/NEWS.d/next/Library/2019-09-12-21-34-03.bpo-38144.8uQCdd.rst
+++ /dev/null
@@ -1 +0,0 @@
-Added the *root_dir* and *dir_fd* parameters in :func:`glob.glob`.
diff --git a/Misc/NEWS.d/next/Library/2019-10-25-23-45-49.bpo-35714.fw3xb7.rst b/Misc/NEWS.d/next/Library/2019-10-25-23-45-49.bpo-35714.fw3xb7.rst
deleted file mode 100644
index 39102065ca..0000000000
--- a/Misc/NEWS.d/next/Library/2019-10-25-23-45-49.bpo-35714.fw3xb7.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:exc:`struct.error` is now raised if there is a null character in a
-:mod:`struct` format string.
diff --git a/Misc/NEWS.d/next/Library/2019-11-13-07-37-11.bpo-38731.9qmcSx.rst b/Misc/NEWS.d/next/Library/2019-11-13-07-37-11.bpo-38731.9qmcSx.rst
deleted file mode 100644
index ba9e522ecf..0000000000
--- a/Misc/NEWS.d/next/Library/2019-11-13-07-37-11.bpo-38731.9qmcSx.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add ``--quiet`` option to command-line interface of :mod:`py_compile`.
-Patch by Gregory Schevchenko.
diff --git a/Misc/NEWS.d/next/Library/2019-12-15-18-47-20.bpo-39040.tKa0Qs.rst b/Misc/NEWS.d/next/Library/2019-12-15-18-47-20.bpo-39040.tKa0Qs.rst
deleted file mode 100644
index 078bce22be..0000000000
--- a/Misc/NEWS.d/next/Library/2019-12-15-18-47-20.bpo-39040.tKa0Qs.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix parsing of invalid mime headers parameters by collapsing whitespace between
-encoded words in a bare-quote-string.
diff --git a/Misc/NEWS.d/next/Library/2020-02-23-15-09-47.bpo-39244.aBK5IM.rst b/Misc/NEWS.d/next/Library/2020-02-23-15-09-47.bpo-39244.aBK5IM.rst
deleted file mode 100644
index c7d8e0de67..0000000000
--- a/Misc/NEWS.d/next/Library/2020-02-23-15-09-47.bpo-39244.aBK5IM.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixed :class:`multiprocessing.context.get_all_start_methods`
-to properly return the default method first on macOS.
diff --git a/Misc/NEWS.d/next/Library/2020-02-24-10-58-34.bpo-39728.kOOaHn.rst b/Misc/NEWS.d/next/Library/2020-02-24-10-58-34.bpo-39728.kOOaHn.rst
deleted file mode 100644
index beb2016a85..0000000000
--- a/Misc/NEWS.d/next/Library/2020-02-24-10-58-34.bpo-39728.kOOaHn.rst
+++ /dev/null
@@ -1 +0,0 @@
-fix default `_missing_` so a duplicate `ValueError` is not set as the `__context__` of the original `ValueError`
diff --git a/Misc/NEWS.d/next/Library/2020-03-11-07-44-06.bpo-31122.zIQ80l.rst b/Misc/NEWS.d/next/Library/2020-03-11-07-44-06.bpo-31122.zIQ80l.rst
deleted file mode 100644
index 2e70f7aee6..0000000000
--- a/Misc/NEWS.d/next/Library/2020-03-11-07-44-06.bpo-31122.zIQ80l.rst
+++ /dev/null
@@ -1 +0,0 @@
-ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-03-29-21-32-00.bpo-40084.MCYwcv.rst b/Misc/NEWS.d/next/Library/2020-03-29-21-32-00.bpo-40084.MCYwcv.rst
deleted file mode 100644
index 65ff4ce36e..0000000000
--- a/Misc/NEWS.d/next/Library/2020-03-29-21-32-00.bpo-40084.MCYwcv.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix ``Enum.__dir__``: dir(Enum.member) now includes attributes as well as methods.
diff --git a/Misc/NEWS.d/next/Library/2020-04-18-14-16-02.bpo-40318.K2UdRx.rst b/Misc/NEWS.d/next/Library/2020-04-18-14-16-02.bpo-40318.K2UdRx.rst
deleted file mode 100644
index 3d5fcfb74a..0000000000
--- a/Misc/NEWS.d/next/Library/2020-04-18-14-16-02.bpo-40318.K2UdRx.rst
+++ /dev/null
@@ -1 +0,0 @@
-Use SQLite3 trace v2 API, if it is available.
diff --git a/Misc/NEWS.d/next/Library/2020-04-20-22-08-36.bpo-23082.iX90Id.rst b/Misc/NEWS.d/next/Library/2020-04-20-22-08-36.bpo-23082.iX90Id.rst
deleted file mode 100644
index 13ed0defe5..0000000000
--- a/Misc/NEWS.d/next/Library/2020-04-20-22-08-36.bpo-23082.iX90Id.rst
+++ /dev/null
@@ -1 +0,0 @@
-Updated the error message and docs of PurePath.relative_to() to better reflect the function behaviour. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-04-23-18-21-19.bpo-39385.MIAyS7.rst b/Misc/NEWS.d/next/Library/2020-04-23-18-21-19.bpo-39385.MIAyS7.rst
deleted file mode 100644
index e6c5c0dd43..0000000000
--- a/Misc/NEWS.d/next/Library/2020-04-23-18-21-19.bpo-39385.MIAyS7.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-A new test assertion context-manager, :func:`unittest.assertNoLogs` will
-ensure a given block of code emits no log messages using the logging module.
-Contributed by Kit Yan Choi.
diff --git a/Misc/NEWS.d/next/Library/2020-05-04-12-16-00.bpo-40492.ONk9Na.rst b/Misc/NEWS.d/next/Library/2020-05-04-12-16-00.bpo-40492.ONk9Na.rst
new file mode 100644
index 0000000000..86bc08c79e
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-05-04-12-16-00.bpo-40492.ONk9Na.rst
@@ -0,0 +1,3 @@
+Fix ``--outfile`` for :mod:`cProfile` / :mod:`profile` not writing the output
+file in the original directory when the program being profiled changes the
+working directory. PR by Anthony Sottile.
diff --git a/Misc/NEWS.d/next/Library/2020-05-06-02-01-25.bpo-13097.Wh5xSK.rst b/Misc/NEWS.d/next/Library/2020-05-06-02-01-25.bpo-13097.Wh5xSK.rst
deleted file mode 100644
index a7f5f58828..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-06-02-01-25.bpo-13097.Wh5xSK.rst
+++ /dev/null
@@ -1 +0,0 @@
-``ctypes`` now raises an ``ArgumentError`` when a callback is invoked with more than 1024 arguments. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-05-07-22-00-12.bpo-39881.E1xsNv.rst b/Misc/NEWS.d/next/Library/2020-05-07-22-00-12.bpo-39881.E1xsNv.rst
deleted file mode 100644
index 1129cd7649..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-07-22-00-12.bpo-39881.E1xsNv.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-PEP 554 for use in the test suite.
-(Patch By Joannah Nanjekye) \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-05-13-16-28-33.bpo-40611.ZCk0_c.rst b/Misc/NEWS.d/next/Library/2020-05-13-16-28-33.bpo-40611.ZCk0_c.rst
deleted file mode 100644
index 50ef3ad200..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-13-16-28-33.bpo-40611.ZCk0_c.rst
+++ /dev/null
@@ -1 +0,0 @@
-:data:`~mmap.MAP_POPULATE` constant has now been added to the list of exported :mod:`mmap` module flags.
diff --git a/Misc/NEWS.d/next/Library/2020-05-15-21-14-45.bpo-36543.Jt-eSX.rst b/Misc/NEWS.d/next/Library/2020-05-15-21-14-45.bpo-36543.Jt-eSX.rst
deleted file mode 100644
index 468c1ac9ee..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-15-21-14-45.bpo-36543.Jt-eSX.rst
+++ /dev/null
@@ -1 +0,0 @@
-Restored the deprecated :mod:`xml.etree.cElementTree` module.
diff --git a/Misc/NEWS.d/next/Library/2020-05-17-02-03-09.bpo-32309.KM9psl.rst b/Misc/NEWS.d/next/Library/2020-05-17-02-03-09.bpo-32309.KM9psl.rst
deleted file mode 100644
index 6272c35edf..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-17-02-03-09.bpo-32309.KM9psl.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Added a new :term:`coroutine` :func:`asyncio.to_thread`. It is mainly used for
-running IO-bound functions in a separate thread to avoid blocking the event
-loop, and essentially works as a high-level version of
-:meth:`~asyncio.loop.run_in_executor` that can directly take keyword arguments. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-05-18-15-26-31.bpo-40671.NeZ9Cy.rst b/Misc/NEWS.d/next/Library/2020-05-18-15-26-31.bpo-40671.NeZ9Cy.rst
deleted file mode 100644
index d38b88dbf3..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-18-15-26-31.bpo-40671.NeZ9Cy.rst
+++ /dev/null
@@ -1 +0,0 @@
-Prepare ``_hashlib`` for :pep:`489` and use :c:func:`PyModule_AddType`.
diff --git a/Misc/NEWS.d/next/Library/2020-05-18-15-38-25.bpo-25920.PxrLY8.rst b/Misc/NEWS.d/next/Library/2020-05-18-15-38-25.bpo-25920.PxrLY8.rst
deleted file mode 100644
index cc60e97628..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-18-15-38-25.bpo-25920.PxrLY8.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-On macOS, when building Python for macOS 10.4 and older, which wasn't the case
-for python.org macOS installer, :func:`socket.getaddrinfo` no longer uses an
-internal lock to prevent race conditions when calling ``getaddrinfo()`` which
-is thread-safe since macOS 10.5. Python 3.9 requires macOS 10.6 or newer. The
-internal lock caused random hang on fork when another thread was calling
-:func:`socket.getaddrinfo`. The lock was also used on FreeBSD older than 5.3,
-OpenBSD older than 201311 and NetBSD older than 4.
diff --git a/Misc/NEWS.d/next/Library/2020-05-18-17-29-30.bpo-40626.NeZufF.rst b/Misc/NEWS.d/next/Library/2020-05-18-17-29-30.bpo-40626.NeZufF.rst
deleted file mode 100644
index fe652cd7ee..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-18-17-29-30.bpo-40626.NeZufF.rst
+++ /dev/null
@@ -1 +0,0 @@
-Add h5 file extension as MIME Type application/x-hdf5, as per HDF Group recommendation for HDF5 formatted data files. Patch contributed by Mark Schwab.
diff --git a/Misc/NEWS.d/next/Library/2020-05-18-22-41-02.bpo-40614.8j3kmq.rst b/Misc/NEWS.d/next/Library/2020-05-18-22-41-02.bpo-40614.8j3kmq.rst
deleted file mode 100644
index 238b98c14a..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-18-22-41-02.bpo-40614.8j3kmq.rst
+++ /dev/null
@@ -1 +0,0 @@
-:func:`ast.parse` will not parse self documenting expressions in f-strings when passed ``feature_version`` is less than ``(3, 8)``.
diff --git a/Misc/NEWS.d/next/Library/2020-05-20-12-53-20.bpo-9216.ps7Yf1.rst b/Misc/NEWS.d/next/Library/2020-05-20-12-53-20.bpo-9216.ps7Yf1.rst
deleted file mode 100644
index 37542e8caf..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-20-12-53-20.bpo-9216.ps7Yf1.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-func:`hashlib.new` passed ``usedforsecurity`` to OpenSSL EVP constructor
-``_hashlib.new()``. test_hashlib and test_smtplib handle strict security
-policy better.
diff --git a/Misc/NEWS.d/next/Library/2020-05-20-13-03-28.bpo-40695.lr4aIS.rst b/Misc/NEWS.d/next/Library/2020-05-20-13-03-28.bpo-40695.lr4aIS.rst
deleted file mode 100644
index 643779bab4..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-20-13-03-28.bpo-40695.lr4aIS.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-:mod:`hashlib` no longer falls back to builtin hash implementations when
-OpenSSL provides a hash digest and the algorithm is blocked by security
-policy.
diff --git a/Misc/NEWS.d/next/Library/2020-05-20-14-38-04.bpo-40698.zwl5Hc.rst b/Misc/NEWS.d/next/Library/2020-05-20-14-38-04.bpo-40698.zwl5Hc.rst
deleted file mode 100644
index e57624819d..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-20-14-38-04.bpo-40698.zwl5Hc.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:mod:`distutils` upload creates SHA2-256 and Blake2b-256 digests. MD5
-digests is skipped if platform blocks MD5.
diff --git a/Misc/NEWS.d/next/Library/2020-05-22-12-45-58.bpo-40726.7oBdMw.rst b/Misc/NEWS.d/next/Library/2020-05-22-12-45-58.bpo-40726.7oBdMw.rst
deleted file mode 100644
index 7409eb3d80..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-22-12-45-58.bpo-40726.7oBdMw.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Handle cases where the ``end_lineno`` is ``None`` on
-:func:`ast.increment_lineno`.
diff --git a/Misc/NEWS.d/next/Library/2020-05-23-00-22-11.bpo-40737.iph-CM.rst b/Misc/NEWS.d/next/Library/2020-05-23-00-22-11.bpo-40737.iph-CM.rst
deleted file mode 100644
index f068d3a091..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-23-00-22-11.bpo-40737.iph-CM.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix possible reference leak for :mod:`sqlite3` initialization.
diff --git a/Misc/NEWS.d/next/Library/2020-05-23-04-18-00.bpo-37129.YoYoYo.rst b/Misc/NEWS.d/next/Library/2020-05-23-04-18-00.bpo-37129.YoYoYo.rst
deleted file mode 100644
index e025e96f4f..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-23-04-18-00.bpo-37129.YoYoYo.rst
+++ /dev/null
@@ -1 +0,0 @@
-Add a new :data:`os.RWF_APPEND` flag for :func:`os.pwritev`.
diff --git a/Misc/NEWS.d/next/Library/2020-05-24-11-06-37.bpo-40756.7ZH83z.rst b/Misc/NEWS.d/next/Library/2020-05-24-11-06-37.bpo-40756.7ZH83z.rst
deleted file mode 100644
index a970f5be15..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-24-11-06-37.bpo-40756.7ZH83z.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The second argument (extra) of ``LoggerAdapter.__init__`` now defaults to
-None.
diff --git a/Misc/NEWS.d/next/Library/2020-05-24-23-52-35.bpo-40759.DdZdaw.rst b/Misc/NEWS.d/next/Library/2020-05-24-23-52-35.bpo-40759.DdZdaw.rst
deleted file mode 100644
index e77da3ac3d..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-24-23-52-35.bpo-40759.DdZdaw.rst
+++ /dev/null
@@ -1 +0,0 @@
-Deprecate the :mod:`symbol` module.
diff --git a/Misc/NEWS.d/next/Library/2020-05-25-11-52-23.bpo-30064.6CICsH.rst b/Misc/NEWS.d/next/Library/2020-05-25-11-52-23.bpo-30064.6CICsH.rst
deleted file mode 100644
index 904991dca1..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-25-11-52-23.bpo-30064.6CICsH.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix asyncio ``loop.sock_*`` race condition issue
diff --git a/Misc/NEWS.d/next/Library/2020-05-25-22-18-38.bpo-30008.CKC3td.rst b/Misc/NEWS.d/next/Library/2020-05-25-22-18-38.bpo-30008.CKC3td.rst
deleted file mode 100644
index c4cfa56ce0..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-25-22-18-38.bpo-30008.CKC3td.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix :mod:`ssl` code to be compatible with OpenSSL 1.1.x builds that use
-``no-deprecated`` and ``--api=1.1.0``.
diff --git a/Misc/NEWS.d/next/Library/2020-05-27-00-09-52.bpo-16995.4niOT7.rst b/Misc/NEWS.d/next/Library/2020-05-27-00-09-52.bpo-16995.4niOT7.rst
deleted file mode 100644
index 88b95998d0..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-27-00-09-52.bpo-16995.4niOT7.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` to support the
-Base32 Encoding with Extended Hex Alphabet.
diff --git a/Misc/NEWS.d/next/Library/2020-05-27-17-00-18.bpo-40795.eZSnHA.rst b/Misc/NEWS.d/next/Library/2020-05-27-17-00-18.bpo-40795.eZSnHA.rst
deleted file mode 100644
index dd02fb05ca..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-27-17-00-18.bpo-40795.eZSnHA.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-:mod:`ctypes` module: If ctypes fails to convert the result of a callback or
-if a ctypes callback function raises an exception, sys.unraisablehook is now
-called with an exception set. Previously, the error was logged into stderr
-by :c:func:`PyErr_Print`.
diff --git a/Misc/NEWS.d/next/Library/2020-05-27-18-04-52.bpo-40791.IzpNor.rst b/Misc/NEWS.d/next/Library/2020-05-27-18-04-52.bpo-40791.IzpNor.rst
deleted file mode 100644
index b88f308ec3..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-27-18-04-52.bpo-40791.IzpNor.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:func:`hashlib.compare_digest` uses OpenSSL's ``CRYPTO_memcmp()`` function
-when OpenSSL is available.
diff --git a/Misc/NEWS.d/next/Library/2020-05-27-21-27-01.bpo-40767.L5MnVV.rst b/Misc/NEWS.d/next/Library/2020-05-27-21-27-01.bpo-40767.L5MnVV.rst
deleted file mode 100644
index 4bebb311b4..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-27-21-27-01.bpo-40767.L5MnVV.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-:mod:`webbrowser` now properly finds the default browser in pure Wayland
-systems by checking the WAYLAND_DISPLAY environment variable. Patch
-contributed by Jérémy Attali.
diff --git a/Misc/NEWS.d/next/Library/2020-05-27-22-19-42.bpo-40792.87Yx01.rst b/Misc/NEWS.d/next/Library/2020-05-27-22-19-42.bpo-40792.87Yx01.rst
deleted file mode 100644
index 032a96c6a5..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-27-22-19-42.bpo-40792.87Yx01.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The result of :func:`operator.index` now always has exact type :class:`int`.
-Previously, the result could have been an instance of a subclass of ``int``.
diff --git a/Misc/NEWS.d/next/Library/2020-05-28-16-51-00.bpo-38488.hFQNgA.rst b/Misc/NEWS.d/next/Library/2020-05-28-16-51-00.bpo-38488.hFQNgA.rst
deleted file mode 100644
index c44da9fecb..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-28-16-51-00.bpo-38488.hFQNgA.rst
+++ /dev/null
@@ -1 +0,0 @@
-Update ensurepip to install pip 20.1.1 and setuptools 47.1.0.
diff --git a/Misc/NEWS.d/next/Library/2020-05-28-17-32-29.bpo-40777.1kJU6N.rst b/Misc/NEWS.d/next/Library/2020-05-28-17-32-29.bpo-40777.1kJU6N.rst
deleted file mode 100644
index 761bc83562..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-28-17-32-29.bpo-40777.1kJU6N.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time to avoid
-errors on some compilers.
diff --git a/Misc/NEWS.d/next/Library/2020-05-30-08-10-23.bpo-40744.jKURVV.rst b/Misc/NEWS.d/next/Library/2020-05-30-08-10-23.bpo-40744.jKURVV.rst
deleted file mode 100644
index 2d1d1f9a20..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-30-08-10-23.bpo-40744.jKURVV.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-The :mod:`sqlite3` module uses SQLite API functions that require SQLite
-v3.7.3 or higher. This patch removes support for older SQLite versions, and
-explicitly requires SQLite 3.7.3 both at build, compile and runtime. Patch by
-Sergey Fedoseev and Erlend E. Aasland.
diff --git a/Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst b/Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst
deleted file mode 100644
index 482ae624da..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixed email.contentmanager to allow set_content() to set a null string.
diff --git a/Misc/NEWS.d/next/Library/2020-05-30-14-19-47.bpo-26407.MjWLO1.rst b/Misc/NEWS.d/next/Library/2020-05-30-14-19-47.bpo-26407.MjWLO1.rst
deleted file mode 100644
index d0e45cf1b1..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-30-14-19-47.bpo-26407.MjWLO1.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Unexpected errors in calling the ``__iter__`` method are no longer masked
-by ``TypeError`` in :func:`csv.reader`, :func:`csv.writer.writerow` and
-:meth:`csv.writer.writerows`.
diff --git a/Misc/NEWS.d/next/Library/2020-05-30-18-48-58.bpo-40755.IyOe2J.rst b/Misc/NEWS.d/next/Library/2020-05-30-18-48-58.bpo-40755.IyOe2J.rst
deleted file mode 100644
index be5653ea58..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-30-18-48-58.bpo-40755.IyOe2J.rst
+++ /dev/null
@@ -1 +0,0 @@
-Add rich comparisons to collections.Counter().
diff --git a/Misc/NEWS.d/next/Library/2020-05-31-15-52-18.bpo-40834.MO9_hb.rst b/Misc/NEWS.d/next/Library/2020-05-31-15-52-18.bpo-40834.MO9_hb.rst
deleted file mode 100644
index 272783773f..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-31-15-52-18.bpo-40834.MO9_hb.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix truncate when sending str object with_xxsubinterpreters.channel_send. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-05-31-23-32-36.bpo-17005.JlRUGB.rst b/Misc/NEWS.d/next/Library/2020-05-31-23-32-36.bpo-17005.JlRUGB.rst
deleted file mode 100644
index 0fd01fb623..0000000000
--- a/Misc/NEWS.d/next/Library/2020-05-31-23-32-36.bpo-17005.JlRUGB.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-The topological sort functionality that was introduced initially in the
-:mod:`functools` module has been moved to a new :mod:`graphlib` module to
-better accommodate the new tools and keep the original scope of the
-:mod:`functools` module. Patch by Pablo Galindo
diff --git a/Misc/NEWS.d/next/Library/2020-06-01-02-16-29.bpo-39314.0T9hlA.rst b/Misc/NEWS.d/next/Library/2020-06-01-02-16-29.bpo-39314.0T9hlA.rst
deleted file mode 100644
index e805332efb..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-01-02-16-29.bpo-39314.0T9hlA.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-:class:`rlcompleter.Completer` and the standard Python shell now close the
-parenthesis for functions that take no arguments. Patch contributed by Rémi
-Lapeyre.
diff --git a/Misc/NEWS.d/next/Library/2020-06-02-02-16-02.bpo-39791.StCJlA.rst b/Misc/NEWS.d/next/Library/2020-06-02-02-16-02.bpo-39791.StCJlA.rst
deleted file mode 100644
index 61753a57ca..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-02-02-16-02.bpo-39791.StCJlA.rst
+++ /dev/null
@@ -1 +0,0 @@
-Built-in loaders (SourceFileLoader and ZipImporter) now supply ``TraversableResources`` implementations for ``ResourceReader``, and the fallback function has been removed.
diff --git a/Misc/NEWS.d/next/Library/2020-06-02-23-49-07.bpo-32604.ZN4V4l.rst b/Misc/NEWS.d/next/Library/2020-06-02-23-49-07.bpo-32604.ZN4V4l.rst
deleted file mode 100644
index af284b06ea..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-02-23-49-07.bpo-32604.ZN4V4l.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix reference leak in the :mod:`select` module when the module is
-imported in a subinterpreter.
diff --git a/Misc/NEWS.d/next/Library/2020-06-04-16-25-15.bpo-40807.yYyLWx.rst b/Misc/NEWS.d/next/Library/2020-06-04-16-25-15.bpo-40807.yYyLWx.rst
deleted file mode 100644
index c64a86295d..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-04-16-25-15.bpo-40807.yYyLWx.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Stop codeop._maybe_compile, used by code.InteractiveInterpreter (and IDLE).
-from emitting each warning three times.
diff --git a/Misc/NEWS.d/next/Library/2020-06-05-19-29-10.bpo-39791._CcO3d.rst b/Misc/NEWS.d/next/Library/2020-06-05-19-29-10.bpo-39791._CcO3d.rst
deleted file mode 100644
index 73e0cbb013..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-05-19-29-10.bpo-39791._CcO3d.rst
+++ /dev/null
@@ -1 +0,0 @@
-Refresh importlib.metadata from importlib_metadata 1.6.1. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-06-05-20-00-18.bpo-40876.zDhiZj.rst b/Misc/NEWS.d/next/Library/2020-06-05-20-00-18.bpo-40876.zDhiZj.rst
deleted file mode 100644
index 75f62addba..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-05-20-00-18.bpo-40876.zDhiZj.rst
+++ /dev/null
@@ -1 +0,0 @@
-Clarify error message in the :mod:`csv` module.
diff --git a/Misc/NEWS.d/next/Library/2020-06-06-02-42-26.bpo-40884.n7fOwS.rst b/Misc/NEWS.d/next/Library/2020-06-06-02-42-26.bpo-40884.n7fOwS.rst
deleted file mode 100644
index 64990e8023..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-06-02-42-26.bpo-40884.n7fOwS.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Added a `defaults` parameter to :class:`logging.Formatter`, to allow
-specifying default values for custom fields. Patch by Asaf Alon and Bar
-Harel.
diff --git a/Misc/NEWS.d/next/Library/2020-06-06-14-09-55.bpo-33689.EFUDH7.rst b/Misc/NEWS.d/next/Library/2020-06-06-14-09-55.bpo-33689.EFUDH7.rst
deleted file mode 100644
index bc0756d02d..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-06-14-09-55.bpo-33689.EFUDH7.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-Ignore empty or whitespace-only lines in .pth files. This matches the
-documentated behavior. Before, empty lines caused the site-packages
-dir to appear multiple times in sys.path.
-By Ido Michael, contributors Malcolm Smith and Tal Einat.
diff --git a/Misc/NEWS.d/next/Library/2020-06-08-18-59-16.bpo-23427.ilg1Cz.rst b/Misc/NEWS.d/next/Library/2020-06-08-18-59-16.bpo-23427.ilg1Cz.rst
deleted file mode 100644
index 37382975bb..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-08-18-59-16.bpo-23427.ilg1Cz.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add :data:`sys.orig_argv` attribute: the list of the original command line
-arguments passed to the Python executable.
diff --git a/Misc/NEWS.d/next/Library/2020-06-11-11-07-10.bpo-40939.-D5Asl.rst b/Misc/NEWS.d/next/Library/2020-06-11-11-07-10.bpo-40939.-D5Asl.rst
deleted file mode 100644
index 0e831129dd..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-11-11-07-10.bpo-40939.-D5Asl.rst
+++ /dev/null
@@ -1 +0,0 @@
-Use the new PEG parser when generating the stdlib :mod:`keyword` module. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-06-12-10-44-15.bpo-40855.jSot83.rst b/Misc/NEWS.d/next/Library/2020-06-12-10-44-15.bpo-40855.jSot83.rst
deleted file mode 100644
index 201d510327..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-12-10-44-15.bpo-40855.jSot83.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The standard deviation and variance functions in the statistics module were
-ignoring their mu and xbar arguments.
diff --git a/Misc/NEWS.d/next/Library/2020-06-12-11-55-30.bpo-40955.huixCg.rst b/Misc/NEWS.d/next/Library/2020-06-12-11-55-30.bpo-40955.huixCg.rst
deleted file mode 100644
index 9a9803044e..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-12-11-55-30.bpo-40955.huixCg.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix a minor memory leak in :mod:`subprocess` module when extra_groups was specified.
diff --git a/Misc/NEWS.d/next/Library/2020-06-13-12-04-50.bpo-40924.SM_luS.rst b/Misc/NEWS.d/next/Library/2020-06-13-12-04-50.bpo-40924.SM_luS.rst
deleted file mode 100644
index 4e4c6e88ac..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-13-12-04-50.bpo-40924.SM_luS.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Ensure ``importlib.resources.path`` returns an extant path for the
-SourceFileLoader's resource reader. Avoids the regression identified in
-master while a long-term solution is devised.
diff --git a/Misc/NEWS.d/next/Library/2020-06-15-00-13-57.bpo-40967._dx3OO.rst b/Misc/NEWS.d/next/Library/2020-06-15-00-13-57.bpo-40967._dx3OO.rst
deleted file mode 100644
index 4694d991ba..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-15-00-13-57.bpo-40967._dx3OO.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Removed :meth:`asyncio.Task.current_task` and
-:meth:`asyncio.Task.all_tasks`. Patch contributed by Rémi Lapeyre.
diff --git a/Misc/NEWS.d/next/Library/2020-06-15-12-22-53.bpo-40448.1dk8Bu.rst b/Misc/NEWS.d/next/Library/2020-06-15-12-22-53.bpo-40448.1dk8Bu.rst
deleted file mode 100644
index a755c5faa6..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-15-12-22-53.bpo-40448.1dk8Bu.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:mod:`ensurepip` now disables the use of `pip` cache when installing the
-bundled versions of `pip` and `setuptools`. Patch by Krzysztof Konopko.
diff --git a/Misc/NEWS.d/next/Library/2020-06-17-17-26-24.bpo-41002.NPBItE.rst b/Misc/NEWS.d/next/Library/2020-06-17-17-26-24.bpo-41002.NPBItE.rst
deleted file mode 100644
index c3eebb7b9a..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-17-17-26-24.bpo-41002.NPBItE.rst
+++ /dev/null
@@ -1 +0,0 @@
-Improve performance of HTTPResponse.read with a given amount. Patch by Bruce Merry.
diff --git a/Misc/NEWS.d/next/Library/2020-06-17-23-49-45.bpo-35018.NP5_Qk.rst b/Misc/NEWS.d/next/Library/2020-06-17-23-49-45.bpo-35018.NP5_Qk.rst
deleted file mode 100644
index f764323ae6..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-17-23-49-45.bpo-35018.NP5_Qk.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add the :class:`xml.sax.handler.LexicalHandler` class that is present in
-other SAX XML implementations.
diff --git a/Misc/NEWS.d/next/Library/2020-06-18-10-34-59.bpo-41025.elf_nz.rst b/Misc/NEWS.d/next/Library/2020-06-18-10-34-59.bpo-41025.elf_nz.rst
deleted file mode 100644
index 21e184d0a4..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-18-10-34-59.bpo-41025.elf_nz.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixed an issue preventing the C implementation of :class:`zoneinfo.ZoneInfo`
-from being subclassed.
diff --git a/Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst b/Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst
deleted file mode 100644
index 9c6020eb8d..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixed the use of :func:`~glob.glob` in the stdlib: literal part of the path
-is now always correctly escaped.
diff --git a/Misc/NEWS.d/next/Library/2020-06-20-10-16-57.bpo-41048.hEXB-B.rst b/Misc/NEWS.d/next/Library/2020-06-20-10-16-57.bpo-41048.hEXB-B.rst
deleted file mode 100644
index 2595900137..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-20-10-16-57.bpo-41048.hEXB-B.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:func:`mimetypes.read_mime_types` function reads the rule file using UTF-8 encoding, not the locale encoding.
-Patch by Srinivas Reddy Thatiparthy. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-06-20-18-33-03.bpo-41056.gTH4Bq.rst b/Misc/NEWS.d/next/Library/2020-06-20-18-33-03.bpo-41056.gTH4Bq.rst
deleted file mode 100644
index 0439d82a50..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-20-18-33-03.bpo-41056.gTH4Bq.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixed an instance where a MemoryError within the zoneinfo module might not be reported or not reported at its source. (found by Coverity) \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-06-20-18-35-43.bpo-41056.Garcle.rst b/Misc/NEWS.d/next/Library/2020-06-20-18-35-43.bpo-41056.Garcle.rst
deleted file mode 100644
index 1776f0d1cf..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-20-18-35-43.bpo-41056.Garcle.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix a NULL pointer dereference within the ssl module during a MemoryError in the keylog callback. (discovered by Coverity) \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-06-20-18-37-29.bpo-41056.d9v_uL.rst b/Misc/NEWS.d/next/Library/2020-06-20-18-37-29.bpo-41056.d9v_uL.rst
deleted file mode 100644
index ddcc1102d5..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-20-18-37-29.bpo-41056.d9v_uL.rst
+++ /dev/null
@@ -1 +0,0 @@
-Invalid file descriptor values are now prevented from being passed to os.fpathconf. (discovered by Coverity) \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-06-20-21-03-55.bpo-41058.gztdZy.rst b/Misc/NEWS.d/next/Library/2020-06-20-21-03-55.bpo-41058.gztdZy.rst
deleted file mode 100644
index 6ac90098aa..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-20-21-03-55.bpo-41058.gztdZy.rst
+++ /dev/null
@@ -1 +0,0 @@
-:func:`pdb.find_function` now correctly determines the source file encoding.
diff --git a/Misc/NEWS.d/next/Library/2020-06-22-10-25-39.bpo-41068._bX2BW.rst b/Misc/NEWS.d/next/Library/2020-06-22-10-25-39.bpo-41068._bX2BW.rst
deleted file mode 100644
index 20580c7886..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-22-10-25-39.bpo-41068._bX2BW.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixed reading files with non-ASCII names from ZIP archive directly after
-writing them.
diff --git a/Misc/NEWS.d/next/Library/2020-06-22-20-08-40.bpo-31938.EVuko9.rst b/Misc/NEWS.d/next/Library/2020-06-22-20-08-40.bpo-31938.EVuko9.rst
deleted file mode 100644
index 0488e94d42..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-22-20-08-40.bpo-31938.EVuko9.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix default-value signatures of several functions in the :mod:`select` module - by Anthony Sottile.
diff --git a/Misc/NEWS.d/next/Library/2020-06-23-06-09-59.bpo-40521.HUfxP7.rst b/Misc/NEWS.d/next/Library/2020-06-23-06-09-59.bpo-40521.HUfxP7.rst
deleted file mode 100644
index 7689a1470b..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-23-06-09-59.bpo-40521.HUfxP7.rst
+++ /dev/null
@@ -1 +0,0 @@
-Remove freelist from collections.deque().
diff --git a/Misc/NEWS.d/next/Library/2020-06-25-10-11-47.bpo-31082.HsgDkx.rst b/Misc/NEWS.d/next/Library/2020-06-25-10-11-47.bpo-31082.HsgDkx.rst
deleted file mode 100644
index 9746d33a49..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-25-10-11-47.bpo-31082.HsgDkx.rst
+++ /dev/null
@@ -1 +0,0 @@
-Use the term "iterable" in the docstring for :func:`functools.reduce`.
diff --git a/Misc/NEWS.d/next/Library/2020-06-27-13-51-36.bpo-41138.bIpf7g.rst b/Misc/NEWS.d/next/Library/2020-06-27-13-51-36.bpo-41138.bIpf7g.rst
deleted file mode 100644
index 839d430e89..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-27-13-51-36.bpo-41138.bIpf7g.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixed the :mod:`trace` module CLI for Python source files with non-UTF-8
-encoding.
diff --git a/Misc/NEWS.d/next/Library/2020-06-28-21-16-51.bpo-40874.YImvzA.rst b/Misc/NEWS.d/next/Library/2020-06-28-21-16-51.bpo-40874.YImvzA.rst
deleted file mode 100644
index a43eab8f4d..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-28-21-16-51.bpo-40874.YImvzA.rst
+++ /dev/null
@@ -1 +0,0 @@
-The decimal module now requires libmpdec-2.5.0.
diff --git a/Misc/NEWS.d/next/Library/2020-06-30-20-50-51.bpo-41161.QTdJjz.rst b/Misc/NEWS.d/next/Library/2020-06-30-20-50-51.bpo-41161.QTdJjz.rst
deleted file mode 100644
index 0d8fb521ba..0000000000
--- a/Misc/NEWS.d/next/Library/2020-06-30-20-50-51.bpo-41161.QTdJjz.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The decimal module now requires libmpdec-2.5.0. Users of
---with-system-libmpdec should update their system library.
diff --git a/Misc/NEWS.d/next/Library/2020-07-01-17-33-50.bpo-41182.FPFI0N.rst b/Misc/NEWS.d/next/Library/2020-07-01-17-33-50.bpo-41182.FPFI0N.rst
deleted file mode 100644
index ae31db512a..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-01-17-33-50.bpo-41182.FPFI0N.rst
+++ /dev/null
@@ -1 +0,0 @@
-selector: use DefaultSelector based upon implementation
diff --git a/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst b/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst
deleted file mode 100644
index 8807d9c21f..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-The ``write_history()`` atexit function of the readline completer now
-ignores any :exc:`OSError` to ignore error if the filesystem is read-only,
-instead of only ignoring :exc:`FileNotFoundError` and
-:exc:`PermissionError`.
diff --git a/Misc/NEWS.d/next/Library/2020-07-02-15-03-04.bpo-41195.cEnpO3.rst b/Misc/NEWS.d/next/Library/2020-07-02-15-03-04.bpo-41195.cEnpO3.rst
deleted file mode 100644
index f96d5fadbd..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-02-15-03-04.bpo-41195.cEnpO3.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Add read-only ssl.SSLContext.security_level attribute to retrieve the
-context's security level.
diff --git a/Misc/NEWS.d/next/Library/2020-07-03-13-15-08.bpo-41194.djrKjs.rst b/Misc/NEWS.d/next/Library/2020-07-03-13-15-08.bpo-41194.djrKjs.rst
deleted file mode 100644
index d63a0e5222..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-03-13-15-08.bpo-41194.djrKjs.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix a crash in the ``_ast`` module: it can no longer be loaded more than once.
-It now uses a global state rather than a module state.
diff --git a/Misc/NEWS.d/next/Library/2020-07-04-21-56-46.bpo-39168.DQWsXj.rst b/Misc/NEWS.d/next/Library/2020-07-04-21-56-46.bpo-39168.DQWsXj.rst
deleted file mode 100644
index 667885eccd..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-04-21-56-46.bpo-39168.DQWsXj.rst
+++ /dev/null
@@ -1 +0,0 @@
-Remove the ``__new__`` method of :class:`typing.Generic`.
diff --git a/Misc/NEWS.d/next/Library/2020-07-05-19-16-02.bpo-29727.Q6Z2rg.rst b/Misc/NEWS.d/next/Library/2020-07-05-19-16-02.bpo-29727.Q6Z2rg.rst
deleted file mode 100644
index 85cfa4f893..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-05-19-16-02.bpo-29727.Q6Z2rg.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Register :class:`array.array` as a
-:class:`~collections.abc.MutableSequence`. Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Library/2020-07-06-16-58-53.bpo-41207.Emw7Nk.rst b/Misc/NEWS.d/next/Library/2020-07-06-16-58-53.bpo-41207.Emw7Nk.rst
deleted file mode 100644
index db99c63f94..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-06-16-58-53.bpo-41207.Emw7Nk.rst
+++ /dev/null
@@ -1 +0,0 @@
-In distutils.spawn, restore expectation that DistutilsExecError is raised when the command is not found.
diff --git a/Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst b/Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst
deleted file mode 100644
index c55275bb1c..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix the error handling in :meth:`ssl.SSLContext.load_dh_params`.
diff --git a/Misc/NEWS.d/next/Library/2020-07-11-00-15-01.bpo-41273.SVrsJh.rst b/Misc/NEWS.d/next/Library/2020-07-11-00-15-01.bpo-41273.SVrsJh.rst
deleted file mode 100644
index c08204b990..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-11-00-15-01.bpo-41273.SVrsJh.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Speed up any transport using ``_ProactorReadPipeTransport`` by calling
-``recv_into`` instead of ``recv``, thus not creating a new buffer for each
-``recv`` call in the transport's read loop.
diff --git a/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst b/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst
deleted file mode 100644
index ad26676f8b..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst
+++ /dev/null
@@ -1 +0,0 @@
-Avoid infinite loop when reading specially crafted TAR files using the tarfile module (CVE-2019-20907).
diff --git a/Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst b/Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst
deleted file mode 100644
index 3c3adbabf1..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Unpickling invalid NEWOBJ_EX opcode with the C implementation raises now
-UnpicklingError instead of crashing.
diff --git a/Misc/NEWS.d/next/Library/2020-07-18-18-07-40.bpo-41333.upkHIm.rst b/Misc/NEWS.d/next/Library/2020-07-18-18-07-40.bpo-41333.upkHIm.rst
deleted file mode 100644
index 73e8b11997..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-18-18-07-40.bpo-41333.upkHIm.rst
+++ /dev/null
@@ -1 +0,0 @@
-:meth:`collections.OrderedDict.pop` is now 2 times faster.
diff --git a/Misc/NEWS.d/next/Library/2020-07-20-13-27-48.bpo-41344.iKipNd.rst b/Misc/NEWS.d/next/Library/2020-07-20-13-27-48.bpo-41344.iKipNd.rst
deleted file mode 100644
index 475bc9bddb..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-20-13-27-48.bpo-41344.iKipNd.rst
+++ /dev/null
@@ -1 +0,0 @@
-Prevent creating :class:`shared_memory.SharedMemory` objects with :code:`size=0`.
diff --git a/Misc/NEWS.d/next/Library/2020-07-20-19-13-17.bpo-41341.wqrj8C.rst b/Misc/NEWS.d/next/Library/2020-07-20-19-13-17.bpo-41341.wqrj8C.rst
deleted file mode 100644
index c78b24d2fa..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-20-19-13-17.bpo-41341.wqrj8C.rst
+++ /dev/null
@@ -1 +0,0 @@
-Recursive evaluation of `typing.ForwardRef` in `get_type_hints`. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-07-21-16-20-55.bpo-35328.jXovHb.rst b/Misc/NEWS.d/next/Library/2020-07-21-16-20-55.bpo-35328.jXovHb.rst
deleted file mode 100644
index f4d1c6511d..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-21-16-20-55.bpo-35328.jXovHb.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Set the environment variable ``VIRTUAL_ENV_PROMPT`` at :mod:`venv`
-activation.
diff --git a/Misc/NEWS.d/next/Library/2020-07-21-21-45-55.bpo-41364.5O-k7A.rst b/Misc/NEWS.d/next/Library/2020-07-21-21-45-55.bpo-41364.5O-k7A.rst
deleted file mode 100644
index f136e892ae..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-21-21-45-55.bpo-41364.5O-k7A.rst
+++ /dev/null
@@ -1 +0,0 @@
-Reduce import overhead of :mod:`uuid`.
diff --git a/Misc/NEWS.d/next/Library/2020-07-23-01-18-34.bpo-41317.O17Z6x.rst b/Misc/NEWS.d/next/Library/2020-07-23-01-18-34.bpo-41317.O17Z6x.rst
deleted file mode 100644
index 1af985e90e..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-23-01-18-34.bpo-41317.O17Z6x.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Use add_done_callback() in asyncio.loop.sock_accept() to unsubscribe reader
-early on cancellation.
diff --git a/Misc/NEWS.d/next/Library/2020-07-26-21-18-43.bpo-41384.MlzIgV.rst b/Misc/NEWS.d/next/Library/2020-07-26-21-18-43.bpo-41384.MlzIgV.rst
deleted file mode 100644
index d797374a09..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-26-21-18-43.bpo-41384.MlzIgV.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Raise TclError instead of TypeError when an unknown option is passed to
-tkinter.OptionMenu.
diff --git a/Misc/NEWS.d/next/Library/2020-07-28-12-08-58.bpo-41316.bSCbK4.rst b/Misc/NEWS.d/next/Library/2020-07-28-12-08-58.bpo-41316.bSCbK4.rst
deleted file mode 100644
index 139a170866..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-28-12-08-58.bpo-41316.bSCbK4.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix the :mod:`tarfile` module to write only basename of TAR file to GZIP compression header. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-07-30-14-56-58.bpo-41440.rju34k.rst b/Misc/NEWS.d/next/Library/2020-07-30-14-56-58.bpo-41440.rju34k.rst
deleted file mode 100644
index 3ee1f656d1..0000000000
--- a/Misc/NEWS.d/next/Library/2020-07-30-14-56-58.bpo-41440.rju34k.rst
+++ /dev/null
@@ -1 +0,0 @@
-Add :func:`os.cpu_count()` support for VxWorks RTOS.
diff --git a/Misc/NEWS.d/next/Library/2020-08-01-00-51-15.bpo-41421.dHKRVB.rst b/Misc/NEWS.d/next/Library/2020-08-01-00-51-15.bpo-41421.dHKRVB.rst
deleted file mode 100644
index cf291c60d8..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-01-00-51-15.bpo-41421.dHKRVB.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Make an algebraic simplification to random.paretovariate(). It now is
-slightly less subject to round-off error and is slightly faster. Inputs that
-used to cause ZeroDivisionError now cause an OverflowError instead.
diff --git a/Misc/NEWS.d/next/Library/2020-08-03-01-59-48.bpo-41425.KJo6zF.rst b/Misc/NEWS.d/next/Library/2020-08-03-01-59-48.bpo-41425.KJo6zF.rst
deleted file mode 100644
index 617df72fae..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-03-01-59-48.bpo-41425.KJo6zF.rst
+++ /dev/null
@@ -1 +0,0 @@
-Make tkinter doc example runnable.
diff --git a/Misc/NEWS.d/next/Library/2020-08-04-00-20-30.bpo-41467.Z8DgTL.rst b/Misc/NEWS.d/next/Library/2020-08-04-00-20-30.bpo-41467.Z8DgTL.rst
deleted file mode 100644
index f12693e117..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-04-00-20-30.bpo-41467.Z8DgTL.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-On Windows, fix asyncio ``recv_into()`` return value when the socket/pipe is
-closed (:exc:`BrokenPipeError`): return ``0`` rather than an empty byte
-string (``b''``).
diff --git a/Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst b/Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst
deleted file mode 100644
index 2c863ed7ff..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix potential UnicodeDecodeError in dis module. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-08-07-15-18-16.bpo-41503.IYftcu.rst b/Misc/NEWS.d/next/Library/2020-08-07-15-18-16.bpo-41503.IYftcu.rst
deleted file mode 100644
index c34996d881..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-07-15-18-16.bpo-41503.IYftcu.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixed a race between setTarget and flush in logging.handlers.MemoryHandler. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-08-09-18-16-05.bpo-41513.e6K6EK.rst b/Misc/NEWS.d/next/Library/2020-08-09-18-16-05.bpo-41513.e6K6EK.rst
deleted file mode 100644
index cfb9f98c37..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-09-18-16-05.bpo-41513.e6K6EK.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Minor algorithmic improvement to math.hypot() and math.dist() giving small
-gains in speed and accuracy.
diff --git a/Misc/NEWS.d/next/Library/2020-08-12-07-43-31.bpo-41528.bu83oD.rst b/Misc/NEWS.d/next/Library/2020-08-12-07-43-31.bpo-41528.bu83oD.rst
deleted file mode 100644
index a4ba57c243..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-12-07-43-31.bpo-41528.bu83oD.rst
+++ /dev/null
@@ -1 +0,0 @@
-turtle uses math module functions to convert degrees to radians and vice versa and to calculate vector norm \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst b/Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst
deleted file mode 100644
index 0e140d91bb..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix :mod:`codeop` regression that prevented turning compile warnings into errors.
diff --git a/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst b/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst
deleted file mode 100644
index d4c7e0e241..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst
+++ /dev/null
@@ -1 +0,0 @@
-Change the method asyncio.AbstractEventLoop.run_in_executor to not be a coroutine. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-08-15-15-21-40.bpo-37658.f9nivB.rst b/Misc/NEWS.d/next/Library/2020-08-15-15-21-40.bpo-37658.f9nivB.rst
deleted file mode 100644
index 694fbbbf34..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-15-15-21-40.bpo-37658.f9nivB.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:meth:`asyncio.wait_for` now properly handles races between cancellation of
-itself and the completion of the wrapped awaitable.
diff --git a/Misc/NEWS.d/next/Library/2020-08-15-15-50-12.bpo-32751.85je5X.rst b/Misc/NEWS.d/next/Library/2020-08-15-15-50-12.bpo-32751.85je5X.rst
deleted file mode 100644
index c172ce5d9e..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-15-15-50-12.bpo-32751.85je5X.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-When cancelling the task due to a timeout, :meth:`asyncio.wait_for` will now
-wait until the cancellation is complete also in the case when *timeout* is
-<= 0, like it does with positive timeouts.
diff --git a/Misc/NEWS.d/next/Library/2020-08-15-18-17-21.bpo-39994.dOgPOh.rst b/Misc/NEWS.d/next/Library/2020-08-15-18-17-21.bpo-39994.dOgPOh.rst
deleted file mode 100644
index 46876c15ea..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-15-18-17-21.bpo-39994.dOgPOh.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixed pprint's handling of dict subclasses that override __repr__.
diff --git a/Misc/NEWS.d/next/Library/2020-08-21-15-51-15.bpo-41609.JmiUKG.rst b/Misc/NEWS.d/next/Library/2020-08-21-15-51-15.bpo-41609.JmiUKG.rst
deleted file mode 100644
index ecaf40eee7..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-21-15-51-15.bpo-41609.JmiUKG.rst
+++ /dev/null
@@ -1 +0,0 @@
-The pdb whatis command correctly reports instance methods as 'Method' rather than 'Function'. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-08-23-14-23-18.bpo-41513.DGqc_I.rst b/Misc/NEWS.d/next/Library/2020-08-23-14-23-18.bpo-41513.DGqc_I.rst
deleted file mode 100644
index b4d0d9b63c..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-23-14-23-18.bpo-41513.DGqc_I.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Improved the accuracy of math.hypot(). Internally, each step is computed
-with extra precision so that the result is now almost always correctly
-rounded.
diff --git a/Misc/NEWS.d/next/Library/2020-08-29-16-07-36.bpo-41662.Mn79zh.rst b/Misc/NEWS.d/next/Library/2020-08-29-16-07-36.bpo-41662.Mn79zh.rst
deleted file mode 100644
index 0571c2d110..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-29-16-07-36.bpo-41662.Mn79zh.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixed crash when mutate list of parameters during iteration in :mod:`sqlite3`.
diff --git a/Misc/NEWS.d/next/Library/2020-08-29-16-45-12.bpo-41638.iZfW5N.rst b/Misc/NEWS.d/next/Library/2020-08-29-16-45-12.bpo-41638.iZfW5N.rst
deleted file mode 100644
index 8ab7b5e990..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-29-16-45-12.bpo-41638.iZfW5N.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-:exc:`~sqlite3.ProgrammingError` message for absent parameter in :mod:`sqlite3`
-contains now the name of the parameter instead of its index when parameters
-are supplied as a dict.
diff --git a/Misc/NEWS.d/next/Library/2020-08-30-10-24-26.bpo-39010._mzXJW.rst b/Misc/NEWS.d/next/Library/2020-08-30-10-24-26.bpo-39010._mzXJW.rst
deleted file mode 100644
index 0d9015b490..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-30-10-24-26.bpo-39010._mzXJW.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Restarting a ``ProactorEventLoop`` on Windows no longer logs spurious
-``ConnectionResetErrors``.
diff --git a/Misc/NEWS.d/next/Library/2020-08-30-21-38-57.bpo-41662.6e9iZn.rst b/Misc/NEWS.d/next/Library/2020-08-30-21-38-57.bpo-41662.6e9iZn.rst
deleted file mode 100644
index aecb0a1ea4..0000000000
--- a/Misc/NEWS.d/next/Library/2020-08-30-21-38-57.bpo-41662.6e9iZn.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-No longer override exceptions raised in ``__len__()`` of a sequence of
-parameters in :mod:`sqlite3` with :exc:`~sqlite3.ProgrammingError`.
diff --git a/Misc/NEWS.d/next/Library/2020-09-01-15-57-51.bpo-41687.m1b1KA.rst b/Misc/NEWS.d/next/Library/2020-09-01-15-57-51.bpo-41687.m1b1KA.rst
deleted file mode 100644
index 284f500735..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-01-15-57-51.bpo-41687.m1b1KA.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix implementation of sendfile to be compatible with Solaris.
diff --git a/Misc/NEWS.d/next/Library/2020-09-03-01-35-32.bpo-41696.zkYGre.rst b/Misc/NEWS.d/next/Library/2020-09-03-01-35-32.bpo-41696.zkYGre.rst
deleted file mode 100644
index 67bbbb857f..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-03-01-35-32.bpo-41696.zkYGre.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix handling of debug mode in :func:`asyncio.run`. This allows setting ``PYTHONASYNCIODEBUG`` or ``-X dev`` to enable asyncio debug mode when using :func:`asyncio.run`. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-09-04-20-45-38.bpo-41720.PW9MzZ.rst b/Misc/NEWS.d/next/Library/2020-09-04-20-45-38.bpo-41720.PW9MzZ.rst
deleted file mode 100644
index 5d2a5094dd..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-04-20-45-38.bpo-41720.PW9MzZ.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixed :meth:`turtle.Vec2D.__rmul__` for arguments which are not int or
-float.
diff --git a/Misc/NEWS.d/next/Library/2020-09-06-20-27-10.bpo-41732.1SKv26.rst b/Misc/NEWS.d/next/Library/2020-09-06-20-27-10.bpo-41732.1SKv26.rst
deleted file mode 100644
index caf237f37f..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-06-20-27-10.bpo-41732.1SKv26.rst
+++ /dev/null
@@ -1 +0,0 @@
-Added an :term:`iterator` to :class:`memoryview`.
diff --git a/Misc/NEWS.d/next/Library/2020-09-08-13-51-16.bpo-1635741.wkPeoT.rst b/Misc/NEWS.d/next/Library/2020-09-08-13-51-16.bpo-1635741.wkPeoT.rst
deleted file mode 100644
index 972d69b94b..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-08-13-51-16.bpo-1635741.wkPeoT.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Port the ``_string`` extension module to the multi-phase initialization API
-(:pep:`489`).
diff --git a/Misc/NEWS.d/next/Library/2020-09-08-13-55-34.bpo-1635741.56MLP-.rst b/Misc/NEWS.d/next/Library/2020-09-08-13-55-34.bpo-1635741.56MLP-.rst
deleted file mode 100644
index 8b5bd5efdc..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-08-13-55-34.bpo-1635741.56MLP-.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Port the ``mashal`` extension module to the multi-phase initialization API
-(:pep:`489`).
diff --git a/Misc/NEWS.d/next/Library/2020-09-11-12-38-55.bpo-39651.JMp9l2.rst b/Misc/NEWS.d/next/Library/2020-09-11-12-38-55.bpo-39651.JMp9l2.rst
deleted file mode 100644
index 78dcff1370..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-11-12-38-55.bpo-39651.JMp9l2.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Fix a race condition in the ``call_soon_threadsafe()`` method of
-``asyncio.ProactorEventLoop``: do nothing if the self-pipe socket has been
-closed.
diff --git a/Misc/NEWS.d/next/Library/2020-09-12-16-18-42.bpo-32218.IpYkEe.rst b/Misc/NEWS.d/next/Library/2020-09-12-16-18-42.bpo-32218.IpYkEe.rst
deleted file mode 100644
index d5832b9767..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-12-16-18-42.bpo-32218.IpYkEe.rst
+++ /dev/null
@@ -1 +0,0 @@
-`enum.Flag` and `enum.IntFlag` members are now iterable
diff --git a/Misc/NEWS.d/next/Library/2020-09-13-02-02-18.bpo-39337.L3NXTt.rst b/Misc/NEWS.d/next/Library/2020-09-13-02-02-18.bpo-39337.L3NXTt.rst
new file mode 100644
index 0000000000..c2b4dbe4d1
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-09-13-02-02-18.bpo-39337.L3NXTt.rst
@@ -0,0 +1 @@
+:func:`encodings.normalize_encoding` now ignores non-ASCII characters.
diff --git a/Misc/NEWS.d/next/Library/2020-09-14-19-27-46.bpo-41789.pI_uZQ.rst b/Misc/NEWS.d/next/Library/2020-09-14-19-27-46.bpo-41789.pI_uZQ.rst
deleted file mode 100644
index 5ce7a3ca67..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-14-19-27-46.bpo-41789.pI_uZQ.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Honor `object` overrides in `Enum` class creation (specifically, `__str__`,
-`__repr__`, `__format__`, and `__reduce_ex__`).
diff --git a/Misc/NEWS.d/next/Library/2020-09-15-07-55-35.bpo-41792.qMpSlU.rst b/Misc/NEWS.d/next/Library/2020-09-15-07-55-35.bpo-41792.qMpSlU.rst
deleted file mode 100644
index fbbc6724ba..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-15-07-55-35.bpo-41792.qMpSlU.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-Add is_typeddict function to typing.py to check if a type is a TypedDict
-class
-
-Previously there was no way to check that without using private API. See the
-`relevant issue in python/typing
-<https://github.com/python/typing/issues/751>`
diff --git a/Misc/NEWS.d/next/Library/2020-09-15-14-56-13.bpo-39587.69xzuh.rst b/Misc/NEWS.d/next/Library/2020-09-15-14-56-13.bpo-39587.69xzuh.rst
deleted file mode 100644
index e2f2b64867..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-15-14-56-13.bpo-39587.69xzuh.rst
+++ /dev/null
@@ -1 +0,0 @@
-use the correct mix-in data type when constructing Enums
diff --git a/Misc/NEWS.d/next/Library/2020-09-15-22-43-30.bpo-41517.sLBH7g.rst b/Misc/NEWS.d/next/Library/2020-09-15-22-43-30.bpo-41517.sLBH7g.rst
deleted file mode 100644
index e765471106..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-15-22-43-30.bpo-41517.sLBH7g.rst
+++ /dev/null
@@ -1 +0,0 @@
-fix bug allowing Enums to be extended via multiple inheritance
diff --git a/Misc/NEWS.d/next/Library/2020-09-19-12-22-08.bpo-41816.ynynXJ.rst b/Misc/NEWS.d/next/Library/2020-09-19-12-22-08.bpo-41816.ynynXJ.rst
deleted file mode 100644
index 605c346f37..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-19-12-22-08.bpo-41816.ynynXJ.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-StrEnum added: it ensures that all members are already strings or string
-candidates
diff --git a/Misc/NEWS.d/next/Library/2020-09-19-23-14-54.bpo-41815.RNpuX3.rst b/Misc/NEWS.d/next/Library/2020-09-19-23-14-54.bpo-41815.RNpuX3.rst
deleted file mode 100644
index 3560db9bc5..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-19-23-14-54.bpo-41815.RNpuX3.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix SQLite3 segfault when backing up closed database. Patch contributed by
-Peter David McCormick.
diff --git a/Misc/NEWS.d/next/Library/2020-09-20-15-14-05.bpo-41810.7l8lyV.rst b/Misc/NEWS.d/next/Library/2020-09-20-15-14-05.bpo-41810.7l8lyV.rst
deleted file mode 100644
index 515aea9e36..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-20-15-14-05.bpo-41810.7l8lyV.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-:data:`types.EllipsisType`, :data:`types.NotImplementedType` and
-:data:`types.NoneType` have been reintroduced, providing a new set
-of types readily interpretable by static type checkers.
diff --git a/Misc/NEWS.d/next/Library/2020-09-22-00-23-30.bpo-41817.bnh-VG.rst b/Misc/NEWS.d/next/Library/2020-09-22-00-23-30.bpo-41817.bnh-VG.rst
deleted file mode 100644
index 6a634bb613..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-22-00-23-30.bpo-41817.bnh-VG.rst
+++ /dev/null
@@ -1 +0,0 @@
-fix `tkinter.EventType` Enum so all members are strings, and none are tuples
diff --git a/Misc/NEWS.d/next/Library/2020-09-22-11-07-50.bpo-41831.k-Eop_.rst b/Misc/NEWS.d/next/Library/2020-09-22-11-07-50.bpo-41831.k-Eop_.rst
new file mode 100644
index 0000000000..84a3f5253a
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-09-22-11-07-50.bpo-41831.k-Eop_.rst
@@ -0,0 +1,3 @@
+``str()`` for the ``type`` attribute of the ``tkinter.Event`` object always
+returns now the numeric code returned by Tk instead of the name of the event
+type.
diff --git a/Misc/NEWS.d/next/Library/2020-09-22-13-51-14.bpo-41833.6HVDjT.rst b/Misc/NEWS.d/next/Library/2020-09-22-13-51-14.bpo-41833.6HVDjT.rst
deleted file mode 100644
index abb3a077d9..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-22-13-51-14.bpo-41833.6HVDjT.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The :class:`threading.Thread` constructor now uses the target name if the
-*target* argument is specified but the *name* argument is omitted.
diff --git a/Misc/NEWS.d/next/Library/2020-09-22-14-55-34.bpo-40670.R5sm68.rst b/Misc/NEWS.d/next/Library/2020-09-22-14-55-34.bpo-40670.R5sm68.rst
deleted file mode 100644
index 0436194d73..0000000000
--- a/Misc/NEWS.d/next/Library/2020-09-22-14-55-34.bpo-40670.R5sm68.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-More reliable validation of statements in :class:`timeit.Timer`. It now
-accepts "empty" statements (only whitespaces and comments) and rejects
-misindentent statements.
diff --git a/Misc/NEWS.d/next/Library/2020-09-29-16-23-54.bpo-41876.QicdDU.rst b/Misc/NEWS.d/next/Library/2020-09-29-16-23-54.bpo-41876.QicdDU.rst
new file mode 100644
index 0000000000..d4f5f0a37b
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-09-29-16-23-54.bpo-41876.QicdDU.rst
@@ -0,0 +1 @@
+Tkinter font class repr uses font name \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-10-01-21-11-03.bpo-41905._JpjR4.rst b/Misc/NEWS.d/next/Library/2020-10-01-21-11-03.bpo-41905._JpjR4.rst
new file mode 100644
index 0000000000..0d8c0ba6a6
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-10-01-21-11-03.bpo-41905._JpjR4.rst
@@ -0,0 +1 @@
+A new function in abc: *update_abstractmethods* to re-calculate an abstract class's abstract status. In addition, *dataclass* has been changed to call this function. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Library/2020-10-03-23-14-50.bpo-41923.Buonw9.rst b/Misc/NEWS.d/next/Library/2020-10-03-23-14-50.bpo-41923.Buonw9.rst
new file mode 100644
index 0000000000..dd9a1f709f
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-10-03-23-14-50.bpo-41923.Buonw9.rst
@@ -0,0 +1 @@
+Implement :pep:`613`, introducing :data:`typing.TypeAlias` annotation.
diff --git a/Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst b/Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst
new file mode 100644
index 0000000000..c8b3fc7718
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-10-08-18-22-28.bpo-41976.Svm0wb.rst
@@ -0,0 +1,3 @@
+Fixed a bug that was causing :func:`ctypes.util.find_library` to return
+``None`` when triying to locate a library in an environment when gcc>=9 is
+available and ``ldconfig`` is not. Patch by Pablo Galindo
diff --git a/Misc/NEWS.d/next/Library/2020-10-12-21-21-24.bpo-42021.8yv_8-.rst b/Misc/NEWS.d/next/Library/2020-10-12-21-21-24.bpo-42021.8yv_8-.rst
new file mode 100644
index 0000000000..7d71e9a700
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-10-12-21-21-24.bpo-42021.8yv_8-.rst
@@ -0,0 +1 @@
+Fix possible ref leaks in :mod:`sqlite3` module init.
diff --git a/Misc/NEWS.d/next/Library/2020-10-16-16-08-04.bpo-28660.eX9pvD.rst b/Misc/NEWS.d/next/Library/2020-10-16-16-08-04.bpo-28660.eX9pvD.rst
new file mode 100644
index 0000000000..d67993492f
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-10-16-16-08-04.bpo-28660.eX9pvD.rst
@@ -0,0 +1 @@
+:func:`textwrap.wrap` now attempts to break long words after hyphens when ``break_long_words=True`` and ``break_on_hyphens=True``.
diff --git a/Misc/NEWS.d/next/Library/2020-10-16-22-48-01.bpo-19270.jd_gkA.rst b/Misc/NEWS.d/next/Library/2020-10-16-22-48-01.bpo-19270.jd_gkA.rst
new file mode 100644
index 0000000000..6330a91a44
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-10-16-22-48-01.bpo-19270.jd_gkA.rst
@@ -0,0 +1,2 @@
+:meth:`sched.scheduler.cancel()` will now cancel the correct event, if two
+events with same priority are scheduled for the same time. Patch by Bar Harel.
diff --git a/Misc/NEWS.d/next/Library/2020-10-17-07-52-53.bpo-41966.gwEQRZ.rst b/Misc/NEWS.d/next/Library/2020-10-17-07-52-53.bpo-41966.gwEQRZ.rst
new file mode 100644
index 0000000000..0e7fad4007
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-10-17-07-52-53.bpo-41966.gwEQRZ.rst
@@ -0,0 +1,2 @@
+Fix pickling pure Python :class:`datetime.time` subclasses. Patch by Dean
+Inwood.
diff --git a/Misc/NEWS.d/next/Library/2020-10-17-23-17-18.bpo-42065.85BsRA.rst b/Misc/NEWS.d/next/Library/2020-10-17-23-17-18.bpo-42065.85BsRA.rst
new file mode 100644
index 0000000000..83c86c0799
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-10-17-23-17-18.bpo-42065.85BsRA.rst
@@ -0,0 +1,3 @@
+Fix an incorrectly formatted error from :meth:`_codecs.charmap_decode` when
+called with a mapped value outside the range of valid Unicode code points.
+PR by Max Bernstein.
diff --git a/Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst b/Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst
deleted file mode 100644
index 990affc3ed..0000000000
--- a/Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Prevent http header injection by rejecting control characters in
-http.client.putrequest(...).
diff --git a/Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst b/Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst
deleted file mode 100644
index 1380b31fbe..0000000000
--- a/Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst
+++ /dev/null
@@ -1 +0,0 @@
-The __hash__() methods of ipaddress.IPv4Interface and ipaddress.IPv6Interface incorrectly generated constant hash values of 32 and 128 respectively. This resulted in always causing hash collisions. The fix uses hash() to generate hash values for the tuple of (address, mask length, network address).
diff --git a/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst b/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst
deleted file mode 100644
index 998ffb1ee6..0000000000
--- a/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Ensure :file:`python3.dll` is loaded from correct locations when Python is
-embedded (CVE-2020-15523).
diff --git a/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst b/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst
deleted file mode 100644
index f0333ac4a7..0000000000
--- a/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst
+++ /dev/null
@@ -1 +0,0 @@
-Audit hooks are now cleared later during finalization to avoid missing events. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst b/Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst
deleted file mode 100644
index 8cc4bb8d28..0000000000
--- a/Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixes `python3x._pth` being ignored on Windows, caused by the fix for :issue:`29778` (CVE-2020-15801).
diff --git a/Misc/NEWS.d/next/Tests/2018-08-20-09-38-52.bpo-34401.eGxMPm.rst b/Misc/NEWS.d/next/Tests/2018-08-20-09-38-52.bpo-34401.eGxMPm.rst
deleted file mode 100644
index 1b28d94c05..0000000000
--- a/Misc/NEWS.d/next/Tests/2018-08-20-09-38-52.bpo-34401.eGxMPm.rst
+++ /dev/null
@@ -1 +0,0 @@
-Make test_gdb properly run on HP-UX. Patch by Michael Osipov.
diff --git a/Misc/NEWS.d/next/Tests/2019-09-14-13-20-27.bpo-38169.hurq4B.rst b/Misc/NEWS.d/next/Tests/2019-09-14-13-20-27.bpo-38169.hurq4B.rst
deleted file mode 100644
index 3972b9d440..0000000000
--- a/Misc/NEWS.d/next/Tests/2019-09-14-13-20-27.bpo-38169.hurq4B.rst
+++ /dev/null
@@ -1 +0,0 @@
-Increase code coverage for SharedMemory and ShareableList
diff --git a/Misc/NEWS.d/next/Tests/2020-04-09-15-40-03.bpo-31904.TJ4k3d.rst b/Misc/NEWS.d/next/Tests/2020-04-09-15-40-03.bpo-31904.TJ4k3d.rst
deleted file mode 100644
index 40d232ec2f..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-04-09-15-40-03.bpo-31904.TJ4k3d.rst
+++ /dev/null
@@ -1 +0,0 @@
-Increase LOOPBACK_TIMEOUT to 10 for VxWorks RTOS.
diff --git a/Misc/NEWS.d/next/Tests/2020-05-26-07-53-31.bpo-17258.X_IKTQ.rst b/Misc/NEWS.d/next/Tests/2020-05-26-07-53-31.bpo-17258.X_IKTQ.rst
deleted file mode 100644
index 0a4b329b80..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-05-26-07-53-31.bpo-17258.X_IKTQ.rst
+++ /dev/null
@@ -1 +0,0 @@
-Skip some :mod:`multiprocessing` tests when MD5 hash digest is blocked.
diff --git a/Misc/NEWS.d/next/Tests/2020-06-09-18-48-18.bpo-40927.67ylLg.rst b/Misc/NEWS.d/next/Tests/2020-06-09-18-48-18.bpo-40927.67ylLg.rst
deleted file mode 100644
index 66209b84c9..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-06-09-18-48-18.bpo-40927.67ylLg.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix test_binhex when run twice: it now uses import_fresh_module() to ensure
-that it raises DeprecationWarning each time.
diff --git a/Misc/NEWS.d/next/Tests/2020-06-12-20-46-23.bpo-40964.OBzf2c.rst b/Misc/NEWS.d/next/Tests/2020-06-12-20-46-23.bpo-40964.OBzf2c.rst
deleted file mode 100644
index abfe4f0da4..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-06-12-20-46-23.bpo-40964.OBzf2c.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Disable remote :mod:`imaplib` tests, host cyrus.andrew.cmu.edu is blocking
-incoming connections.
diff --git a/Misc/NEWS.d/next/Tests/2020-06-17-15-07-14.bpo-41003.tiH_Fy.rst b/Misc/NEWS.d/next/Tests/2020-06-17-15-07-14.bpo-41003.tiH_Fy.rst
deleted file mode 100644
index 6f908d99fe..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-06-17-15-07-14.bpo-41003.tiH_Fy.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Fix ``test_copyreg`` when ``numpy`` is installed: ``test.pickletester`` now
-saves/restores warnings filters when importing ``numpy``, to ignore filters
-installed by ``numpy``.
diff --git a/Misc/NEWS.d/next/Tests/2020-06-17-17-27-07.bpo-41009.Rvn6OQ.rst b/Misc/NEWS.d/next/Tests/2020-06-17-17-27-07.bpo-41009.Rvn6OQ.rst
deleted file mode 100644
index 1208c119a3..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-06-17-17-27-07.bpo-41009.Rvn6OQ.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix use of ``support.require_{linux|mac|freebsd}_version()`` decorators as
-class decorator.
diff --git a/Misc/NEWS.d/next/Tests/2020-06-17-18-00-21.bpo-38377.jfg4TH.rst b/Misc/NEWS.d/next/Tests/2020-06-17-18-00-21.bpo-38377.jfg4TH.rst
deleted file mode 100644
index 11a30761d3..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-06-17-18-00-21.bpo-38377.jfg4TH.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-On Linux, skip tests using multiprocessing if the current user cannot create
-a file in ``/dev/shm/`` directory. Add the
-:func:`~test.support.skip_if_broken_multiprocessing_synchronize` function to
-the :mod:`test.support` module.
diff --git a/Misc/NEWS.d/next/Tests/2020-06-22-00-21-12.bpo-41069.bLZkX-.rst b/Misc/NEWS.d/next/Tests/2020-06-22-00-21-12.bpo-41069.bLZkX-.rst
deleted file mode 100644
index 14bbd1a39a..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-06-22-00-21-12.bpo-41069.bLZkX-.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:data:`test.support.TESTFN` and the current directory for tests when run via
-``test.regrtest`` contain now non-ascii characters if possible.
diff --git a/Misc/NEWS.d/next/Tests/2020-06-23-12-02-45.bpo-41085.JZKsyz.rst b/Misc/NEWS.d/next/Tests/2020-06-23-12-02-45.bpo-41085.JZKsyz.rst
deleted file mode 100644
index 463dffdd65..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-06-23-12-02-45.bpo-41085.JZKsyz.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fix integer overflow in the :meth:`array.array.index` method on 64-bit Windows
-for index larger than ``2**31``.
diff --git a/Misc/NEWS.d/next/Tests/2020-08-03-13-44-37.bpo-41306.VDoWXI.rst b/Misc/NEWS.d/next/Tests/2020-08-03-13-44-37.bpo-41306.VDoWXI.rst
new file mode 100644
index 0000000000..5e9ba2d8a2
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2020-08-03-13-44-37.bpo-41306.VDoWXI.rst
@@ -0,0 +1 @@
+Fixed a failure in ``test_tk.test_widgets.ScaleTest`` happening when executing the test with Tk 8.6.10.
diff --git a/Misc/NEWS.d/next/Tests/2020-08-07-17-28-49.bpo-41477.GrFexU.rst b/Misc/NEWS.d/next/Tests/2020-08-07-17-28-49.bpo-41477.GrFexU.rst
deleted file mode 100644
index bf0f54abec..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-08-07-17-28-49.bpo-41477.GrFexU.rst
+++ /dev/null
@@ -1 +0,0 @@
-Make ctypes optional in test_genericalias.
diff --git a/Misc/NEWS.d/next/Tests/2020-08-11-14-59-13.bpo-41521.w2UYK7.rst b/Misc/NEWS.d/next/Tests/2020-08-11-14-59-13.bpo-41521.w2UYK7.rst
deleted file mode 100644
index 658372b1a7..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-08-11-14-59-13.bpo-41521.w2UYK7.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:mod:`test.support`: Rename ``blacklist`` parameter of
-:func:`~test.support.check__all__` to ``not_exported``.
diff --git a/Misc/NEWS.d/next/Tests/2020-08-25-19-25-36.bpo-41602.Z64s0I.rst b/Misc/NEWS.d/next/Tests/2020-08-25-19-25-36.bpo-41602.Z64s0I.rst
deleted file mode 100644
index fa3d2f1aa3..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-08-25-19-25-36.bpo-41602.Z64s0I.rst
+++ /dev/null
@@ -1 +0,0 @@
-Add tests for SIGINT handling in the runpy module.
diff --git a/Misc/NEWS.d/next/Tests/2020-09-11-19-12-31.bpo-41731.Ivxh4U.rst b/Misc/NEWS.d/next/Tests/2020-09-11-19-12-31.bpo-41731.Ivxh4U.rst
deleted file mode 100644
index e368a60f77..0000000000
--- a/Misc/NEWS.d/next/Tests/2020-09-11-19-12-31.bpo-41731.Ivxh4U.rst
+++ /dev/null
@@ -1 +0,0 @@
-Make test_cmd_line_script pass with option '-vv'.
diff --git a/Misc/NEWS.d/next/Tests/2020-10-05-17-43-46.bpo-41944.rf1dYb.rst b/Misc/NEWS.d/next/Tests/2020-10-05-17-43-46.bpo-41944.rf1dYb.rst
new file mode 100644
index 0000000000..4f9782f1c8
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2020-10-05-17-43-46.bpo-41944.rf1dYb.rst
@@ -0,0 +1 @@
+Tests for CJK codecs no longer call ``eval()`` on content received via HTTP.
diff --git a/Misc/NEWS.d/next/Tests/2020-10-08-14-00-17.bpo-41970.aZ8QFf.rst b/Misc/NEWS.d/next/Tests/2020-10-08-14-00-17.bpo-41970.aZ8QFf.rst
new file mode 100644
index 0000000000..4cdca197fb
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2020-10-08-14-00-17.bpo-41970.aZ8QFf.rst
@@ -0,0 +1,2 @@
+Avoid a test failure in ``test_lib2to3`` if the module has already imported
+at the time the test executes. Patch by Pablo Galindo.
diff --git a/Misc/NEWS.d/next/Tests/2020-10-12-00-11-47.bpo-41739.wSCc4K.rst b/Misc/NEWS.d/next/Tests/2020-10-12-00-11-47.bpo-41739.wSCc4K.rst
new file mode 100644
index 0000000000..7aee2b9444
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2020-10-12-00-11-47.bpo-41739.wSCc4K.rst
@@ -0,0 +1,2 @@
+Fix test_logging.test_race_between_set_target_and_flush(): the test now
+waits until all threads complete to avoid leaking running threads.
diff --git a/Misc/NEWS.d/next/Windows/2019-07-11-06-11-09.bpo-37556.sygMUU.rst b/Misc/NEWS.d/next/Windows/2019-07-11-06-11-09.bpo-37556.sygMUU.rst
deleted file mode 100644
index e8af96421b..0000000000
--- a/Misc/NEWS.d/next/Windows/2019-07-11-06-11-09.bpo-37556.sygMUU.rst
+++ /dev/null
@@ -1 +0,0 @@
-Extend py.exe help to mention overrides via venv, shebang, environmental variables & ini files. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Windows/2020-05-19-04-11-12.bpo-40677.qQbLW8.rst b/Misc/NEWS.d/next/Windows/2020-05-19-04-11-12.bpo-40677.qQbLW8.rst
deleted file mode 100644
index a09cb243ab..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-05-19-04-11-12.bpo-40677.qQbLW8.rst
+++ /dev/null
@@ -1 +0,0 @@
-Manually define IO_REPARSE_TAG_APPEXECLINK in case some old Windows SDK doesn't have it. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Windows/2020-05-19-14-43-33.bpo-39631.Z5yXam.rst b/Misc/NEWS.d/next/Windows/2020-05-19-14-43-33.bpo-39631.Z5yXam.rst
deleted file mode 100644
index 38db4b431b..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-05-19-14-43-33.bpo-39631.Z5yXam.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Changes the registered MIME type for ``.py`` files on Windows to
-``text/x-python`` instead of ``text/plain``.
diff --git a/Misc/NEWS.d/next/Windows/2020-06-12-13-13-44.bpo-40164.SPrSn5.rst b/Misc/NEWS.d/next/Windows/2020-06-12-13-13-44.bpo-40164.SPrSn5.rst
deleted file mode 100644
index 6390de717d..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-06-12-13-13-44.bpo-40164.SPrSn5.rst
+++ /dev/null
@@ -1 +0,0 @@
-Updates Windows OpenSSL to 1.1.1g \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Windows/2020-06-23-03-12-57.bpo-41039.0hgd0s.rst b/Misc/NEWS.d/next/Windows/2020-06-23-03-12-57.bpo-41039.0hgd0s.rst
deleted file mode 100644
index acc3f7441f..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-06-23-03-12-57.bpo-41039.0hgd0s.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Stable ABI redirection DLL (python3.dll) now uses ``#pragma
-comment(linker)`` for re-exporting.
diff --git a/Misc/NEWS.d/next/Windows/2020-06-24-21-30-42.bpo-41074.gaQc3C.rst b/Misc/NEWS.d/next/Windows/2020-06-24-21-30-42.bpo-41074.gaQc3C.rst
deleted file mode 100644
index ec91fd361c..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-06-24-21-30-42.bpo-41074.gaQc3C.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Fixed support of non-ASCII names in functions :func:`msilib.OpenDatabase`
-and :func:`msilib.init_database` and non-ASCII SQL in method
-:meth:`msilib.Database.OpenView`.
diff --git a/Misc/NEWS.d/next/Windows/2020-06-28-12-40-41.bpo-41142.jpZzzh.rst b/Misc/NEWS.d/next/Windows/2020-06-28-12-40-41.bpo-41142.jpZzzh.rst
deleted file mode 100644
index 91406da7a2..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-06-28-12-40-41.bpo-41142.jpZzzh.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-:mod:`msilib` now supports creating CAB files with non-ASCII file path and
-adding files with non-ASCII file path to them.
diff --git a/Misc/NEWS.d/next/Windows/2020-07-20-23-26-26.bpo-40741.C9sc_d.rst b/Misc/NEWS.d/next/Windows/2020-07-20-23-26-26.bpo-40741.C9sc_d.rst
deleted file mode 100644
index 69b7cce438..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-07-20-23-26-26.bpo-40741.C9sc_d.rst
+++ /dev/null
@@ -1 +0,0 @@
-Update Windows release to include SQLite 3.32.3.
diff --git a/Misc/NEWS.d/next/Windows/2020-07-28-11-55-43.bpo-41412.ME20KB.rst b/Misc/NEWS.d/next/Windows/2020-07-28-11-55-43.bpo-41412.ME20KB.rst
deleted file mode 100644
index 274264ad87..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-07-28-11-55-43.bpo-41412.ME20KB.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The installer will now fail to install on Windows 7 and Windows 8. Further,
-the UCRT dependency is now always downloaded on demand.
diff --git a/Misc/NEWS.d/next/Windows/2020-07-28-12-39-32.bpo-40948.ISUFO6.rst b/Misc/NEWS.d/next/Windows/2020-07-28-12-39-32.bpo-40948.ISUFO6.rst
deleted file mode 100644
index f8831d8c13..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-07-28-12-39-32.bpo-40948.ISUFO6.rst
+++ /dev/null
@@ -1 +0,0 @@
-Improve post-install message to direct people to the "py" command.
diff --git a/Misc/NEWS.d/next/Windows/2020-08-06-16-59-10.bpo-41492.2FQ9cM.rst b/Misc/NEWS.d/next/Windows/2020-08-06-16-59-10.bpo-41492.2FQ9cM.rst
deleted file mode 100644
index 065803e2c2..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-08-06-16-59-10.bpo-41492.2FQ9cM.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixes the description that appears in UAC prompts.
diff --git a/Misc/NEWS.d/next/Windows/2020-08-13-22-40-58.bpo-41526.-i2bwb.rst b/Misc/NEWS.d/next/Windows/2020-08-13-22-40-58.bpo-41526.-i2bwb.rst
deleted file mode 100644
index 756c827059..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-08-13-22-40-58.bpo-41526.-i2bwb.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Fixed layout of final page of the installer by removing the special thanks
-to Mark Hammond (with his permission).
diff --git a/Misc/NEWS.d/next/Windows/2020-08-26-09-35-06.bpo-41557.vt00cQ.rst b/Misc/NEWS.d/next/Windows/2020-08-26-09-35-06.bpo-41557.vt00cQ.rst
new file mode 100644
index 0000000000..9d85461f00
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2020-08-26-09-35-06.bpo-41557.vt00cQ.rst
@@ -0,0 +1 @@
+Update Windows installer to use SQLite 3.33.0.
diff --git a/Misc/NEWS.d/next/Windows/2020-09-04-21-35-28.bpo-41627.sx2KN1.rst b/Misc/NEWS.d/next/Windows/2020-09-04-21-35-28.bpo-41627.sx2KN1.rst
deleted file mode 100644
index 043bd5e934..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-09-04-21-35-28.bpo-41627.sx2KN1.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-The user site directory for 32-bit now includes a ``-32`` suffix to
-distinguish it from the 64-bit interpreter's directory.
diff --git a/Misc/NEWS.d/next/Windows/2020-09-11-17-59-33.bpo-41744.e_ugDQ.rst b/Misc/NEWS.d/next/Windows/2020-09-11-17-59-33.bpo-41744.e_ugDQ.rst
deleted file mode 100644
index 6106d6604c..0000000000
--- a/Misc/NEWS.d/next/Windows/2020-09-11-17-59-33.bpo-41744.e_ugDQ.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fixes automatic import of props file when using the Nuget package. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/Windows/2020-10-18-18-43-45.bpo-38252.7Nlepg.rst b/Misc/NEWS.d/next/Windows/2020-10-18-18-43-45.bpo-38252.7Nlepg.rst
new file mode 100644
index 0000000000..c103e6cfcc
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2020-10-18-18-43-45.bpo-38252.7Nlepg.rst
@@ -0,0 +1 @@
+Use 8-byte step to detect ASCII sequence in 64-bit Windows build.
diff --git a/Misc/NEWS.d/next/macOS/2020-06-07-20-10-56.bpo-40741.80A2BW.rst b/Misc/NEWS.d/next/macOS/2020-06-07-20-10-56.bpo-40741.80A2BW.rst
deleted file mode 100644
index 6ff7b9a805..0000000000
--- a/Misc/NEWS.d/next/macOS/2020-06-07-20-10-56.bpo-40741.80A2BW.rst
+++ /dev/null
@@ -1 +0,0 @@
-Update macOS installer to use SQLite 3.32.2.
diff --git a/Misc/NEWS.d/next/macOS/2020-06-17-13-45-15.bpo-41005.zZegdV.rst b/Misc/NEWS.d/next/macOS/2020-06-17-13-45-15.bpo-41005.zZegdV.rst
deleted file mode 100644
index 3b5f3f23a1..0000000000
--- a/Misc/NEWS.d/next/macOS/2020-06-17-13-45-15.bpo-41005.zZegdV.rst
+++ /dev/null
@@ -1 +0,0 @@
-fixed an XDG settings issue not allowing macos to open browser in webbrowser.py \ No newline at end of file
diff --git a/Misc/NEWS.d/next/macOS/2020-06-19-14-19-08.bpo-40741.L7yTbm.rst b/Misc/NEWS.d/next/macOS/2020-06-19-14-19-08.bpo-40741.L7yTbm.rst
deleted file mode 100644
index 78a21b76c2..0000000000
--- a/Misc/NEWS.d/next/macOS/2020-06-19-14-19-08.bpo-40741.L7yTbm.rst
+++ /dev/null
@@ -1 +0,0 @@
-Update macOS installer to use SQLite 3.32.3.
diff --git a/Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst b/Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
deleted file mode 100644
index d6bb616136..0000000000
--- a/Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-Fix configure error when building on macOS 11.
-Note that the current Python release was released
-shortly after the first developer preview of macOS
-11 (Big Sur); there are other known issues with
-building and running on the developer preview.
-Big Sur is expected to be fully supported in a
-future bugfix release of Python 3.8.x and with 3.9.0. \ No newline at end of file
diff --git a/Misc/NEWS.d/next/macOS/2020-06-25-06-09-00.bpo-39580.N_vJ9h.rst b/Misc/NEWS.d/next/macOS/2020-06-25-06-09-00.bpo-39580.N_vJ9h.rst
deleted file mode 100644
index 95d6535980..0000000000
--- a/Misc/NEWS.d/next/macOS/2020-06-25-06-09-00.bpo-39580.N_vJ9h.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-Avoid opening Finder window if running installer from the command line.
-Patch contributed by Rick Heil.
diff --git a/Modules/Setup b/Modules/Setup
index 470bf6bc2e..87f3a7cb43 100644
--- a/Modules/Setup
+++ b/Modules/Setup
@@ -226,7 +226,7 @@ _symtable symtablemodule.c
#termios termios.c # Steen Lumholt's termios module
#resource resource.c # Jeremy Hylton's rlimit interface
-#_posixsubprocess _posixsubprocess.c # POSIX subprocess module helper
+#_posixsubprocess -DPy_BUILD_CORE_BUILTIN _posixsubprocess.c # POSIX subprocess module helper
# Multimedia modules -- off by default.
# These don't work for 64-bit platforms!!!
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index 2151f20281..f01e5884c6 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -16,7 +16,6 @@ _Py_IDENTIFIER(add_done_callback);
_Py_IDENTIFIER(call_soon);
_Py_IDENTIFIER(cancel);
_Py_IDENTIFIER(get_event_loop);
-_Py_IDENTIFIER(send);
_Py_IDENTIFIER(throw);
@@ -2695,13 +2694,7 @@ task_step_impl(TaskObj *task, PyObject *exc)
int gen_status = PYGEN_ERROR;
if (exc == NULL) {
- if (PyGen_CheckExact(coro) || PyCoro_CheckExact(coro)) {
- gen_status = PyGen_Send((PyGenObject*)coro, Py_None, &result);
- }
- else {
- result = _PyObject_CallMethodIdOneArg(coro, &PyId_send, Py_None);
- gen_status = gen_status_from_result(&result);
- }
+ gen_status = PyIter_Send(coro, Py_None, &result);
}
else {
result = _PyObject_CallMethodIdOneArg(coro, &PyId_throw, exc);
diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c
index 82d800d9a8..277e9755f2 100644
--- a/Modules/_bisectmodule.c
+++ b/Modules/_bisectmodule.c
@@ -237,18 +237,14 @@ common approach.\n");
static struct PyModuleDef _bisectmodule = {
PyModuleDef_HEAD_INIT,
- "_bisect",
- module_doc,
- -1,
- bisect_methods,
- NULL,
- NULL,
- NULL,
- NULL
+ .m_name = "_bisect",
+ .m_doc = module_doc,
+ .m_methods = bisect_methods,
+ .m_size = 0
};
PyMODINIT_FUNC
PyInit__bisect(void)
{
- return PyModule_Create(&_bisectmodule);
+ return PyModuleDef_Init(&_bisectmodule);
}
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c
index 952072102d..2e8cb97fe7 100644
--- a/Modules/_codecsmodule.c
+++ b/Modules/_codecsmodule.c
@@ -69,6 +69,27 @@ _codecs_register(PyObject *module, PyObject *search_function)
}
/*[clinic input]
+_codecs.unregister
+ search_function: object
+ /
+
+Unregister a codec search function and clear the registry's cache.
+
+If the search function is not registered, do nothing.
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_unregister(PyObject *module, PyObject *search_function)
+/*[clinic end generated code: output=1f0edee9cf246399 input=dd7c004c652d345e]*/
+{
+ if (PyCodec_Unregister(search_function) < 0) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
_codecs.lookup
encoding: str
/
@@ -139,25 +160,6 @@ _codecs_decode_impl(PyObject *module, PyObject *obj, const char *encoding,
/* --- Helpers ------------------------------------------------------------ */
-/*[clinic input]
-_codecs._forget_codec
-
- encoding: str
- /
-
-Purge the named codec from the internal codec lookup cache
-[clinic start generated code]*/
-
-static PyObject *
-_codecs__forget_codec_impl(PyObject *module, const char *encoding)
-/*[clinic end generated code: output=0bde9f0a5b084aa2 input=18d5d92d0e386c38]*/
-{
- if (_PyCodec_Forget(encoding) < 0) {
- return NULL;
- };
- Py_RETURN_NONE;
-}
-
static
PyObject *codec_tuple(PyObject *decoded,
Py_ssize_t len)
@@ -992,6 +994,7 @@ _codecs_lookup_error_impl(PyObject *module, const char *name)
static PyMethodDef _codecs_functions[] = {
_CODECS_REGISTER_METHODDEF
+ _CODECS_UNREGISTER_METHODDEF
_CODECS_LOOKUP_METHODDEF
_CODECS_ENCODE_METHODDEF
_CODECS_DECODE_METHODDEF
@@ -1035,7 +1038,6 @@ static PyMethodDef _codecs_functions[] = {
_CODECS_CODE_PAGE_DECODE_METHODDEF
_CODECS_REGISTER_ERROR_METHODDEF
_CODECS_LOOKUP_ERROR_METHODDEF
- _CODECS__FORGET_CODEC_METHODDEF
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 0631272429..94868717e6 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -4663,7 +4663,10 @@ static PyMethodDef time_methods[] = {
{"isoformat", (PyCFunction)(void(*)(void))time_isoformat, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("Return string in ISO 8601 format, [HH[:MM[:SS[.mmm[uuu]]]]]"
"[+HH:MM].\n\n"
- "timespec specifies what components of the time to include.\n")},
+ "The optional argument timespec specifies the number "
+ "of additional terms\nof the time to include. Valid "
+ "options are 'auto', 'hours', 'minutes',\n'seconds', "
+ "'milliseconds' and 'microseconds'.\n")},
{"strftime", (PyCFunction)(void(*)(void))time_strftime, METH_VARARGS | METH_KEYWORDS,
PyDoc_STR("format -> strftime() style string.")},
@@ -6370,9 +6373,10 @@ static PyMethodDef datetime_methods[] = {
"YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\n"
"sep is used to separate the year from the time, and "
"defaults to 'T'.\n"
- "timespec specifies what components of the time to include"
- " (allowed values are 'auto', 'hours', 'minutes', 'seconds',"
- " 'milliseconds', and 'microseconds').\n")},
+ "The optional argument timespec specifies the number "
+ "of additional terms\nof the time to include. Valid "
+ "options are 'auto', 'hours', 'minutes',\n'seconds', "
+ "'milliseconds' and 'microseconds'.\n")},
{"utcoffset", (PyCFunction)datetime_utcoffset, METH_NOARGS,
PyDoc_STR("Return self.tzinfo.utcoffset(self).")},
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 5d1691ace4..d08c47980e 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -1,5 +1,6 @@
/* Authors: Gregory P. Smith & Jeffrey Yasskin */
#include "Python.h"
+#include "pycore_fileutils.h"
#if defined(HAVE_PIPE2) && !defined(_GNU_SOURCE)
# define _GNU_SOURCE
#endif
@@ -250,7 +251,6 @@ _close_fds_by_brute_force(long start_fd, PyObject *py_fds_to_keep)
long end_fd = safe_get_max_fd();
Py_ssize_t num_fds_to_keep = PyTuple_GET_SIZE(py_fds_to_keep);
Py_ssize_t keep_seq_idx;
- int fd_num;
/* As py_fds_to_keep is sorted we can loop through the list closing
* fds in between any in the keep list falling within our range. */
for (keep_seq_idx = 0; keep_seq_idx < num_fds_to_keep; ++keep_seq_idx) {
@@ -258,21 +258,11 @@ _close_fds_by_brute_force(long start_fd, PyObject *py_fds_to_keep)
int keep_fd = PyLong_AsLong(py_keep_fd);
if (keep_fd < start_fd)
continue;
- for (fd_num = start_fd; fd_num < keep_fd; ++fd_num) {
- close(fd_num);
- }
+ _Py_closerange(start_fd, keep_fd - 1);
start_fd = keep_fd + 1;
}
if (start_fd <= end_fd) {
-#if defined(__FreeBSD__)
- /* Any errors encountered while closing file descriptors are ignored */
- closefrom(start_fd);
-#else
- for (fd_num = start_fd; fd_num < end_fd; ++fd_num) {
- /* Ignore errors */
- (void)close(fd_num);
- }
-#endif
+ _Py_closerange(start_fd, end_fd);
}
}
diff --git a/Modules/_sqlite/cache.c b/Modules/_sqlite/cache.c
index 758fc022f7..0b02be4f0b 100644
--- a/Modules/_sqlite/cache.c
+++ b/Modules/_sqlite/cache.c
@@ -29,7 +29,7 @@ pysqlite_Node* pysqlite_new_node(PyObject* key, PyObject* data)
{
pysqlite_Node* node;
- node = (pysqlite_Node*) (pysqlite_NodeType.tp_alloc(&pysqlite_NodeType, 0));
+ node = (pysqlite_Node*) (pysqlite_NodeType->tp_alloc(pysqlite_NodeType, 0));
if (!node) {
return NULL;
}
@@ -48,10 +48,13 @@ pysqlite_Node* pysqlite_new_node(PyObject* key, PyObject* data)
void pysqlite_node_dealloc(pysqlite_Node* self)
{
+ PyTypeObject *tp = Py_TYPE(self);
+
Py_DECREF(self->key);
Py_DECREF(self->data);
- Py_TYPE(self)->tp_free((PyObject*)self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
}
int pysqlite_cache_init(pysqlite_Cache* self, PyObject* args, PyObject* kwargs)
@@ -88,6 +91,7 @@ int pysqlite_cache_init(pysqlite_Cache* self, PyObject* args, PyObject* kwargs)
void pysqlite_cache_dealloc(pysqlite_Cache* self)
{
+ PyTypeObject *tp = Py_TYPE(self);
pysqlite_Node* node;
pysqlite_Node* delete_node;
@@ -109,7 +113,8 @@ void pysqlite_cache_dealloc(pysqlite_Cache* self)
}
Py_DECREF(self->mapping);
- Py_TYPE(self)->tp_free((PyObject*)self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
}
PyObject* pysqlite_cache_get(pysqlite_Cache* self, PyObject* key)
@@ -253,6 +258,20 @@ PyObject* pysqlite_cache_display(pysqlite_Cache* self, PyObject* args)
Py_RETURN_NONE;
}
+static PyType_Slot pysqlite_NodeType_slots[] = {
+ {Py_tp_dealloc, pysqlite_node_dealloc},
+ {Py_tp_new, PyType_GenericNew},
+ {0, NULL},
+};
+
+static PyType_Spec pysqlite_NodeType_spec = {
+ .name = MODULE_NAME ".Node",
+ .basicsize = sizeof(pysqlite_Node),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .slots = pysqlite_NodeType_slots,
+};
+PyTypeObject *pysqlite_NodeType = NULL;
+
static PyMethodDef cache_methods[] = {
{"get", (PyCFunction)pysqlite_cache_get, METH_O,
PyDoc_STR("Gets an entry from the cache or calls the factory function to produce one.")},
@@ -261,102 +280,32 @@ static PyMethodDef cache_methods[] = {
{NULL, NULL}
};
-PyTypeObject pysqlite_NodeType = {
- PyVarObject_HEAD_INIT(NULL, 0)
- MODULE_NAME "Node", /* tp_name */
- sizeof(pysqlite_Node), /* tp_basicsize */
- 0, /* tp_itemsize */
- (destructor)pysqlite_node_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- 0, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- 0, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)0, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0 /* tp_free */
+static PyType_Slot pysqlite_CacheType_slots[] = {
+ {Py_tp_dealloc, pysqlite_cache_dealloc},
+ {Py_tp_methods, cache_methods},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_init, pysqlite_cache_init},
+ {0, NULL},
};
-PyTypeObject pysqlite_CacheType = {
- PyVarObject_HEAD_INIT(NULL, 0)
- MODULE_NAME ".Cache", /* tp_name */
- sizeof(pysqlite_Cache), /* tp_basicsize */
- 0, /* tp_itemsize */
- (destructor)pysqlite_cache_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- 0, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- cache_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)pysqlite_cache_init, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0 /* tp_free */
+static PyType_Spec pysqlite_CacheType_spec = {
+ .name = MODULE_NAME ".Cache",
+ .basicsize = sizeof(pysqlite_Cache),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .slots = pysqlite_CacheType_slots,
};
+PyTypeObject *pysqlite_CacheType = NULL;
-extern int pysqlite_cache_setup_types(void)
+extern int pysqlite_cache_setup_types(PyObject *mod)
{
- int rc;
-
- pysqlite_NodeType.tp_new = PyType_GenericNew;
- pysqlite_CacheType.tp_new = PyType_GenericNew;
-
- rc = PyType_Ready(&pysqlite_NodeType);
- if (rc < 0) {
- return rc;
+ pysqlite_NodeType = (PyTypeObject *)PyType_FromModuleAndSpec(mod, &pysqlite_NodeType_spec, NULL);
+ if (pysqlite_NodeType == NULL) {
+ return -1;
}
- rc = PyType_Ready(&pysqlite_CacheType);
- return rc;
+ pysqlite_CacheType = (PyTypeObject *)PyType_FromModuleAndSpec(mod, &pysqlite_CacheType_spec, NULL);
+ if (pysqlite_CacheType == NULL) {
+ return -1;
+ }
+ return 0;
}
diff --git a/Modules/_sqlite/cache.h b/Modules/_sqlite/cache.h
index 529010967c..0afdf7f09b 100644
--- a/Modules/_sqlite/cache.h
+++ b/Modules/_sqlite/cache.h
@@ -59,8 +59,8 @@ typedef struct
int decref_factory;
} pysqlite_Cache;
-extern PyTypeObject pysqlite_NodeType;
-extern PyTypeObject pysqlite_CacheType;
+extern PyTypeObject *pysqlite_NodeType;
+extern PyTypeObject *pysqlite_CacheType;
int pysqlite_node_init(pysqlite_Node* self, PyObject* args, PyObject* kwargs);
void pysqlite_node_dealloc(pysqlite_Node* self);
@@ -69,6 +69,6 @@ int pysqlite_cache_init(pysqlite_Cache* self, PyObject* args, PyObject* kwargs);
void pysqlite_cache_dealloc(pysqlite_Cache* self);
PyObject* pysqlite_cache_get(pysqlite_Cache* self, PyObject* args);
-int pysqlite_cache_setup_types(void);
+int pysqlite_cache_setup_types(PyObject *module);
#endif
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 81fc133537..69203f85e0 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -133,7 +133,7 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject
}
Py_DECREF(isolation_level);
- self->statement_cache = (pysqlite_Cache*)PyObject_CallFunction((PyObject*)&pysqlite_CacheType, "Oi", self, cached_statements);
+ self->statement_cache = (pysqlite_Cache*)PyObject_CallFunction((PyObject*)pysqlite_CacheType, "Oi", self, cached_statements);
if (PyErr_Occurred()) {
return -1;
}
@@ -220,6 +220,8 @@ void pysqlite_do_all_statements(pysqlite_Connection* self, int action, int reset
void pysqlite_connection_dealloc(pysqlite_Connection* self)
{
+ PyTypeObject *tp = Py_TYPE(self);
+
Py_XDECREF(self->statement_cache);
/* Clean up if user has not called .close() explicitly. */
@@ -236,7 +238,9 @@ void pysqlite_connection_dealloc(pysqlite_Connection* self)
Py_XDECREF(self->collations);
Py_XDECREF(self->statements);
Py_XDECREF(self->cursors);
- Py_TYPE(self)->tp_free((PyObject*)self);
+
+ tp->tp_free(self);
+ Py_DECREF(tp);
}
/*
@@ -281,13 +285,13 @@ PyObject* pysqlite_connection_cursor(pysqlite_Connection* self, PyObject* args,
}
if (factory == NULL) {
- factory = (PyObject*)&pysqlite_CursorType;
+ factory = (PyObject*)pysqlite_CursorType;
}
cursor = PyObject_CallOneArg(factory, (PyObject *)self);
if (cursor == NULL)
return NULL;
- if (!PyObject_TypeCheck(cursor, &pysqlite_CursorType)) {
+ if (!PyObject_TypeCheck(cursor, pysqlite_CursorType)) {
PyErr_Format(PyExc_TypeError,
"factory must return a cursor, not %.100s",
Py_TYPE(cursor)->tp_name);
@@ -1234,7 +1238,7 @@ PyObject* pysqlite_connection_call(pysqlite_Connection* self, PyObject* args, Py
_pysqlite_drop_unused_statement_references(self);
- statement = PyObject_New(pysqlite_Statement, &pysqlite_StatementType);
+ statement = PyObject_New(pysqlite_Statement, pysqlite_StatementType);
if (!statement) {
return NULL;
}
@@ -1494,7 +1498,7 @@ pysqlite_connection_backup(pysqlite_Connection *self, PyObject *args, PyObject *
static char *keywords[] = {"target", "pages", "progress", "name", "sleep", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|$iOsO:backup", keywords,
- &pysqlite_ConnectionType, &target,
+ pysqlite_ConnectionType, &target,
&pages, &progress, &name, &sleep_obj)) {
return NULL;
}
@@ -1831,50 +1835,32 @@ static struct PyMemberDef connection_members[] =
{NULL}
};
-PyTypeObject pysqlite_ConnectionType = {
- PyVarObject_HEAD_INIT(NULL, 0)
- MODULE_NAME ".Connection", /* tp_name */
- sizeof(pysqlite_Connection), /* tp_basicsize */
- 0, /* tp_itemsize */
- (destructor)pysqlite_connection_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- (ternaryfunc)pysqlite_connection_call, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- connection_doc, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- connection_methods, /* tp_methods */
- connection_members, /* tp_members */
- connection_getset, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)pysqlite_connection_init, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0 /* tp_free */
+static PyType_Slot connection_slots[] = {
+ {Py_tp_dealloc, pysqlite_connection_dealloc},
+ {Py_tp_doc, (void *)connection_doc},
+ {Py_tp_methods, connection_methods},
+ {Py_tp_members, connection_members},
+ {Py_tp_getset, connection_getset},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_init, pysqlite_connection_init},
+ {Py_tp_call, pysqlite_connection_call},
+ {0, NULL},
+};
+
+static PyType_Spec connection_spec = {
+ .name = MODULE_NAME ".Connection",
+ .basicsize = sizeof(pysqlite_Connection),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .slots = connection_slots,
};
-extern int pysqlite_connection_setup_types(void)
+PyTypeObject *pysqlite_ConnectionType = NULL;
+
+extern int pysqlite_connection_setup_types(PyObject *module)
{
- pysqlite_ConnectionType.tp_new = PyType_GenericNew;
- return PyType_Ready(&pysqlite_ConnectionType);
+ pysqlite_ConnectionType = (PyTypeObject *)PyType_FromModuleAndSpec(module, &connection_spec, NULL);
+ if (pysqlite_ConnectionType == NULL) {
+ return -1;
+ }
+ return 0;
}
diff --git a/Modules/_sqlite/connection.h b/Modules/_sqlite/connection.h
index 206085e00a..aadf439034 100644
--- a/Modules/_sqlite/connection.h
+++ b/Modules/_sqlite/connection.h
@@ -106,7 +106,7 @@ typedef struct
PyObject* NotSupportedError;
} pysqlite_Connection;
-extern PyTypeObject pysqlite_ConnectionType;
+extern PyTypeObject *pysqlite_ConnectionType;
PyObject* pysqlite_connection_alloc(PyTypeObject* type, int aware);
void pysqlite_connection_dealloc(pysqlite_Connection* self);
@@ -122,6 +122,6 @@ int pysqlite_connection_register_cursor(pysqlite_Connection* connection, PyObjec
int pysqlite_check_thread(pysqlite_Connection* self);
int pysqlite_check_connection(pysqlite_Connection* con);
-int pysqlite_connection_setup_types(void);
+int pysqlite_connection_setup_types(PyObject *module);
#endif
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 5cfb4b97d6..3c09c1c6b7 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -33,7 +33,7 @@ static int pysqlite_cursor_init(pysqlite_Cursor* self, PyObject* args, PyObject*
{
pysqlite_Connection* connection;
- if (!PyArg_ParseTuple(args, "O!", &pysqlite_ConnectionType, &connection))
+ if (!PyArg_ParseTuple(args, "O!", pysqlite_ConnectionType, &connection))
{
return -1;
}
@@ -74,6 +74,8 @@ static int pysqlite_cursor_init(pysqlite_Cursor* self, PyObject* args, PyObject*
static void pysqlite_cursor_dealloc(pysqlite_Cursor* self)
{
+ PyTypeObject *tp = Py_TYPE(self);
+
/* Reset the statement if the user has not closed the cursor */
if (self->statement) {
pysqlite_statement_reset(self->statement);
@@ -91,7 +93,8 @@ static void pysqlite_cursor_dealloc(pysqlite_Cursor* self)
PyObject_ClearWeakRefs((PyObject*)self);
}
- Py_TYPE(self)->tp_free((PyObject*)self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
}
static PyObject *
@@ -472,7 +475,7 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* args)
if (self->statement->in_use) {
Py_SETREF(self->statement,
- PyObject_New(pysqlite_Statement, &pysqlite_StatementType));
+ PyObject_New(pysqlite_Statement, pysqlite_StatementType));
if (!self->statement) {
goto error;
}
@@ -898,56 +901,39 @@ static struct PyMemberDef cursor_members[] =
{"lastrowid", T_OBJECT, offsetof(pysqlite_Cursor, lastrowid), READONLY},
{"rowcount", T_LONG, offsetof(pysqlite_Cursor, rowcount), READONLY},
{"row_factory", T_OBJECT, offsetof(pysqlite_Cursor, row_factory), 0},
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(pysqlite_Cursor, in_weakreflist), READONLY},
{NULL}
};
static const char cursor_doc[] =
PyDoc_STR("SQLite database cursor class.");
-PyTypeObject pysqlite_CursorType = {
- PyVarObject_HEAD_INIT(NULL, 0)
- MODULE_NAME ".Cursor", /* tp_name */
- sizeof(pysqlite_Cursor), /* tp_basicsize */
- 0, /* tp_itemsize */
- (destructor)pysqlite_cursor_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- cursor_doc, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- offsetof(pysqlite_Cursor, in_weakreflist), /* tp_weaklistoffset */
- PyObject_SelfIter, /* tp_iter */
- (iternextfunc)pysqlite_cursor_iternext, /* tp_iternext */
- cursor_methods, /* tp_methods */
- cursor_members, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)pysqlite_cursor_init, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0 /* tp_free */
+static PyType_Slot cursor_slots[] = {
+ {Py_tp_dealloc, pysqlite_cursor_dealloc},
+ {Py_tp_doc, (void *)cursor_doc},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, pysqlite_cursor_iternext},
+ {Py_tp_methods, cursor_methods},
+ {Py_tp_members, cursor_members},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_init, pysqlite_cursor_init},
+ {0, NULL},
+};
+
+static PyType_Spec cursor_spec = {
+ .name = MODULE_NAME ".Cursor",
+ .basicsize = sizeof(pysqlite_Cursor),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .slots = cursor_slots,
};
-extern int pysqlite_cursor_setup_types(void)
+PyTypeObject *pysqlite_CursorType = NULL;
+
+extern int pysqlite_cursor_setup_types(PyObject *module)
{
- pysqlite_CursorType.tp_new = PyType_GenericNew;
- return PyType_Ready(&pysqlite_CursorType);
+ pysqlite_CursorType = (PyTypeObject *)PyType_FromModuleAndSpec(module, &cursor_spec, NULL);
+ if (pysqlite_CursorType == NULL) {
+ return -1;
+ }
+ return 0;
}
diff --git a/Modules/_sqlite/cursor.h b/Modules/_sqlite/cursor.h
index 4a20e756f7..3e6cde167f 100644
--- a/Modules/_sqlite/cursor.h
+++ b/Modules/_sqlite/cursor.h
@@ -52,7 +52,7 @@ typedef struct
PyObject* in_weakreflist; /* List of weak references */
} pysqlite_Cursor;
-extern PyTypeObject pysqlite_CursorType;
+extern PyTypeObject *pysqlite_CursorType;
PyObject* pysqlite_cursor_execute(pysqlite_Cursor* self, PyObject* args);
PyObject* pysqlite_cursor_executemany(pysqlite_Cursor* self, PyObject* args);
@@ -64,7 +64,7 @@ PyObject* pysqlite_cursor_fetchall(pysqlite_Cursor* self, PyObject* args);
PyObject* pysqlite_noop(pysqlite_Connection* self, PyObject* args);
PyObject* pysqlite_cursor_close(pysqlite_Cursor* self, PyObject* args);
-int pysqlite_cursor_setup_types(void);
+int pysqlite_cursor_setup_types(PyObject *module);
#define UNKNOWN (-1)
#endif
diff --git a/Modules/_sqlite/microprotocols.c b/Modules/_sqlite/microprotocols.c
index 3b2d7f42b8..ddc30e8a89 100644
--- a/Modules/_sqlite/microprotocols.c
+++ b/Modules/_sqlite/microprotocols.c
@@ -37,14 +37,19 @@ static PyObject *psyco_adapters = NULL;
/* pysqlite_microprotocols_init - initialize the adapters dictionary */
int
-pysqlite_microprotocols_init(PyObject *dict)
+pysqlite_microprotocols_init(PyObject *module)
{
/* create adapters dictionary and put it in module namespace */
if ((psyco_adapters = PyDict_New()) == NULL) {
return -1;
}
- return PyDict_SetItemString(dict, "adapters", psyco_adapters);
+ if (PyModule_AddObject(module, "adapters", psyco_adapters) < 0) {
+ Py_DECREF(psyco_adapters);
+ return -1;
+ }
+
+ return 0;
}
@@ -56,7 +61,7 @@ pysqlite_microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast)
PyObject* key;
int rc;
- if (proto == NULL) proto = (PyObject*)&pysqlite_PrepareProtocolType;
+ if (proto == NULL) proto = (PyObject*)pysqlite_PrepareProtocolType;
key = Py_BuildValue("(OO)", (PyObject*)type, proto);
if (!key) {
@@ -152,7 +157,7 @@ PyObject *
pysqlite_adapt(pysqlite_Cursor *self, PyObject *args)
{
PyObject *obj, *alt = NULL;
- PyObject *proto = (PyObject*)&pysqlite_PrepareProtocolType;
+ PyObject *proto = (PyObject*)pysqlite_PrepareProtocolType;
if (!PyArg_ParseTuple(args, "O|OO", &obj, &proto, &alt)) return NULL;
return pysqlite_microprotocols_adapt(obj, proto, alt);
diff --git a/Modules/_sqlite/microprotocols.h b/Modules/_sqlite/microprotocols.h
index 5418c2b98f..87df6bac55 100644
--- a/Modules/_sqlite/microprotocols.h
+++ b/Modules/_sqlite/microprotocols.h
@@ -38,7 +38,7 @@
/** exported functions **/
/* used by module.c to init the microprotocols system */
-extern int pysqlite_microprotocols_init(PyObject *dict);
+extern int pysqlite_microprotocols_init(PyObject *module);
extern int pysqlite_microprotocols_add(
PyTypeObject *type, PyObject *proto, PyObject *cast);
extern PyObject *pysqlite_microprotocols_adapt(
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index 82f58eb248..0297e2fab2 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -82,7 +82,7 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
}
if (factory == NULL) {
- factory = (PyObject*)&pysqlite_ConnectionType;
+ factory = (PyObject*)pysqlite_ConnectionType;
}
if (PySys_Audit("sqlite3.connect", "O", database) < 0) {
@@ -176,7 +176,7 @@ static PyObject* module_register_adapter(PyObject* self, PyObject* args)
pysqlite_BaseTypeAdapted = 1;
}
- rc = pysqlite_microprotocols_add(type, (PyObject*)&pysqlite_PrepareProtocolType, caster);
+ rc = pysqlite_microprotocols_add(type, (PyObject*)pysqlite_PrepareProtocolType, caster);
if (rc == -1)
return NULL;
@@ -236,14 +236,17 @@ PyDoc_STRVAR(enable_callback_tracebacks_doc,
\n\
Enable or disable callback functions throwing errors to stderr.");
-static void converters_init(PyObject* dict)
+static void converters_init(PyObject* module)
{
_pysqlite_converters = PyDict_New();
if (!_pysqlite_converters) {
return;
}
- PyDict_SetItemString(dict, "converters", _pysqlite_converters);
+ if (PyModule_AddObject(module, "converters", _pysqlite_converters) < 0) {
+ Py_DECREF(_pysqlite_converters);
+ }
+ return;
}
static PyMethodDef module_methods[] = {
@@ -264,59 +267,52 @@ static PyMethodDef module_methods[] = {
{NULL, NULL}
};
-struct _IntConstantPair {
- const char *constant_name;
- int constant_value;
-};
-
-typedef struct _IntConstantPair IntConstantPair;
-
-static const IntConstantPair _int_constants[] = {
- {"PARSE_DECLTYPES", PARSE_DECLTYPES},
- {"PARSE_COLNAMES", PARSE_COLNAMES},
-
- {"SQLITE_OK", SQLITE_OK},
- {"SQLITE_DENY", SQLITE_DENY},
- {"SQLITE_IGNORE", SQLITE_IGNORE},
- {"SQLITE_CREATE_INDEX", SQLITE_CREATE_INDEX},
- {"SQLITE_CREATE_TABLE", SQLITE_CREATE_TABLE},
- {"SQLITE_CREATE_TEMP_INDEX", SQLITE_CREATE_TEMP_INDEX},
- {"SQLITE_CREATE_TEMP_TABLE", SQLITE_CREATE_TEMP_TABLE},
- {"SQLITE_CREATE_TEMP_TRIGGER", SQLITE_CREATE_TEMP_TRIGGER},
- {"SQLITE_CREATE_TEMP_VIEW", SQLITE_CREATE_TEMP_VIEW},
- {"SQLITE_CREATE_TRIGGER", SQLITE_CREATE_TRIGGER},
- {"SQLITE_CREATE_VIEW", SQLITE_CREATE_VIEW},
- {"SQLITE_DELETE", SQLITE_DELETE},
- {"SQLITE_DROP_INDEX", SQLITE_DROP_INDEX},
- {"SQLITE_DROP_TABLE", SQLITE_DROP_TABLE},
- {"SQLITE_DROP_TEMP_INDEX", SQLITE_DROP_TEMP_INDEX},
- {"SQLITE_DROP_TEMP_TABLE", SQLITE_DROP_TEMP_TABLE},
- {"SQLITE_DROP_TEMP_TRIGGER", SQLITE_DROP_TEMP_TRIGGER},
- {"SQLITE_DROP_TEMP_VIEW", SQLITE_DROP_TEMP_VIEW},
- {"SQLITE_DROP_TRIGGER", SQLITE_DROP_TRIGGER},
- {"SQLITE_DROP_VIEW", SQLITE_DROP_VIEW},
- {"SQLITE_INSERT", SQLITE_INSERT},
- {"SQLITE_PRAGMA", SQLITE_PRAGMA},
- {"SQLITE_READ", SQLITE_READ},
- {"SQLITE_SELECT", SQLITE_SELECT},
- {"SQLITE_TRANSACTION", SQLITE_TRANSACTION},
- {"SQLITE_UPDATE", SQLITE_UPDATE},
- {"SQLITE_ATTACH", SQLITE_ATTACH},
- {"SQLITE_DETACH", SQLITE_DETACH},
- {"SQLITE_ALTER_TABLE", SQLITE_ALTER_TABLE},
- {"SQLITE_REINDEX", SQLITE_REINDEX},
- {"SQLITE_ANALYZE", SQLITE_ANALYZE},
- {"SQLITE_CREATE_VTABLE", SQLITE_CREATE_VTABLE},
- {"SQLITE_DROP_VTABLE", SQLITE_DROP_VTABLE},
- {"SQLITE_FUNCTION", SQLITE_FUNCTION},
- {"SQLITE_SAVEPOINT", SQLITE_SAVEPOINT},
+static int add_integer_constants(PyObject *module) {
+ int ret = 0;
+
+ ret += PyModule_AddIntMacro(module, PARSE_DECLTYPES);
+ ret += PyModule_AddIntMacro(module, PARSE_COLNAMES);
+ ret += PyModule_AddIntMacro(module, SQLITE_OK);
+ ret += PyModule_AddIntMacro(module, SQLITE_DENY);
+ ret += PyModule_AddIntMacro(module, SQLITE_IGNORE);
+ ret += PyModule_AddIntMacro(module, SQLITE_CREATE_INDEX);
+ ret += PyModule_AddIntMacro(module, SQLITE_CREATE_TABLE);
+ ret += PyModule_AddIntMacro(module, SQLITE_CREATE_TEMP_INDEX);
+ ret += PyModule_AddIntMacro(module, SQLITE_CREATE_TEMP_TABLE);
+ ret += PyModule_AddIntMacro(module, SQLITE_CREATE_TEMP_TRIGGER);
+ ret += PyModule_AddIntMacro(module, SQLITE_CREATE_TEMP_VIEW);
+ ret += PyModule_AddIntMacro(module, SQLITE_CREATE_TRIGGER);
+ ret += PyModule_AddIntMacro(module, SQLITE_CREATE_VIEW);
+ ret += PyModule_AddIntMacro(module, SQLITE_DELETE);
+ ret += PyModule_AddIntMacro(module, SQLITE_DROP_INDEX);
+ ret += PyModule_AddIntMacro(module, SQLITE_DROP_TABLE);
+ ret += PyModule_AddIntMacro(module, SQLITE_DROP_TEMP_INDEX);
+ ret += PyModule_AddIntMacro(module, SQLITE_DROP_TEMP_TABLE);
+ ret += PyModule_AddIntMacro(module, SQLITE_DROP_TEMP_TRIGGER);
+ ret += PyModule_AddIntMacro(module, SQLITE_DROP_TEMP_VIEW);
+ ret += PyModule_AddIntMacro(module, SQLITE_DROP_TRIGGER);
+ ret += PyModule_AddIntMacro(module, SQLITE_DROP_VIEW);
+ ret += PyModule_AddIntMacro(module, SQLITE_INSERT);
+ ret += PyModule_AddIntMacro(module, SQLITE_PRAGMA);
+ ret += PyModule_AddIntMacro(module, SQLITE_READ);
+ ret += PyModule_AddIntMacro(module, SQLITE_SELECT);
+ ret += PyModule_AddIntMacro(module, SQLITE_TRANSACTION);
+ ret += PyModule_AddIntMacro(module, SQLITE_UPDATE);
+ ret += PyModule_AddIntMacro(module, SQLITE_ATTACH);
+ ret += PyModule_AddIntMacro(module, SQLITE_DETACH);
+ ret += PyModule_AddIntMacro(module, SQLITE_ALTER_TABLE);
+ ret += PyModule_AddIntMacro(module, SQLITE_REINDEX);
+ ret += PyModule_AddIntMacro(module, SQLITE_ANALYZE);
+ ret += PyModule_AddIntMacro(module, SQLITE_CREATE_VTABLE);
+ ret += PyModule_AddIntMacro(module, SQLITE_DROP_VTABLE);
+ ret += PyModule_AddIntMacro(module, SQLITE_FUNCTION);
+ ret += PyModule_AddIntMacro(module, SQLITE_SAVEPOINT);
#if SQLITE_VERSION_NUMBER >= 3008003
- {"SQLITE_RECURSIVE", SQLITE_RECURSIVE},
+ ret += PyModule_AddIntMacro(module, SQLITE_RECURSIVE);
#endif
- {"SQLITE_DONE", SQLITE_DONE},
- {(char*)NULL, 0}
-};
-
+ ret += PyModule_AddIntMacro(module, SQLITE_DONE);
+ return ret;
+}
static struct PyModuleDef _sqlite3module = {
PyModuleDef_HEAD_INIT,
@@ -338,11 +334,21 @@ do { \
} \
} while (0)
+#define ADD_EXCEPTION(module, name, exc, base) \
+do { \
+ exc = PyErr_NewException(MODULE_NAME "." name, base, NULL); \
+ if (!exc) { \
+ goto error; \
+ } \
+ if (PyModule_AddObject(module, name, exc) < 0) { \
+ Py_DECREF(exc); \
+ goto error; \
+ } \
+} while (0)
+
PyMODINIT_FUNC PyInit__sqlite3(void)
{
- PyObject *module, *dict;
- PyObject *tmp_obj;
- int i;
+ PyObject *module;
if (sqlite3_libversion_number() < 3007003) {
PyErr_SetString(PyExc_ImportError, MODULE_NAME ": SQLite 3.7.3 or higher required");
@@ -352,81 +358,37 @@ PyMODINIT_FUNC PyInit__sqlite3(void)
module = PyModule_Create(&_sqlite3module);
if (!module ||
- (pysqlite_row_setup_types() < 0) ||
- (pysqlite_cursor_setup_types() < 0) ||
- (pysqlite_connection_setup_types() < 0) ||
- (pysqlite_cache_setup_types() < 0) ||
- (pysqlite_statement_setup_types() < 0) ||
- (pysqlite_prepare_protocol_setup_types() < 0)
+ (pysqlite_row_setup_types(module) < 0) ||
+ (pysqlite_cursor_setup_types(module) < 0) ||
+ (pysqlite_connection_setup_types(module) < 0) ||
+ (pysqlite_cache_setup_types(module) < 0) ||
+ (pysqlite_statement_setup_types(module) < 0) ||
+ (pysqlite_prepare_protocol_setup_types(module) < 0)
) {
Py_XDECREF(module);
return NULL;
}
- ADD_TYPE(module, pysqlite_ConnectionType);
- ADD_TYPE(module, pysqlite_CursorType);
- ADD_TYPE(module, pysqlite_PrepareProtocolType);
- ADD_TYPE(module, pysqlite_RowType);
-
- if (!(dict = PyModule_GetDict(module))) {
- goto error;
- }
+ ADD_TYPE(module, *pysqlite_ConnectionType);
+ ADD_TYPE(module, *pysqlite_CursorType);
+ ADD_TYPE(module, *pysqlite_PrepareProtocolType);
+ ADD_TYPE(module, *pysqlite_RowType);
/*** Create DB-API Exception hierarchy */
-
- if (!(pysqlite_Error = PyErr_NewException(MODULE_NAME ".Error", PyExc_Exception, NULL))) {
- goto error;
- }
- PyDict_SetItemString(dict, "Error", pysqlite_Error);
-
- if (!(pysqlite_Warning = PyErr_NewException(MODULE_NAME ".Warning", PyExc_Exception, NULL))) {
- goto error;
- }
- PyDict_SetItemString(dict, "Warning", pysqlite_Warning);
+ ADD_EXCEPTION(module, "Error", pysqlite_Error, PyExc_Exception);
+ ADD_EXCEPTION(module, "Warning", pysqlite_Warning, PyExc_Exception);
/* Error subclasses */
-
- if (!(pysqlite_InterfaceError = PyErr_NewException(MODULE_NAME ".InterfaceError", pysqlite_Error, NULL))) {
- goto error;
- }
- PyDict_SetItemString(dict, "InterfaceError", pysqlite_InterfaceError);
-
- if (!(pysqlite_DatabaseError = PyErr_NewException(MODULE_NAME ".DatabaseError", pysqlite_Error, NULL))) {
- goto error;
- }
- PyDict_SetItemString(dict, "DatabaseError", pysqlite_DatabaseError);
+ ADD_EXCEPTION(module, "InterfaceError", pysqlite_InterfaceError, pysqlite_Error);
+ ADD_EXCEPTION(module, "DatabaseError", pysqlite_DatabaseError, pysqlite_Error);
/* pysqlite_DatabaseError subclasses */
-
- if (!(pysqlite_InternalError = PyErr_NewException(MODULE_NAME ".InternalError", pysqlite_DatabaseError, NULL))) {
- goto error;
- }
- PyDict_SetItemString(dict, "InternalError", pysqlite_InternalError);
-
- if (!(pysqlite_OperationalError = PyErr_NewException(MODULE_NAME ".OperationalError", pysqlite_DatabaseError, NULL))) {
- goto error;
- }
- PyDict_SetItemString(dict, "OperationalError", pysqlite_OperationalError);
-
- if (!(pysqlite_ProgrammingError = PyErr_NewException(MODULE_NAME ".ProgrammingError", pysqlite_DatabaseError, NULL))) {
- goto error;
- }
- PyDict_SetItemString(dict, "ProgrammingError", pysqlite_ProgrammingError);
-
- if (!(pysqlite_IntegrityError = PyErr_NewException(MODULE_NAME ".IntegrityError", pysqlite_DatabaseError,NULL))) {
- goto error;
- }
- PyDict_SetItemString(dict, "IntegrityError", pysqlite_IntegrityError);
-
- if (!(pysqlite_DataError = PyErr_NewException(MODULE_NAME ".DataError", pysqlite_DatabaseError, NULL))) {
- goto error;
- }
- PyDict_SetItemString(dict, "DataError", pysqlite_DataError);
-
- if (!(pysqlite_NotSupportedError = PyErr_NewException(MODULE_NAME ".NotSupportedError", pysqlite_DatabaseError, NULL))) {
- goto error;
- }
- PyDict_SetItemString(dict, "NotSupportedError", pysqlite_NotSupportedError);
+ ADD_EXCEPTION(module, "InternalError", pysqlite_InternalError, pysqlite_DatabaseError);
+ ADD_EXCEPTION(module, "OperationalError", pysqlite_OperationalError, pysqlite_DatabaseError);
+ ADD_EXCEPTION(module, "ProgrammingError", pysqlite_ProgrammingError, pysqlite_DatabaseError);
+ ADD_EXCEPTION(module, "IntegrityError", pysqlite_IntegrityError, pysqlite_DatabaseError);
+ ADD_EXCEPTION(module, "DataError", pysqlite_DataError, pysqlite_DatabaseError);
+ ADD_EXCEPTION(module, "NotSupportedError", pysqlite_NotSupportedError, pysqlite_DatabaseError);
/* In Python 2.x, setting Connection.text_factory to
OptimizedUnicode caused Unicode objects to be returned for
@@ -434,35 +396,31 @@ PyMODINIT_FUNC PyInit__sqlite3(void)
Now OptimizedUnicode is an alias for str, so it has no
effect. */
Py_INCREF((PyObject*)&PyUnicode_Type);
- PyDict_SetItemString(dict, "OptimizedUnicode", (PyObject*)&PyUnicode_Type);
+ if (PyModule_AddObject(module, "OptimizedUnicode", (PyObject*)&PyUnicode_Type) < 0) {
+ Py_DECREF((PyObject*)&PyUnicode_Type);
+ goto error;
+ }
/* Set integer constants */
- for (i = 0; _int_constants[i].constant_name != NULL; i++) {
- tmp_obj = PyLong_FromLong(_int_constants[i].constant_value);
- if (!tmp_obj) {
- goto error;
- }
- PyDict_SetItemString(dict, _int_constants[i].constant_name, tmp_obj);
- Py_DECREF(tmp_obj);
+ if (add_integer_constants(module) < 0) {
+ goto error;
}
- if (!(tmp_obj = PyUnicode_FromString(PYSQLITE_VERSION))) {
+ if (PyModule_AddStringConstant(module, "version", PYSQLITE_VERSION) < 0) {
goto error;
}
- PyDict_SetItemString(dict, "version", tmp_obj);
- Py_DECREF(tmp_obj);
- if (!(tmp_obj = PyUnicode_FromString(sqlite3_libversion()))) {
+ if (PyModule_AddStringConstant(module, "sqlite_version", sqlite3_libversion())) {
goto error;
}
- PyDict_SetItemString(dict, "sqlite_version", tmp_obj);
- Py_DECREF(tmp_obj);
/* initialize microprotocols layer */
- pysqlite_microprotocols_init(dict);
+ if (pysqlite_microprotocols_init(module) < 0) {
+ goto error;
+ }
/* initialize the default converters */
- converters_init(dict);
+ converters_init(module);
error:
if (PyErr_Occurred())
diff --git a/Modules/_sqlite/prepare_protocol.c b/Modules/_sqlite/prepare_protocol.c
index 05a2ca5a65..089d66b981 100644
--- a/Modules/_sqlite/prepare_protocol.c
+++ b/Modules/_sqlite/prepare_protocol.c
@@ -30,54 +30,33 @@ int pysqlite_prepare_protocol_init(pysqlite_PrepareProtocol* self, PyObject* arg
void pysqlite_prepare_protocol_dealloc(pysqlite_PrepareProtocol* self)
{
- Py_TYPE(self)->tp_free((PyObject*)self);
+ PyTypeObject *tp = Py_TYPE(self);
+
+ tp->tp_free(self);
+ Py_DECREF(tp);
}
-PyTypeObject pysqlite_PrepareProtocolType= {
- PyVarObject_HEAD_INIT(NULL, 0)
- MODULE_NAME ".PrepareProtocol", /* tp_name */
- sizeof(pysqlite_PrepareProtocol), /* tp_basicsize */
- 0, /* tp_itemsize */
- (destructor)pysqlite_prepare_protocol_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT, /* tp_flags */
- 0, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- 0, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)pysqlite_prepare_protocol_init, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0 /* tp_free */
+static PyType_Slot type_slots[] = {
+ {Py_tp_dealloc, pysqlite_prepare_protocol_dealloc},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_init, pysqlite_prepare_protocol_init},
+ {0, NULL},
+};
+
+static PyType_Spec type_spec = {
+ .name = MODULE_NAME ".PrepareProtocol",
+ .basicsize = sizeof(pysqlite_PrepareProtocol),
+ .flags = Py_TPFLAGS_DEFAULT,
+ .slots = type_slots,
};
-extern int pysqlite_prepare_protocol_setup_types(void)
+PyTypeObject *pysqlite_PrepareProtocolType = NULL;
+
+extern int pysqlite_prepare_protocol_setup_types(PyObject *module)
{
- pysqlite_PrepareProtocolType.tp_new = PyType_GenericNew;
- Py_SET_TYPE(&pysqlite_PrepareProtocolType, &PyType_Type);
- return PyType_Ready(&pysqlite_PrepareProtocolType);
+ pysqlite_PrepareProtocolType = (PyTypeObject *)PyType_FromModuleAndSpec(module, &type_spec, NULL);
+ if (pysqlite_PrepareProtocolType == NULL) {
+ return -1;
+ }
+ return 0;
}
diff --git a/Modules/_sqlite/prepare_protocol.h b/Modules/_sqlite/prepare_protocol.h
index 3998a55e51..d0f717c754 100644
--- a/Modules/_sqlite/prepare_protocol.h
+++ b/Modules/_sqlite/prepare_protocol.h
@@ -31,12 +31,12 @@ typedef struct
PyObject_HEAD
} pysqlite_PrepareProtocol;
-extern PyTypeObject pysqlite_PrepareProtocolType;
+extern PyTypeObject *pysqlite_PrepareProtocolType;
int pysqlite_prepare_protocol_init(pysqlite_PrepareProtocol* self, PyObject* args, PyObject* kwargs);
void pysqlite_prepare_protocol_dealloc(pysqlite_PrepareProtocol* self);
-int pysqlite_prepare_protocol_setup_types(void);
+int pysqlite_prepare_protocol_setup_types(PyObject *module);
#define UNKNOWN (-1)
#endif
diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c
index 4b47108278..76b6f04f0c 100644
--- a/Modules/_sqlite/row.c
+++ b/Modules/_sqlite/row.c
@@ -26,10 +26,13 @@
void pysqlite_row_dealloc(pysqlite_Row* self)
{
+ PyTypeObject *tp = Py_TYPE(self);
+
Py_XDECREF(self->data);
Py_XDECREF(self->description);
- Py_TYPE(self)->tp_free((PyObject*)self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
}
static PyObject *
@@ -46,7 +49,7 @@ pysqlite_row_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
if (!PyArg_ParseTuple(args, "OO", &cursor, &data))
return NULL;
- if (!PyObject_TypeCheck((PyObject*)cursor, &pysqlite_CursorType)) {
+ if (!PyObject_TypeCheck((PyObject*)cursor, pysqlite_CursorType)) {
PyErr_SetString(PyExc_TypeError, "instance of cursor required for first argument");
return NULL;
}
@@ -192,7 +195,7 @@ static PyObject* pysqlite_row_richcompare(pysqlite_Row *self, PyObject *_other,
if (opid != Py_EQ && opid != Py_NE)
Py_RETURN_NOTIMPLEMENTED;
- if (PyObject_TypeCheck(_other, &pysqlite_RowType)) {
+ if (PyObject_TypeCheck(_other, pysqlite_RowType)) {
pysqlite_Row *other = (pysqlite_Row *)_other;
int eq = PyObject_RichCompareBool(self->description, other->description, Py_EQ);
if (eq < 0) {
@@ -206,73 +209,40 @@ static PyObject* pysqlite_row_richcompare(pysqlite_Row *self, PyObject *_other,
Py_RETURN_NOTIMPLEMENTED;
}
-PyMappingMethods pysqlite_row_as_mapping = {
- /* mp_length */ (lenfunc)pysqlite_row_length,
- /* mp_subscript */ (binaryfunc)pysqlite_row_subscript,
- /* mp_ass_subscript */ (objobjargproc)0,
-};
-
-static PySequenceMethods pysqlite_row_as_sequence = {
- /* sq_length */ (lenfunc)pysqlite_row_length,
- /* sq_concat */ 0,
- /* sq_repeat */ 0,
- /* sq_item */ (ssizeargfunc)pysqlite_row_item,
-};
-
-
-static PyMethodDef pysqlite_row_methods[] = {
+static PyMethodDef row_methods[] = {
{"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS,
PyDoc_STR("Returns the keys of the row.")},
{NULL, NULL}
};
+static PyType_Slot row_slots[] = {
+ {Py_tp_dealloc, pysqlite_row_dealloc},
+ {Py_tp_hash, pysqlite_row_hash},
+ {Py_tp_methods, row_methods},
+ {Py_tp_richcompare, pysqlite_row_richcompare},
+ {Py_tp_iter, pysqlite_iter},
+ {Py_mp_length, pysqlite_row_length},
+ {Py_mp_subscript, pysqlite_row_subscript},
+ {Py_sq_length, pysqlite_row_length},
+ {Py_sq_item, pysqlite_row_item},
+ {Py_tp_new, pysqlite_row_new},
+ {0, NULL},
+};
-PyTypeObject pysqlite_RowType = {
- PyVarObject_HEAD_INIT(NULL, 0)
- MODULE_NAME ".Row", /* tp_name */
- sizeof(pysqlite_Row), /* tp_basicsize */
- 0, /* tp_itemsize */
- (destructor)pysqlite_row_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- (hashfunc)pysqlite_row_hash, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- 0, /* tp_doc */
- (traverseproc)0, /* tp_traverse */
- 0, /* tp_clear */
- (richcmpfunc)pysqlite_row_richcompare, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
- (getiterfunc)pysqlite_iter, /* tp_iter */
- 0, /* tp_iternext */
- pysqlite_row_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0 /* tp_free */
+static PyType_Spec row_spec = {
+ .name = MODULE_NAME ".Row",
+ .basicsize = sizeof(pysqlite_Row),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .slots = row_slots,
};
-extern int pysqlite_row_setup_types(void)
+PyTypeObject *pysqlite_RowType = NULL;
+
+extern int pysqlite_row_setup_types(PyObject *module)
{
- pysqlite_RowType.tp_new = pysqlite_row_new;
- pysqlite_RowType.tp_as_mapping = &pysqlite_row_as_mapping;
- pysqlite_RowType.tp_as_sequence = &pysqlite_row_as_sequence;
- return PyType_Ready(&pysqlite_RowType);
+ pysqlite_RowType = (PyTypeObject *)PyType_FromModuleAndSpec(module, &row_spec, NULL);
+ if (pysqlite_RowType == NULL) {
+ return -1;
+ }
+ return 0;
}
diff --git a/Modules/_sqlite/row.h b/Modules/_sqlite/row.h
index 4ad506f8dd..2dac41e89e 100644
--- a/Modules/_sqlite/row.h
+++ b/Modules/_sqlite/row.h
@@ -33,8 +33,8 @@ typedef struct _Row
PyObject* description;
} pysqlite_Row;
-extern PyTypeObject pysqlite_RowType;
+extern PyTypeObject *pysqlite_RowType;
-int pysqlite_row_setup_types(void);
+int pysqlite_row_setup_types(PyObject *module);
#endif
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index 02e47a02b7..4682d286c5 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -255,7 +255,7 @@ void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* para
if (!_need_adapt(current_param)) {
adapted = current_param;
} else {
- adapted = pysqlite_microprotocols_adapt(current_param, (PyObject*)&pysqlite_PrepareProtocolType, current_param);
+ adapted = pysqlite_microprotocols_adapt(current_param, (PyObject*)pysqlite_PrepareProtocolType, current_param);
Py_DECREF(current_param);
if (!adapted) {
return;
@@ -306,7 +306,7 @@ void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* para
if (!_need_adapt(current_param)) {
adapted = current_param;
} else {
- adapted = pysqlite_microprotocols_adapt(current_param, (PyObject*)&pysqlite_PrepareProtocolType, current_param);
+ adapted = pysqlite_microprotocols_adapt(current_param, (PyObject*)pysqlite_PrepareProtocolType, current_param);
Py_DECREF(current_param);
if (!adapted) {
return;
@@ -371,6 +371,8 @@ void pysqlite_statement_mark_dirty(pysqlite_Statement* self)
void pysqlite_statement_dealloc(pysqlite_Statement* self)
{
+ PyTypeObject *tp = Py_TYPE(self);
+
if (self->st) {
Py_BEGIN_ALLOW_THREADS
sqlite3_finalize(self->st);
@@ -385,7 +387,8 @@ void pysqlite_statement_dealloc(pysqlite_Statement* self)
PyObject_ClearWeakRefs((PyObject*)self);
}
- Py_TYPE(self)->tp_free((PyObject*)self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
}
/*
@@ -458,50 +461,30 @@ static int pysqlite_check_remaining_sql(const char* tail)
return 0;
}
-PyTypeObject pysqlite_StatementType = {
- PyVarObject_HEAD_INIT(NULL, 0)
- MODULE_NAME ".Statement", /* tp_name */
- sizeof(pysqlite_Statement), /* tp_basicsize */
- 0, /* tp_itemsize */
- (destructor)pysqlite_statement_dealloc, /* tp_dealloc */
- 0, /* tp_vectorcall_offset */
- 0, /* tp_getattr */
- 0, /* tp_setattr */
- 0, /* tp_as_async */
- 0, /* tp_repr */
- 0, /* tp_as_number */
- 0, /* tp_as_sequence */
- 0, /* tp_as_mapping */
- 0, /* tp_hash */
- 0, /* tp_call */
- 0, /* tp_str */
- 0, /* tp_getattro */
- 0, /* tp_setattro */
- 0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT, /* tp_flags */
- 0, /* tp_doc */
- 0, /* tp_traverse */
- 0, /* tp_clear */
- 0, /* tp_richcompare */
- offsetof(pysqlite_Statement, in_weakreflist), /* tp_weaklistoffset */
- 0, /* tp_iter */
- 0, /* tp_iternext */
- 0, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- (initproc)0, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0 /* tp_free */
+static PyMemberDef stmt_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(pysqlite_Statement, in_weakreflist), READONLY},
+ {NULL},
+};
+static PyType_Slot stmt_slots[] = {
+ {Py_tp_members, stmt_members},
+ {Py_tp_dealloc, pysqlite_statement_dealloc},
+ {Py_tp_new, PyType_GenericNew},
+ {0, NULL},
+};
+
+static PyType_Spec stmt_spec = {
+ .name = MODULE_NAME ".Statement",
+ .basicsize = sizeof(pysqlite_Statement),
+ .flags = Py_TPFLAGS_DEFAULT,
+ .slots = stmt_slots,
};
+PyTypeObject *pysqlite_StatementType = NULL;
-extern int pysqlite_statement_setup_types(void)
+extern int pysqlite_statement_setup_types(PyObject *module)
{
- pysqlite_StatementType.tp_new = PyType_GenericNew;
- return PyType_Ready(&pysqlite_StatementType);
+ pysqlite_StatementType = (PyTypeObject *)PyType_FromModuleAndSpec(module, &stmt_spec, NULL);
+ if (pysqlite_StatementType == NULL) {
+ return -1;
+ }
+ return 0;
}
diff --git a/Modules/_sqlite/statement.h b/Modules/_sqlite/statement.h
index 5002f02dc5..b426036002 100644
--- a/Modules/_sqlite/statement.h
+++ b/Modules/_sqlite/statement.h
@@ -43,7 +43,7 @@ typedef struct
PyObject* in_weakreflist; /* List of weak references */
} pysqlite_Statement;
-extern PyTypeObject pysqlite_StatementType;
+extern PyTypeObject *pysqlite_StatementType;
int pysqlite_statement_create(pysqlite_Statement* self, pysqlite_Connection* connection, PyObject* sql);
void pysqlite_statement_dealloc(pysqlite_Statement* self);
@@ -55,6 +55,6 @@ int pysqlite_statement_finalize(pysqlite_Statement* self);
int pysqlite_statement_reset(pysqlite_Statement* self);
void pysqlite_statement_mark_dirty(pysqlite_Statement* self);
-int pysqlite_statement_setup_types(void);
+int pysqlite_statement_setup_types(PyObject *module);
#endif
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 0e09877969..28d2c124d5 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -3888,6 +3888,25 @@ with_tp_del(PyObject *self, PyObject *args)
return obj;
}
+static PyObject *
+without_gc(PyObject *Py_UNUSED(self), PyObject *obj)
+{
+ PyTypeObject *tp = (PyTypeObject*)obj;
+ if (!PyType_Check(obj) || !PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE)) {
+ return PyErr_Format(PyExc_TypeError, "heap type expected, got %R", obj);
+ }
+ if (PyType_IS_GC(tp)) {
+ // Don't try this at home, kids:
+ tp->tp_flags -= Py_TPFLAGS_HAVE_GC;
+ tp->tp_free = PyObject_Del;
+ tp->tp_traverse = NULL;
+ tp->tp_clear = NULL;
+ }
+ assert(!PyType_IS_GC(tp));
+ Py_INCREF(obj);
+ return obj;
+}
+
static PyMethodDef ml;
static PyObject *
@@ -5028,6 +5047,7 @@ dict_get_version(PyObject *self, PyObject *args)
static PyObject *
raise_SIGINT_then_send_None(PyObject *self, PyObject *args)
{
+ _Py_IDENTIFIER(send);
PyGenObject *gen;
if (!PyArg_ParseTuple(args, "O!", &PyGen_Type, &gen))
@@ -5044,7 +5064,7 @@ raise_SIGINT_then_send_None(PyObject *self, PyObject *args)
because we check for signals before every bytecode operation.
*/
raise(SIGINT);
- return _PyGen_Send(gen, Py_None);
+ return _PyObject_CallMethodIdOneArg((PyObject *)gen, &PyId_send, Py_None);
}
@@ -5804,6 +5824,7 @@ static PyMethodDef TestMethods[] = {
{"meth_fastcall", (PyCFunction)(void(*)(void))meth_fastcall, METH_FASTCALL},
{"meth_fastcall_keywords", (PyCFunction)(void(*)(void))meth_fastcall_keywords, METH_FASTCALL|METH_KEYWORDS},
{"pynumber_tobase", pynumber_tobase, METH_VARARGS},
+ {"without_gc", without_gc, METH_O},
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index fc91622d39..04f6c243b5 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -1199,7 +1199,7 @@ tracemalloc_copy_trace(_Py_hashtable_t *traces,
trace_t *trace = (trace_t *)value;
trace_t *trace2 = raw_malloc(sizeof(trace_t));
- if (traces2 == NULL) {
+ if (trace2 == NULL) {
return -1;
}
*trace2 = *trace;
diff --git a/Modules/clinic/_codecsmodule.c.h b/Modules/clinic/_codecsmodule.c.h
index 249065c9fd..43378f94f9 100644
--- a/Modules/clinic/_codecsmodule.c.h
+++ b/Modules/clinic/_codecsmodule.c.h
@@ -15,6 +15,17 @@ PyDoc_STRVAR(_codecs_register__doc__,
#define _CODECS_REGISTER_METHODDEF \
{"register", (PyCFunction)_codecs_register, METH_O, _codecs_register__doc__},
+PyDoc_STRVAR(_codecs_unregister__doc__,
+"unregister($module, search_function, /)\n"
+"--\n"
+"\n"
+"Unregister a codec search function and clear the registry\'s cache.\n"
+"\n"
+"If the search function is not registered, do nothing.");
+
+#define _CODECS_UNREGISTER_METHODDEF \
+ {"unregister", (PyCFunction)_codecs_unregister, METH_O, _codecs_unregister__doc__},
+
PyDoc_STRVAR(_codecs_lookup__doc__,
"lookup($module, encoding, /)\n"
"--\n"
@@ -206,43 +217,6 @@ exit:
return return_value;
}
-PyDoc_STRVAR(_codecs__forget_codec__doc__,
-"_forget_codec($module, encoding, /)\n"
-"--\n"
-"\n"
-"Purge the named codec from the internal codec lookup cache");
-
-#define _CODECS__FORGET_CODEC_METHODDEF \
- {"_forget_codec", (PyCFunction)_codecs__forget_codec, METH_O, _codecs__forget_codec__doc__},
-
-static PyObject *
-_codecs__forget_codec_impl(PyObject *module, const char *encoding);
-
-static PyObject *
-_codecs__forget_codec(PyObject *module, PyObject *arg)
-{
- PyObject *return_value = NULL;
- const char *encoding;
-
- if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("_forget_codec", "argument", "str", arg);
- goto exit;
- }
- Py_ssize_t encoding_length;
- encoding = PyUnicode_AsUTF8AndSize(arg, &encoding_length);
- if (encoding == NULL) {
- goto exit;
- }
- if (strlen(encoding) != (size_t)encoding_length) {
- PyErr_SetString(PyExc_ValueError, "embedded null character");
- goto exit;
- }
- return_value = _codecs__forget_codec_impl(module, encoding);
-
-exit:
- return return_value;
-}
-
PyDoc_STRVAR(_codecs_escape_decode__doc__,
"escape_decode($module, data, errors=None, /)\n"
"--\n"
@@ -2827,4 +2801,4 @@ exit:
#ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF
#define _CODECS_CODE_PAGE_ENCODE_METHODDEF
#endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */
-/*[clinic end generated code: output=eeead01414be6e42 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=557c3b37e4c492ac input=a9049054013a1b77]*/
diff --git a/Modules/clinic/fcntlmodule.c.h b/Modules/clinic/fcntlmodule.c.h
index c6bf45fa49..adf527fd44 100644
--- a/Modules/clinic/fcntlmodule.c.h
+++ b/Modules/clinic/fcntlmodule.c.h
@@ -35,7 +35,7 @@ fcntl_fcntl(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (!_PyArg_CheckPositional("fcntl", nargs, 2, 3)) {
goto exit;
}
- if (!conv_descriptor(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
code = _PyLong_AsInt(args[1]);
@@ -105,7 +105,7 @@ fcntl_ioctl(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (!_PyArg_CheckPositional("ioctl", nargs, 2, 4)) {
goto exit;
}
- if (!conv_descriptor(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
code = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
@@ -155,7 +155,7 @@ fcntl_flock(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (!_PyArg_CheckPositional("flock", nargs, 2, 2)) {
goto exit;
}
- if (!conv_descriptor(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
code = _PyLong_AsInt(args[1]);
@@ -215,7 +215,7 @@ fcntl_lockf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (!_PyArg_CheckPositional("lockf", nargs, 2, 5)) {
goto exit;
}
- if (!conv_descriptor(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
code = _PyLong_AsInt(args[1]);
@@ -243,4 +243,4 @@ skip_optional:
exit:
return return_value;
}
-/*[clinic end generated code: output=91c2295402509595 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8ea34bd0f7cf25ec input=a9049054013a1b77]*/
diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
index c15def0a0f..df680d5738 100644
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -357,7 +357,7 @@ os_fchdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k
if (!args) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
return_value = os_fchdir_impl(module, fd);
@@ -727,7 +727,7 @@ os_fsync(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw
if (!args) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
return_value = os_fsync_impl(module, fd);
@@ -787,7 +787,7 @@ os_fdatasync(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
if (!args) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
return_value = os_fdatasync_impl(module, fd);
@@ -6821,7 +6821,7 @@ os_fpathconf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (!_PyArg_CheckPositional("fpathconf", nargs, 2, 2)) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
if (!conv_path_confname(args[1], &name)) {
@@ -8919,4 +8919,4 @@ exit:
#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=a0fbdea47249ee0c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=936f33448cd66ccb input=a9049054013a1b77]*/
diff --git a/Modules/clinic/selectmodule.c.h b/Modules/clinic/selectmodule.c.h
index 3a06d6d0ec..00a78c4847 100644
--- a/Modules/clinic/selectmodule.c.h
+++ b/Modules/clinic/selectmodule.c.h
@@ -92,7 +92,7 @@ select_poll_register(pollObject *self, PyObject *const *args, Py_ssize_t nargs)
if (!_PyArg_CheckPositional("register", nargs, 1, 2)) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
if (nargs < 2) {
@@ -140,7 +140,7 @@ select_poll_modify(pollObject *self, PyObject *const *args, Py_ssize_t nargs)
if (!_PyArg_CheckPositional("modify", nargs, 2, 2)) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
if (!_PyLong_UnsignedShort_Converter(args[1], &eventmask)) {
@@ -174,7 +174,7 @@ select_poll_unregister(pollObject *self, PyObject *arg)
PyObject *return_value = NULL;
int fd;
- if (!fildes_converter(arg, &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(arg, &fd)) {
goto exit;
}
return_value = select_poll_unregister_impl(self, fd);
@@ -256,7 +256,7 @@ select_devpoll_register(devpollObject *self, PyObject *const *args, Py_ssize_t n
if (!_PyArg_CheckPositional("register", nargs, 1, 2)) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
if (nargs < 2) {
@@ -306,7 +306,7 @@ select_devpoll_modify(devpollObject *self, PyObject *const *args, Py_ssize_t nar
if (!_PyArg_CheckPositional("modify", nargs, 1, 2)) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
if (nargs < 2) {
@@ -344,7 +344,7 @@ select_devpoll_unregister(devpollObject *self, PyObject *arg)
PyObject *return_value = NULL;
int fd;
- if (!fildes_converter(arg, &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(arg, &fd)) {
goto exit;
}
return_value = select_devpoll_unregister_impl(self, fd);
@@ -668,7 +668,7 @@ select_epoll_register(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t na
if (!args) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
if (!noptargs) {
@@ -721,7 +721,7 @@ select_epoll_modify(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t narg
if (!args) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
eventmask = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
@@ -766,7 +766,7 @@ select_epoll_unregister(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t
if (!args) {
goto exit;
}
- if (!fildes_converter(args[0], &fd)) {
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
goto exit;
}
return_value = select_epoll_unregister_impl(self, fd);
@@ -1179,4 +1179,4 @@ exit:
#ifndef SELECT_KQUEUE_CONTROL_METHODDEF
#define SELECT_KQUEUE_CONTROL_METHODDEF
#endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */
-/*[clinic end generated code: output=7144233c42e18279 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=162f4f4efa850416 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/termios.c.h b/Modules/clinic/termios.c.h
new file mode 100644
index 0000000000..a45c1f6426
--- /dev/null
+++ b/Modules/clinic/termios.c.h
@@ -0,0 +1,225 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(termios_tcgetattr__doc__,
+"tcgetattr($module, fd, /)\n"
+"--\n"
+"\n"
+"Get the tty attributes for file descriptor fd.\n"
+"\n"
+"Returns a list [iflag, oflag, cflag, lflag, ispeed, ospeed, cc]\n"
+"where cc is a list of the tty special characters (each a string of\n"
+"length 1, except the items with indices VMIN and VTIME, which are\n"
+"integers when these fields are defined). The interpretation of the\n"
+"flags and the speeds as well as the indexing in the cc array must be\n"
+"done using the symbolic constants defined in this module.");
+
+#define TERMIOS_TCGETATTR_METHODDEF \
+ {"tcgetattr", (PyCFunction)termios_tcgetattr, METH_O, termios_tcgetattr__doc__},
+
+static PyObject *
+termios_tcgetattr_impl(PyObject *module, int fd);
+
+static PyObject *
+termios_tcgetattr(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ if (!_PyLong_FileDescriptor_Converter(arg, &fd)) {
+ goto exit;
+ }
+ return_value = termios_tcgetattr_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcsetattr__doc__,
+"tcsetattr($module, fd, when, attributes, /)\n"
+"--\n"
+"\n"
+"Set the tty attributes for file descriptor fd.\n"
+"\n"
+"The attributes to be set are taken from the attributes argument, which\n"
+"is a list like the one returned by tcgetattr(). The when argument\n"
+"determines when the attributes are changed: termios.TCSANOW to\n"
+"change immediately, termios.TCSADRAIN to change after transmitting all\n"
+"queued output, or termios.TCSAFLUSH to change after transmitting all\n"
+"queued output and discarding all queued input.");
+
+#define TERMIOS_TCSETATTR_METHODDEF \
+ {"tcsetattr", (PyCFunction)(void(*)(void))termios_tcsetattr, METH_FASTCALL, termios_tcsetattr__doc__},
+
+static PyObject *
+termios_tcsetattr_impl(PyObject *module, int fd, int when, PyObject *term);
+
+static PyObject *
+termios_tcsetattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int when;
+ PyObject *term;
+
+ if (!_PyArg_CheckPositional("tcsetattr", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ when = _PyLong_AsInt(args[1]);
+ if (when == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ term = args[2];
+ return_value = termios_tcsetattr_impl(module, fd, when, term);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcsendbreak__doc__,
+"tcsendbreak($module, fd, duration, /)\n"
+"--\n"
+"\n"
+"Send a break on file descriptor fd.\n"
+"\n"
+"A zero duration sends a break for 0.25-0.5 seconds; a nonzero duration\n"
+"has a system dependent meaning.");
+
+#define TERMIOS_TCSENDBREAK_METHODDEF \
+ {"tcsendbreak", (PyCFunction)(void(*)(void))termios_tcsendbreak, METH_FASTCALL, termios_tcsendbreak__doc__},
+
+static PyObject *
+termios_tcsendbreak_impl(PyObject *module, int fd, int duration);
+
+static PyObject *
+termios_tcsendbreak(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int duration;
+
+ if (!_PyArg_CheckPositional("tcsendbreak", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ duration = _PyLong_AsInt(args[1]);
+ if (duration == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = termios_tcsendbreak_impl(module, fd, duration);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcdrain__doc__,
+"tcdrain($module, fd, /)\n"
+"--\n"
+"\n"
+"Wait until all output written to file descriptor fd has been transmitted.");
+
+#define TERMIOS_TCDRAIN_METHODDEF \
+ {"tcdrain", (PyCFunction)termios_tcdrain, METH_O, termios_tcdrain__doc__},
+
+static PyObject *
+termios_tcdrain_impl(PyObject *module, int fd);
+
+static PyObject *
+termios_tcdrain(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ if (!_PyLong_FileDescriptor_Converter(arg, &fd)) {
+ goto exit;
+ }
+ return_value = termios_tcdrain_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcflush__doc__,
+"tcflush($module, fd, queue, /)\n"
+"--\n"
+"\n"
+"Discard queued data on file descriptor fd.\n"
+"\n"
+"The queue selector specifies which queue: termios.TCIFLUSH for the input\n"
+"queue, termios.TCOFLUSH for the output queue, or termios.TCIOFLUSH for\n"
+"both queues.");
+
+#define TERMIOS_TCFLUSH_METHODDEF \
+ {"tcflush", (PyCFunction)(void(*)(void))termios_tcflush, METH_FASTCALL, termios_tcflush__doc__},
+
+static PyObject *
+termios_tcflush_impl(PyObject *module, int fd, int queue);
+
+static PyObject *
+termios_tcflush(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int queue;
+
+ if (!_PyArg_CheckPositional("tcflush", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ queue = _PyLong_AsInt(args[1]);
+ if (queue == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = termios_tcflush_impl(module, fd, queue);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcflow__doc__,
+"tcflow($module, fd, action, /)\n"
+"--\n"
+"\n"
+"Suspend or resume input or output on file descriptor fd.\n"
+"\n"
+"The action argument can be termios.TCOOFF to suspend output,\n"
+"termios.TCOON to restart output, termios.TCIOFF to suspend input,\n"
+"or termios.TCION to restart input.");
+
+#define TERMIOS_TCFLOW_METHODDEF \
+ {"tcflow", (PyCFunction)(void(*)(void))termios_tcflow, METH_FASTCALL, termios_tcflow__doc__},
+
+static PyObject *
+termios_tcflow_impl(PyObject *module, int fd, int action);
+
+static PyObject *
+termios_tcflow(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int action;
+
+ if (!_PyArg_CheckPositional("tcflow", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ action = _PyLong_AsInt(args[1]);
+ if (action == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = termios_tcflow_impl(module, fd, action);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=a129179f1e2545cc input=a9049054013a1b77]*/
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index 39baea01ec..afd28106fa 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -20,24 +20,12 @@ module fcntl
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=124b58387c158179]*/
-static int
-conv_descriptor(PyObject *object, int *target)
-{
- int fd = PyObject_AsFileDescriptor(object);
-
- if (fd < 0)
- return 0;
- *target = fd;
- return 1;
-}
-
-/* Must come after conv_descriptor definition. */
#include "clinic/fcntlmodule.c.h"
/*[clinic input]
fcntl.fcntl
- fd: object(type='int', converter='conv_descriptor')
+ fd: fildes
cmd as code: int
arg: object(c_default='NULL') = 0
/
@@ -57,7 +45,7 @@ corresponding to the return value of the fcntl call in the C code.
static PyObject *
fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg)
-/*[clinic end generated code: output=888fc93b51c295bd input=8cefbe59b29efbe2]*/
+/*[clinic end generated code: output=888fc93b51c295bd input=7955340198e5f334]*/
{
unsigned int int_arg = 0;
int ret;
@@ -116,7 +104,7 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg)
/*[clinic input]
fcntl.ioctl
- fd: object(type='int', converter='conv_descriptor')
+ fd: fildes
request as code: unsigned_int(bitwise=True)
arg as ob_arg: object(c_default='NULL') = 0
mutate_flag as mutate_arg: bool = True
@@ -155,7 +143,7 @@ code.
static PyObject *
fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
PyObject *ob_arg, int mutate_arg)
-/*[clinic end generated code: output=7f7f5840c65991be input=ede70c433cccbbb2]*/
+/*[clinic end generated code: output=7f7f5840c65991be input=967b4a4cbeceb0a8]*/
{
#define IOCTL_BUFSZ 1024
/* We use the unsigned non-checked 'I' format for the 'code' parameter
@@ -280,7 +268,7 @@ fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
/*[clinic input]
fcntl.flock
- fd: object(type='int', converter='conv_descriptor')
+ fd: fildes
operation as code: int
/
@@ -292,7 +280,7 @@ function is emulated using fcntl()).
static PyObject *
fcntl_flock_impl(PyObject *module, int fd, int code)
-/*[clinic end generated code: output=84059e2b37d2fc64 input=b70a0a41ca22a8a0]*/
+/*[clinic end generated code: output=84059e2b37d2fc64 input=0bfc00f795953452]*/
{
int ret;
int async_err = 0;
@@ -346,7 +334,7 @@ fcntl_flock_impl(PyObject *module, int fd, int code)
/*[clinic input]
fcntl.lockf
- fd: object(type='int', converter='conv_descriptor')
+ fd: fildes
cmd as code: int
len as lenobj: object(c_default='NULL') = 0
start as startobj: object(c_default='NULL') = 0
@@ -380,7 +368,7 @@ starts. `whence` is as with fileobj.seek(), specifically:
static PyObject *
fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj,
PyObject *startobj, int whence)
-/*[clinic end generated code: output=4985e7a172e7461a input=3a5dc01b04371f1a]*/
+/*[clinic end generated code: output=4985e7a172e7461a input=5480479fc63a04b8]*/
{
int ret;
int async_err = 0;
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 5cd31b7dd4..45b0302875 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -2494,7 +2494,7 @@ References:
3. Square root differential correction: https://arxiv.org/pdf/1904.09481.pdf
4. Data dependency graph: https://bugs.python.org/file49439/hypot.png
5. https://www.wolframalpha.com/input/?i=Maclaurin+series+sqrt%28h**2+%2B+x%29+at+x%3D0
-6. Analysis of internal accuracy: https://bugs.python.org/file49435/best_frac.py
+6. Analysis of internal accuracy: https://bugs.python.org/file49484/best_frac.py
7. Commutativity test: https://bugs.python.org/file49448/test_hypot_commutativity.py
*/
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 7c496938ed..6ce0bcb9fe 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -22,6 +22,7 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#include "pycore_fileutils.h"
#ifdef MS_WINDOWS
/* include <windows.h> early to avoid conflict with pycore_condvar.h:
@@ -1634,18 +1635,6 @@ path_error2(path_t *path, path_t *path2)
/* POSIX generic methods */
-static int
-fildes_converter(PyObject *o, void *p)
-{
- int fd;
- int *pointer = (int *)p;
- fd = PyObject_AsFileDescriptor(o);
- if (fd < 0)
- return 0;
- *pointer = fd;
- return 1;
-}
-
static PyObject *
posix_fildes_fd(int fd, int (*func)(int))
{
@@ -2642,10 +2631,6 @@ class dir_fd_converter(CConverter):
else:
self.converter = 'dir_fd_converter'
-class fildes_converter(CConverter):
- type = 'int'
- converter = 'fildes_converter'
-
class uid_t_converter(CConverter):
type = "uid_t"
converter = '_Py_Uid_Converter'
@@ -2708,7 +2693,7 @@ class sysconf_confname_converter(path_confname_converter):
converter="conv_sysconf_confname"
[python start generated code]*/
-/*[python end generated code: output=da39a3ee5e6b4b0d input=f1c8ae8d744f6c8b]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=3338733161aa7879]*/
/*[clinic input]
@@ -8756,25 +8741,6 @@ os_close_impl(PyObject *module, int fd)
Py_RETURN_NONE;
}
-
-#ifdef HAVE_FDWALK
-static int
-_fdwalk_close_func(void *lohi, int fd)
-{
- int lo = ((int *)lohi)[0];
- int hi = ((int *)lohi)[1];
-
- if (fd >= hi) {
- return 1;
- }
- else if (fd >= lo) {
- /* Ignore errors */
- (void)close(fd);
- }
- return 0;
-}
-#endif /* HAVE_FDWALK */
-
/*[clinic input]
os.closerange
@@ -8789,32 +8755,8 @@ static PyObject *
os_closerange_impl(PyObject *module, int fd_low, int fd_high)
/*[clinic end generated code: output=0ce5c20fcda681c2 input=5855a3d053ebd4ec]*/
{
-#ifdef HAVE_FDWALK
- int lohi[2];
-#endif
Py_BEGIN_ALLOW_THREADS
- _Py_BEGIN_SUPPRESS_IPH
-#ifdef HAVE_FDWALK
- lohi[0] = Py_MAX(fd_low, 0);
- lohi[1] = fd_high;
- fdwalk(_fdwalk_close_func, lohi);
-#else
- fd_low = Py_MAX(fd_low, 0);
-#ifdef __FreeBSD__
- if (fd_high >= sysconf(_SC_OPEN_MAX)) {
- /* Any errors encountered while closing file descriptors are ignored */
- closefrom(fd_low);
- }
- else
-#endif
- {
- for (int i = fd_low; i < fd_high; i++) {
- /* Ignore errors */
- (void)close(i);
- }
- }
-#endif
- _Py_END_SUPPRESS_IPH
+ _Py_closerange(fd_low, fd_high - 1);
Py_END_ALLOW_THREADS
Py_RETURN_NONE;
}
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 13ffe09c6d..fe852f93c3 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -88,25 +88,6 @@ class select.kqueue "kqueue_queue_Object *" "_selectstate_global->kqueue_queue_T
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=41071028e0ede093]*/
-static int
-fildes_converter(PyObject *o, void *p)
-{
- int fd;
- int *pointer = (int *)p;
- fd = PyObject_AsFileDescriptor(o);
- if (fd == -1)
- return 0;
- *pointer = fd;
- return 1;
-}
-
-/*[python input]
-class fildes_converter(CConverter):
- type = 'int'
- converter = 'fildes_converter'
-[python start generated code]*/
-/*[python end generated code: output=da39a3ee5e6b4b0d input=ca54eb5aa476e20a]*/
-
/* list of Python objects and their file descriptor */
typedef struct {
PyObject *obj; /* owned reference */
diff --git a/Modules/termios.c b/Modules/termios.c
index cc0d5853f8..a6649598ec 100644
--- a/Modules/termios.c
+++ b/Modules/termios.c
@@ -29,6 +29,13 @@
#include <sys/bsdtty.h>
#endif
+/*[clinic input]
+module termios
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=01105c85d0ca7252]*/
+
+#include "clinic/termios.c.h"
+
PyDoc_STRVAR(termios__doc__,
"This module provides an interface to the Posix calls for tty I/O control.\n\
For a complete description of these calls, see the Posix or Unix manual\n\
@@ -51,40 +58,28 @@ get_termios_state(PyObject *module)
return (termiosmodulestate *)state;
}
-static int fdconv(PyObject* obj, void* p)
-{
- int fd;
+static struct PyModuleDef termiosmodule;
- fd = PyObject_AsFileDescriptor(obj);
- if (fd >= 0) {
- *(int*)p = fd;
- return 1;
- }
- return 0;
-}
+/*[clinic input]
+termios.tcgetattr
-static struct PyModuleDef termiosmodule;
+ fd: fildes
+ /
-PyDoc_STRVAR(termios_tcgetattr__doc__,
-"tcgetattr(fd) -> list_of_attrs\n\
-\n\
-Get the tty attributes for file descriptor fd, as follows:\n\
-[iflag, oflag, cflag, lflag, ispeed, ospeed, cc] where cc is a list\n\
-of the tty special characters (each a string of length 1, except the items\n\
-with indices VMIN and VTIME, which are integers when these fields are\n\
-defined). The interpretation of the flags and the speeds as well as the\n\
-indexing in the cc array must be done using the symbolic constants defined\n\
-in this module.");
+Get the tty attributes for file descriptor fd.
+
+Returns a list [iflag, oflag, cflag, lflag, ispeed, ospeed, cc]
+where cc is a list of the tty special characters (each a string of
+length 1, except the items with indices VMIN and VTIME, which are
+integers when these fields are defined). The interpretation of the
+flags and the speeds as well as the indexing in the cc array must be
+done using the symbolic constants defined in this module.
+[clinic start generated code]*/
static PyObject *
-termios_tcgetattr(PyObject *module, PyObject *args)
+termios_tcgetattr_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=2b3da39db870e629 input=54dad9779ebe74b1]*/
{
- int fd;
- if (!PyArg_ParseTuple(args, "O&:tcgetattr",
- fdconv, (void*)&fd)) {
- return NULL;
- }
-
termiosmodulestate *state = PyModule_GetState(module);
struct termios mode;
if (tcgetattr(fd, &mode) == -1) {
@@ -143,27 +138,28 @@ termios_tcgetattr(PyObject *module, PyObject *args)
return NULL;
}
-PyDoc_STRVAR(termios_tcsetattr__doc__,
-"tcsetattr(fd, when, attributes) -> None\n\
-\n\
-Set the tty attributes for file descriptor fd.\n\
-The attributes to be set are taken from the attributes argument, which\n\
-is a list like the one returned by tcgetattr(). The when argument\n\
-determines when the attributes are changed: termios.TCSANOW to\n\
-change immediately, termios.TCSADRAIN to change after transmitting all\n\
-queued output, or termios.TCSAFLUSH to change after transmitting all\n\
-queued output and discarding all queued input. ");
+/*[clinic input]
+termios.tcsetattr
+
+ fd: fildes
+ when: int
+ attributes as term: object
+ /
+
+Set the tty attributes for file descriptor fd.
+
+The attributes to be set are taken from the attributes argument, which
+is a list like the one returned by tcgetattr(). The when argument
+determines when the attributes are changed: termios.TCSANOW to
+change immediately, termios.TCSADRAIN to change after transmitting all
+queued output, or termios.TCSAFLUSH to change after transmitting all
+queued output and discarding all queued input.
+[clinic start generated code]*/
static PyObject *
-termios_tcsetattr(PyObject *module, PyObject *args)
+termios_tcsetattr_impl(PyObject *module, int fd, int when, PyObject *term)
+/*[clinic end generated code: output=bcd2b0a7b98a4bf5 input=5dafabdd5a08f018]*/
{
- int fd, when;
- PyObject *term;
- if (!PyArg_ParseTuple(args, "O&iO:tcsetattr",
- fdconv, &fd, &when, &term)) {
- return NULL;
- }
-
if (!PyList_Check(term) || PyList_Size(term) != 7) {
PyErr_SetString(PyExc_TypeError,
"tcsetattr, arg 3: must be 7 element list");
@@ -221,22 +217,23 @@ termios_tcsetattr(PyObject *module, PyObject *args)
Py_RETURN_NONE;
}
-PyDoc_STRVAR(termios_tcsendbreak__doc__,
-"tcsendbreak(fd, duration) -> None\n\
-\n\
-Send a break on file descriptor fd.\n\
-A zero duration sends a break for 0.25-0.5 seconds; a nonzero duration\n\
-has a system dependent meaning.");
+/*[clinic input]
+termios.tcsendbreak
+
+ fd: fildes
+ duration: int
+ /
+
+Send a break on file descriptor fd.
+
+A zero duration sends a break for 0.25-0.5 seconds; a nonzero duration
+has a system dependent meaning.
+[clinic start generated code]*/
static PyObject *
-termios_tcsendbreak(PyObject *module, PyObject *args)
+termios_tcsendbreak_impl(PyObject *module, int fd, int duration)
+/*[clinic end generated code: output=5945f589b5d3ac66 input=dc2f32417691f8ed]*/
{
- int fd, duration;
- if (!PyArg_ParseTuple(args, "O&i:tcsendbreak",
- fdconv, &fd, &duration)) {
- return NULL;
- }
-
termiosmodulestate *state = PyModule_GetState(module);
if (tcsendbreak(fd, duration) == -1) {
return PyErr_SetFromErrno(state->TermiosError);
@@ -245,20 +242,19 @@ termios_tcsendbreak(PyObject *module, PyObject *args)
Py_RETURN_NONE;
}
-PyDoc_STRVAR(termios_tcdrain__doc__,
-"tcdrain(fd) -> None\n\
-\n\
-Wait until all output written to file descriptor fd has been transmitted.");
+/*[clinic input]
+termios.tcdrain
+
+ fd: fildes
+ /
+
+Wait until all output written to file descriptor fd has been transmitted.
+[clinic start generated code]*/
static PyObject *
-termios_tcdrain(PyObject *module, PyObject *args)
+termios_tcdrain_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=5fd86944c6255955 input=c99241b140b32447]*/
{
- int fd;
- if (!PyArg_ParseTuple(args, "O&:tcdrain",
- fdconv, &fd)) {
- return NULL;
- }
-
termiosmodulestate *state = PyModule_GetState(module);
if (tcdrain(fd) == -1) {
return PyErr_SetFromErrno(state->TermiosError);
@@ -267,23 +263,24 @@ termios_tcdrain(PyObject *module, PyObject *args)
Py_RETURN_NONE;
}
-PyDoc_STRVAR(termios_tcflush__doc__,
-"tcflush(fd, queue) -> None\n\
-\n\
-Discard queued data on file descriptor fd.\n\
-The queue selector specifies which queue: termios.TCIFLUSH for the input\n\
-queue, termios.TCOFLUSH for the output queue, or termios.TCIOFLUSH for\n\
-both queues. ");
+/*[clinic input]
+termios.tcflush
+
+ fd: fildes
+ queue: int
+ /
+
+Discard queued data on file descriptor fd.
+
+The queue selector specifies which queue: termios.TCIFLUSH for the input
+queue, termios.TCOFLUSH for the output queue, or termios.TCIOFLUSH for
+both queues.
+[clinic start generated code]*/
static PyObject *
-termios_tcflush(PyObject *module, PyObject *args)
+termios_tcflush_impl(PyObject *module, int fd, int queue)
+/*[clinic end generated code: output=2424f80312ec2f21 input=0f7d08122ddc07b5]*/
{
- int fd, queue;
- if (!PyArg_ParseTuple(args, "O&i:tcflush",
- fdconv, &fd, &queue)) {
- return NULL;
- }
-
termiosmodulestate *state = PyModule_GetState(module);
if (tcflush(fd, queue) == -1) {
return PyErr_SetFromErrno(state->TermiosError);
@@ -292,23 +289,24 @@ termios_tcflush(PyObject *module, PyObject *args)
Py_RETURN_NONE;
}
-PyDoc_STRVAR(termios_tcflow__doc__,
-"tcflow(fd, action) -> None\n\
-\n\
-Suspend or resume input or output on file descriptor fd.\n\
-The action argument can be termios.TCOOFF to suspend output,\n\
-termios.TCOON to restart output, termios.TCIOFF to suspend input,\n\
-or termios.TCION to restart input.");
+/*[clinic input]
+termios.tcflow
+
+ fd: fildes
+ action: int
+ /
+
+Suspend or resume input or output on file descriptor fd.
+
+The action argument can be termios.TCOOFF to suspend output,
+termios.TCOON to restart output, termios.TCIOFF to suspend input,
+or termios.TCION to restart input.
+[clinic start generated code]*/
static PyObject *
-termios_tcflow(PyObject *module, PyObject *args)
+termios_tcflow_impl(PyObject *module, int fd, int action)
+/*[clinic end generated code: output=afd10928e6ea66eb input=c6aff0640b6efd9c]*/
{
- int fd, action;
- if (!PyArg_ParseTuple(args, "O&i:tcflow",
- fdconv, &fd, &action)) {
- return NULL;
- }
-
termiosmodulestate *state = PyModule_GetState(module);
if (tcflow(fd, action) == -1) {
return PyErr_SetFromErrno(state->TermiosError);
@@ -319,18 +317,12 @@ termios_tcflow(PyObject *module, PyObject *args)
static PyMethodDef termios_methods[] =
{
- {"tcgetattr", termios_tcgetattr,
- METH_VARARGS, termios_tcgetattr__doc__},
- {"tcsetattr", termios_tcsetattr,
- METH_VARARGS, termios_tcsetattr__doc__},
- {"tcsendbreak", termios_tcsendbreak,
- METH_VARARGS, termios_tcsendbreak__doc__},
- {"tcdrain", termios_tcdrain,
- METH_VARARGS, termios_tcdrain__doc__},
- {"tcflush", termios_tcflush,
- METH_VARARGS, termios_tcflush__doc__},
- {"tcflow", termios_tcflow,
- METH_VARARGS, termios_tcflow__doc__},
+ TERMIOS_TCGETATTR_METHODDEF
+ TERMIOS_TCSETATTR_METHODDEF
+ TERMIOS_TCSENDBREAK_METHODDEF
+ TERMIOS_TCDRAIN_METHODDEF
+ TERMIOS_TCFLUSH_METHODDEF
+ TERMIOS_TCFLOW_METHODDEF
{NULL, NULL}
};
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 8e11cfc4da..941fd2faa7 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -93,22 +93,33 @@ static PyMemberDef DB_members[] = {
/* forward declaration */
static PyTypeObject UCD_Type;
-// Check if self is an instance of UCD_Type.
+typedef struct {
+ // Borrowed reference to &UCD_Type. It is used to prepare the code
+ // to convert the UCD_Type static type to a heap type.
+ PyTypeObject *ucd_type;
+} unicodedata_module_state;
+
+// bpo-1635741: Temporary global state until the unicodedata module
+// gets a real module state.
+static unicodedata_module_state global_module_state;
+
+// Check if self is an instance of ucd_type.
// Return 0 if self is NULL (when the PyCapsule C API is used).
#define UCD_Check(self, ucd_type) (self != NULL && Py_IS_TYPE(self, ucd_type))
static PyObject*
-new_previous_version(const char*name, const change_record* (*getrecord)(Py_UCS4),
+new_previous_version(unicodedata_module_state *state,
+ const char*name, const change_record* (*getrecord)(Py_UCS4),
Py_UCS4 (*normalization)(Py_UCS4))
{
- PreviousDBVersion *self;
- self = PyObject_New(PreviousDBVersion, &UCD_Type);
- if (self == NULL)
- return NULL;
- self->name = name;
- self->getrecord = getrecord;
- self->normalization = normalization;
- return (PyObject*)self;
+ PreviousDBVersion *self;
+ self = PyObject_New(PreviousDBVersion, state->ucd_type);
+ if (self == NULL)
+ return NULL;
+ self->name = name;
+ self->getrecord = getrecord;
+ self->normalization = normalization;
+ return (PyObject*)self;
}
@@ -134,11 +145,12 @@ unicodedata_UCD_decimal_impl(PyObject *self, int chr,
PyObject *default_value)
/*[clinic end generated code: output=be23376e1a185231 input=933f8107993f23d0]*/
{
+ unicodedata_module_state *state = &global_module_state;
int have_old = 0;
long rc;
Py_UCS4 c = (Py_UCS4)chr;
- if (UCD_Check(self, &UCD_Type)) {
+ if (UCD_Check(self, state->ucd_type)) {
const change_record *old = get_old_record(self, c);
if (old->category_changed == 0) {
/* unassigned */
@@ -222,11 +234,12 @@ unicodedata_UCD_numeric_impl(PyObject *self, int chr,
PyObject *default_value)
/*[clinic end generated code: output=53ce281fe85b10c4 input=fdf5871a5542893c]*/
{
+ unicodedata_module_state *state = &global_module_state;
int have_old = 0;
double rc;
Py_UCS4 c = (Py_UCS4)chr;
- if (UCD_Check(self, &UCD_Type)) {
+ if (UCD_Check(self, state->ucd_type)) {
const change_record *old = get_old_record(self, c);
if (old->category_changed == 0) {
/* unassigned */
@@ -268,10 +281,11 @@ static PyObject *
unicodedata_UCD_category_impl(PyObject *self, int chr)
/*[clinic end generated code: output=8571539ee2e6783a input=27d6f3d85050bc06]*/
{
+ unicodedata_module_state *state = &global_module_state;
int index;
Py_UCS4 c = (Py_UCS4)chr;
index = (int) _getrecord_ex(c)->category;
- if (UCD_Check(self, &UCD_Type)) {
+ if (UCD_Check(self, state->ucd_type)) {
const change_record *old = get_old_record(self, c);
if (old->category_changed != 0xFF)
index = old->category_changed;
@@ -295,10 +309,11 @@ static PyObject *
unicodedata_UCD_bidirectional_impl(PyObject *self, int chr)
/*[clinic end generated code: output=d36310ce2039bb92 input=b3d8f42cebfcf475]*/
{
+ unicodedata_module_state *state = &global_module_state;
int index;
Py_UCS4 c = (Py_UCS4)chr;
index = (int) _getrecord_ex(c)->bidirectional;
- if (UCD_Check(self, &UCD_Type)) {
+ if (UCD_Check(self, state->ucd_type)) {
const change_record *old = get_old_record(self, c);
if (old->category_changed == 0)
index = 0; /* unassigned */
@@ -324,10 +339,11 @@ static int
unicodedata_UCD_combining_impl(PyObject *self, int chr)
/*[clinic end generated code: output=cad056d0cb6a5920 input=9f2d6b2a95d0a22a]*/
{
+ unicodedata_module_state *state = &global_module_state;
int index;
Py_UCS4 c = (Py_UCS4)chr;
index = (int) _getrecord_ex(c)->combining;
- if (UCD_Check(self, &UCD_Type)) {
+ if (UCD_Check(self, state->ucd_type)) {
const change_record *old = get_old_record(self, c);
if (old->category_changed == 0)
index = 0; /* unassigned */
@@ -352,10 +368,11 @@ static int
unicodedata_UCD_mirrored_impl(PyObject *self, int chr)
/*[clinic end generated code: output=2532dbf8121b50e6 input=5dd400d351ae6f3b]*/
{
+ unicodedata_module_state *state = &global_module_state;
int index;
Py_UCS4 c = (Py_UCS4)chr;
index = (int) _getrecord_ex(c)->mirrored;
- if (UCD_Check(self, &UCD_Type)) {
+ if (UCD_Check(self, state->ucd_type)) {
const change_record *old = get_old_record(self, c);
if (old->category_changed == 0)
index = 0; /* unassigned */
@@ -379,10 +396,11 @@ static PyObject *
unicodedata_UCD_east_asian_width_impl(PyObject *self, int chr)
/*[clinic end generated code: output=484e8537d9ee8197 input=c4854798aab026e0]*/
{
+ unicodedata_module_state *state = &global_module_state;
int index;
Py_UCS4 c = (Py_UCS4)chr;
index = (int) _getrecord_ex(c)->east_asian_width;
- if (UCD_Check(self, &UCD_Type)) {
+ if (UCD_Check(self, state->ucd_type)) {
const change_record *old = get_old_record(self, c);
if (old->category_changed == 0)
index = 0; /* unassigned */
@@ -408,6 +426,7 @@ static PyObject *
unicodedata_UCD_decomposition_impl(PyObject *self, int chr)
/*[clinic end generated code: output=7d699f3ec7565d27 input=e4c12459ad68507b]*/
{
+ unicodedata_module_state *state = &global_module_state;
char decomp[256];
int code, index, count;
size_t i;
@@ -416,7 +435,7 @@ unicodedata_UCD_decomposition_impl(PyObject *self, int chr)
code = (int)c;
- if (UCD_Check(self, &UCD_Type)) {
+ if (UCD_Check(self, state->ucd_type)) {
const change_record *old = get_old_record(self, c);
if (old->category_changed == 0)
return PyUnicode_FromString(""); /* unassigned */
@@ -459,11 +478,12 @@ unicodedata_UCD_decomposition_impl(PyObject *self, int chr)
}
static void
-get_decomp_record(PyObject *self, Py_UCS4 code, int *index, int *prefix, int *count)
+get_decomp_record(unicodedata_module_state *state, PyObject *self,
+ Py_UCS4 code, int *index, int *prefix, int *count)
{
if (code >= 0x110000) {
*index = 0;
- } else if (UCD_Check(self, &UCD_Type) &&
+ } else if (UCD_Check(self, state->ucd_type) &&
get_old_record(self, code)->category_changed==0) {
/* unassigned in old version */
*index = 0;
@@ -493,7 +513,8 @@ get_decomp_record(PyObject *self, Py_UCS4 code, int *index, int *prefix, int *co
#define SCount (LCount*NCount)
static PyObject*
-nfd_nfkd(PyObject *self, PyObject *input, int k)
+nfd_nfkd(unicodedata_module_state *state, PyObject *self,
+ PyObject *input, int k)
{
PyObject *result;
Py_UCS4 *output;
@@ -561,7 +582,7 @@ nfd_nfkd(PyObject *self, PyObject *input, int k)
continue;
}
/* normalization changes */
- if (UCD_Check(self, &UCD_Type)) {
+ if (UCD_Check(self, state->ucd_type)) {
Py_UCS4 value = ((PreviousDBVersion*)self)->normalization(code);
if (value != 0) {
stack[stackptr++] = value;
@@ -570,7 +591,7 @@ nfd_nfkd(PyObject *self, PyObject *input, int k)
}
/* Other decompositions. */
- get_decomp_record(self, code, &index, &prefix, &count);
+ get_decomp_record(state, self, code, &index, &prefix, &count);
/* Copy character if it is not decomposable, or has a
compatibility decomposition, but we do NFD. */
@@ -642,7 +663,7 @@ find_nfc_index(const struct reindex* nfc, Py_UCS4 code)
}
static PyObject*
-nfc_nfkc(PyObject *self, PyObject *input, int k)
+nfc_nfkc(unicodedata_module_state *state, PyObject *self, PyObject *input, int k)
{
PyObject *result;
int kind;
@@ -654,7 +675,7 @@ nfc_nfkc(PyObject *self, PyObject *input, int k)
Py_ssize_t skipped[20];
int cskipped = 0;
- result = nfd_nfkd(self, input, k);
+ result = nfd_nfkd(state, self, input, k);
if (!result)
return NULL;
/* result will be "ready". */
@@ -797,12 +818,12 @@ typedef enum {YES = 0, MAYBE = 1, NO = 2} QuickcheckResult;
* https://www.unicode.org/reports/tr15/#Detecting_Normalization_Forms
*/
static QuickcheckResult
-is_normalized_quickcheck(PyObject *self, PyObject *input,
- bool nfc, bool k, bool yes_only)
+is_normalized_quickcheck(unicodedata_module_state *state, PyObject *self,
+ PyObject *input, bool nfc, bool k, bool yes_only)
{
/* An older version of the database is requested, quickchecks must be
disabled. */
- if (UCD_Check(self, &UCD_Type))
+ if (UCD_Check(self, state->ucd_type))
return NO;
Py_ssize_t i, len;
@@ -862,6 +883,7 @@ unicodedata_UCD_is_normalized_impl(PyObject *self, PyObject *form,
PyObject *input)
/*[clinic end generated code: output=11e5a3694e723ca5 input=a544f14cea79e508]*/
{
+ unicodedata_module_state *state = &global_module_state;
if (PyUnicode_READY(input) == -1) {
return NULL;
}
@@ -897,10 +919,10 @@ unicodedata_UCD_is_normalized_impl(PyObject *self, PyObject *form,
return NULL;
}
- m = is_normalized_quickcheck(self, input, nfc, k, false);
+ m = is_normalized_quickcheck(state, self, input, nfc, k, false);
if (m == MAYBE) {
- cmp = (nfc ? nfc_nfkc : nfd_nfkd)(self, input, k);
+ cmp = (nfc ? nfc_nfkc : nfd_nfkd)(state, self, input, k);
if (cmp == NULL) {
return NULL;
}
@@ -935,6 +957,7 @@ unicodedata_UCD_normalize_impl(PyObject *self, PyObject *form,
PyObject *input)
/*[clinic end generated code: output=05ca4385a2ad6983 input=3a5206c0ad2833fb]*/
{
+ unicodedata_module_state *state = &global_module_state;
if (PyUnicode_GET_LENGTH(input) == 0) {
/* Special case empty input strings, since resizing
them later would cause internal errors. */
@@ -943,32 +966,36 @@ unicodedata_UCD_normalize_impl(PyObject *self, PyObject *form,
}
if (_PyUnicode_EqualToASCIIId(form, &PyId_NFC)) {
- if (is_normalized_quickcheck(self, input, true, false, true) == YES) {
+ if (is_normalized_quickcheck(state, self, input,
+ true, false, true) == YES) {
Py_INCREF(input);
return input;
}
- return nfc_nfkc(self, input, 0);
+ return nfc_nfkc(state, self, input, 0);
}
if (_PyUnicode_EqualToASCIIId(form, &PyId_NFKC)) {
- if (is_normalized_quickcheck(self, input, true, true, true) == YES) {
+ if (is_normalized_quickcheck(state, self, input,
+ true, true, true) == YES) {
Py_INCREF(input);
return input;
}
- return nfc_nfkc(self, input, 1);
+ return nfc_nfkc(state, self, input, 1);
}
if (_PyUnicode_EqualToASCIIId(form, &PyId_NFD)) {
- if (is_normalized_quickcheck(self, input, false, false, true) == YES) {
+ if (is_normalized_quickcheck(state, self, input,
+ false, false, true) == YES) {
Py_INCREF(input);
return input;
}
- return nfd_nfkd(self, input, 0);
+ return nfd_nfkd(state, self, input, 0);
}
if (_PyUnicode_EqualToASCIIId(form, &PyId_NFKD)) {
- if (is_normalized_quickcheck(self, input, false, true, true) == YES) {
+ if (is_normalized_quickcheck(state, self, input,
+ false, true, true) == YES) {
Py_INCREF(input);
return input;
}
- return nfd_nfkd(self, input, 1);
+ return nfd_nfkd(state, self, input, 1);
}
PyErr_SetString(PyExc_ValueError, "invalid normalization form");
return NULL;
@@ -1051,8 +1078,8 @@ is_unified_ideograph(Py_UCS4 code)
(cp < named_sequences_end))
static int
-_getucname(PyObject *self, Py_UCS4 code, char* buffer, int buflen,
- int with_alias_and_seq)
+_getucname(unicodedata_module_state *state, PyObject *self,
+ Py_UCS4 code, char* buffer, int buflen, int with_alias_and_seq)
{
/* Find the name associated with the given code point.
* If with_alias_and_seq is 1, check for names in the Private Use Area 15
@@ -1069,7 +1096,7 @@ _getucname(PyObject *self, Py_UCS4 code, char* buffer, int buflen,
if (!with_alias_and_seq && (IS_ALIAS(code) || IS_NAMED_SEQ(code)))
return 0;
- if (UCD_Check(self, &UCD_Type)) {
+ if (UCD_Check(self, state->ucd_type)) {
/* in 3.2.0 there are no aliases and named sequences */
const change_record *old;
if (IS_ALIAS(code) || IS_NAMED_SEQ(code))
@@ -1153,12 +1180,22 @@ _getucname(PyObject *self, Py_UCS4 code, char* buffer, int buflen,
}
static int
-_cmpname(PyObject *self, int code, const char* name, int namelen)
+capi_getucname(PyObject *self, Py_UCS4 code, char* buffer, int buflen,
+ int with_alias_and_seq)
+{
+ unicodedata_module_state *state = &global_module_state;
+ return _getucname(state, self, code, buffer, buflen, with_alias_and_seq);
+
+}
+
+static int
+_cmpname(unicodedata_module_state *state, PyObject *self,
+ int code, const char* name, int namelen)
{
/* check if code corresponds to the given name */
int i;
char buffer[NAME_MAXLEN+1];
- if (!_getucname(self, code, buffer, NAME_MAXLEN, 1))
+ if (!_getucname(state, self, code, buffer, NAME_MAXLEN, 1))
return 0;
for (i = 0; i < namelen; i++) {
if (Py_TOUPPER(name[i]) != buffer[i])
@@ -1203,8 +1240,8 @@ _check_alias_and_seq(unsigned int cp, Py_UCS4* code, int with_named_seq)
}
static int
-_getcode(PyObject* self, const char* name, int namelen, Py_UCS4* code,
- int with_named_seq)
+_getcode(unicodedata_module_state *state, PyObject* self,
+ const char* name, int namelen, Py_UCS4* code, int with_named_seq)
{
/* Return the code point associated with the given name.
* Named aliases are resolved too (unless self != NULL (i.e. we are using
@@ -1265,8 +1302,9 @@ _getcode(PyObject* self, const char* name, int namelen, Py_UCS4* code,
v = code_hash[i];
if (!v)
return 0;
- if (_cmpname(self, v, name, namelen))
+ if (_cmpname(state, self, v, name, namelen)) {
return _check_alias_and_seq(v, code, with_named_seq);
+ }
incr = (h ^ (h >> 3)) & mask;
if (!incr)
incr = mask;
@@ -1275,19 +1313,29 @@ _getcode(PyObject* self, const char* name, int namelen, Py_UCS4* code,
v = code_hash[i];
if (!v)
return 0;
- if (_cmpname(self, v, name, namelen))
+ if (_cmpname(state, self, v, name, namelen)) {
return _check_alias_and_seq(v, code, with_named_seq);
+ }
incr = incr << 1;
if (incr > mask)
incr = incr ^ code_poly;
}
}
+static int
+capi_getcode(PyObject* self, const char* name, int namelen, Py_UCS4* code,
+ int with_named_seq)
+{
+ unicodedata_module_state *state = &global_module_state;
+ return _getcode(state, self, name, namelen, code, with_named_seq);
+
+}
+
static const _PyUnicode_Name_CAPI hashAPI =
{
sizeof(_PyUnicode_Name_CAPI),
- _getucname,
- _getcode
+ capi_getucname,
+ capi_getcode
};
/* -------------------------------------------------------------------- */
@@ -1311,10 +1359,11 @@ static PyObject *
unicodedata_UCD_name_impl(PyObject *self, int chr, PyObject *default_value)
/*[clinic end generated code: output=6bbb37a326407707 input=3e0367f534de56d9]*/
{
+ unicodedata_module_state *state = &global_module_state;
char name[NAME_MAXLEN+1];
Py_UCS4 c = (Py_UCS4)chr;
- if (!_getucname(self, c, name, NAME_MAXLEN, 0)) {
+ if (!_getucname(state, self, c, name, NAME_MAXLEN, 0)) {
if (default_value == NULL) {
PyErr_SetString(PyExc_ValueError, "no such name");
return NULL;
@@ -1346,6 +1395,7 @@ unicodedata_UCD_lookup_impl(PyObject *self, const char *name,
Py_ssize_clean_t name_length)
/*[clinic end generated code: output=765cb8186788e6be input=a557be0f8607a0d6]*/
{
+ unicodedata_module_state *state = &global_module_state;
Py_UCS4 code;
unsigned int index;
if (name_length > NAME_MAXLEN) {
@@ -1353,7 +1403,7 @@ unicodedata_UCD_lookup_impl(PyObject *self, const char *name,
return NULL;
}
- if (!_getcode(self, name, (int)name_length, &code, 1)) {
+ if (!_getcode(state, self, name, (int)name_length, &code, 1)) {
PyErr_Format(PyExc_KeyError, "undefined character name '%s'", name);
return NULL;
}
@@ -1458,19 +1508,22 @@ PyMODINIT_FUNC
PyInit_unicodedata(void)
{
PyObject *m, *v;
+ unicodedata_module_state *state = &global_module_state;
Py_SET_TYPE(&UCD_Type, &PyType_Type);
+ state->ucd_type = &UCD_Type;
m = PyModule_Create(&unicodedatamodule);
if (!m)
return NULL;
PyModule_AddStringConstant(m, "unidata_version", UNIDATA_VERSION);
- Py_INCREF(&UCD_Type);
- PyModule_AddObject(m, "UCD", (PyObject*)&UCD_Type);
+ Py_INCREF(state->ucd_type);
+ PyModule_AddObject(m, "UCD", (PyObject*)state->ucd_type);
/* Previous versions */
- v = new_previous_version("3.2.0", get_change_3_2_0, normalization_3_2_0);
+ v = new_previous_version(state, "3.2.0",
+ get_change_3_2_0, normalization_3_2_0);
if (v != NULL)
PyModule_AddObject(m, "ucd_3_2_0", v);
diff --git a/Objects/abstract.c b/Objects/abstract.c
index c471f184f6..562549876b 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -747,10 +747,10 @@ done:
int
PyNumber_Check(PyObject *o)
{
- return o && Py_TYPE(o)->tp_as_number &&
- (Py_TYPE(o)->tp_as_number->nb_index ||
- Py_TYPE(o)->tp_as_number->nb_int ||
- Py_TYPE(o)->tp_as_number->nb_float);
+ if (o == NULL)
+ return 0;
+ PyNumberMethods *nb = Py_TYPE(o)->tp_as_number;
+ return nb && (nb->nb_index || nb->nb_int || nb->nb_float || PyComplex_Check(o));
}
/* Binary operators */
@@ -1461,7 +1461,7 @@ PyNumber_Long(PyObject *o)
}
return type_error("int() argument must be a string, a bytes-like object "
- "or a number, not '%.200s'", o);
+ "or a real number, not '%.200s'", o);
}
PyObject *
@@ -2336,9 +2336,7 @@ abstract_get_bases(PyObject *cls)
_Py_IDENTIFIER(__bases__);
PyObject *bases;
- Py_ALLOW_RECURSION
(void)_PyObject_LookupAttrId(cls, &PyId___bases__, &bases);
- Py_END_ALLOW_RECURSION
if (bases != NULL && !PyTuple_Check(bases)) {
Py_DECREF(bases);
return NULL;
@@ -2671,7 +2669,6 @@ PyIter_Next(PyObject *iter)
return result;
}
-
/*
* Flatten a sequence of bytes() objects into a C array of
* NULL terminated string pointers with a NULL char* terminating the array.
diff --git a/Objects/boolobject.c b/Objects/boolobject.c
index 720835b98a..b786966533 100644
--- a/Objects/boolobject.c
+++ b/Objects/boolobject.c
@@ -55,6 +55,30 @@ bool_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return PyBool_FromLong(ok);
}
+static PyObject *
+bool_vectorcall(PyObject *type, PyObject * const*args,
+ size_t nargsf, PyObject *kwnames)
+{
+ long ok = 0;
+ if (!_PyArg_NoKwnames("bool", kwnames)) {
+ return NULL;
+ }
+
+ Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
+ if (!_PyArg_CheckPositional("bool", nargs, 0, 1)) {
+ return NULL;
+ }
+
+ assert(PyType_Check(type));
+ if (nargs) {
+ ok = PyObject_IsTrue(args[0]);
+ if (ok < 0) {
+ return NULL;
+ }
+ }
+ return PyBool_FromLong(ok);
+}
+
/* Arithmetic operations redefined to return bool if both args are bool. */
static PyObject *
@@ -170,6 +194,7 @@ PyTypeObject PyBool_Type = {
0, /* tp_init */
0, /* tp_alloc */
bool_new, /* tp_new */
+ .tp_vectorcall = bool_vectorcall,
};
/* The objects representing bool values False and True */
diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c
index 72daa1fdd5..1512086e61 100644
--- a/Objects/bytes_methods.c
+++ b/Objects/bytes_methods.c
@@ -100,14 +100,14 @@ Return True if B is empty or all characters in B are ASCII,\n\
False otherwise.");
// Optimization is copied from ascii_decode in unicodeobject.c
-/* Mask to quickly check whether a C 'long' contains a
+/* Mask to quickly check whether a C 'size_t' contains a
non-ASCII, UTF8-encoded char. */
-#if (SIZEOF_LONG == 8)
-# define ASCII_CHAR_MASK 0x8080808080808080UL
-#elif (SIZEOF_LONG == 4)
-# define ASCII_CHAR_MASK 0x80808080UL
+#if (SIZEOF_SIZE_T == 8)
+# define ASCII_CHAR_MASK 0x8080808080808080ULL
+#elif (SIZEOF_SIZE_T == 4)
+# define ASCII_CHAR_MASK 0x80808080U
#else
-# error C 'long' size should be either 4 or 8!
+# error C 'size_t' size should be either 4 or 8!
#endif
PyObject*
@@ -115,20 +115,20 @@ _Py_bytes_isascii(const char *cptr, Py_ssize_t len)
{
const char *p = cptr;
const char *end = p + len;
- const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_LONG);
+ const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T);
while (p < end) {
/* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h
for an explanation. */
- if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
+ if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) {
/* Help allocation */
const char *_p = p;
while (_p < aligned_end) {
- unsigned long value = *(const unsigned long *) _p;
+ size_t value = *(const size_t *) _p;
if (value & ASCII_CHAR_MASK) {
Py_RETURN_FALSE;
}
- _p += SIZEOF_LONG;
+ _p += SIZEOF_SIZE_T;
}
p = _p;
if (_p == end)
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 836a736037..990730cd8c 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -522,7 +522,7 @@ formatlong(PyObject *v, int flags, int prec, int type)
PyErr_Format(PyExc_TypeError,
"%%%c format: %s is required, not %.200s", type,
(type == 'o' || type == 'x' || type == 'X') ? "an integer"
- : "a number",
+ : "a real number",
Py_TYPE(v)->tp_name);
return NULL;
}
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 69f6c17b4a..5ab839a9e9 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -510,23 +510,6 @@ complex_div(PyObject *v, PyObject *w)
}
static PyObject *
-complex_remainder(PyObject *v, PyObject *w)
-{
- PyErr_SetString(PyExc_TypeError,
- "can't mod complex numbers.");
- return NULL;
-}
-
-
-static PyObject *
-complex_divmod(PyObject *v, PyObject *w)
-{
- PyErr_SetString(PyExc_TypeError,
- "can't take floor or mod of complex number.");
- return NULL;
-}
-
-static PyObject *
complex_pow(PyObject *v, PyObject *w, PyObject *z)
{
Py_complex p;
@@ -563,14 +546,6 @@ complex_pow(PyObject *v, PyObject *w, PyObject *z)
}
static PyObject *
-complex_int_div(PyObject *v, PyObject *w)
-{
- PyErr_SetString(PyExc_TypeError,
- "can't take floor of complex number.");
- return NULL;
-}
-
-static PyObject *
complex_neg(PyComplexObject *v)
{
Py_complex neg;
@@ -668,22 +643,6 @@ Unimplemented:
Py_RETURN_NOTIMPLEMENTED;
}
-static PyObject *
-complex_int(PyObject *v)
-{
- PyErr_SetString(PyExc_TypeError,
- "can't convert complex to int");
- return NULL;
-}
-
-static PyObject *
-complex_float(PyObject *v)
-{
- PyErr_SetString(PyExc_TypeError,
- "can't convert complex to float");
- return NULL;
-}
-
/*[clinic input]
complex.conjugate
@@ -966,7 +925,9 @@ complex_new_impl(PyTypeObject *type, PyObject *r, PyObject *i)
}
nbr = Py_TYPE(r)->tp_as_number;
- if (nbr == NULL || (nbr->nb_float == NULL && nbr->nb_index == NULL)) {
+ if (nbr == NULL ||
+ (nbr->nb_float == NULL && nbr->nb_index == NULL && !PyComplex_Check(r)))
+ {
PyErr_Format(PyExc_TypeError,
"complex() first argument must be a string or a number, "
"not '%.200s'",
@@ -978,7 +939,9 @@ complex_new_impl(PyTypeObject *type, PyObject *r, PyObject *i)
}
if (i != NULL) {
nbi = Py_TYPE(i)->tp_as_number;
- if (nbi == NULL || (nbi->nb_float == NULL && nbi->nb_index == NULL)) {
+ if (nbi == NULL ||
+ (nbi->nb_float == NULL && nbi->nb_index == NULL && !PyComplex_Check(i)))
+ {
PyErr_Format(PyExc_TypeError,
"complex() second argument must be a number, "
"not '%.200s'",
@@ -1057,8 +1020,8 @@ static PyNumberMethods complex_as_number = {
(binaryfunc)complex_add, /* nb_add */
(binaryfunc)complex_sub, /* nb_subtract */
(binaryfunc)complex_mul, /* nb_multiply */
- (binaryfunc)complex_remainder, /* nb_remainder */
- (binaryfunc)complex_divmod, /* nb_divmod */
+ 0, /* nb_remainder */
+ 0, /* nb_divmod */
(ternaryfunc)complex_pow, /* nb_power */
(unaryfunc)complex_neg, /* nb_negative */
(unaryfunc)complex_pos, /* nb_positive */
@@ -1070,9 +1033,9 @@ static PyNumberMethods complex_as_number = {
0, /* nb_and */
0, /* nb_xor */
0, /* nb_or */
- complex_int, /* nb_int */
+ 0, /* nb_int */
0, /* nb_reserved */
- complex_float, /* nb_float */
+ 0, /* nb_float */
0, /* nb_inplace_add */
0, /* nb_inplace_subtract */
0, /* nb_inplace_multiply*/
@@ -1083,7 +1046,7 @@ static PyNumberMethods complex_as_number = {
0, /* nb_inplace_and */
0, /* nb_inplace_xor */
0, /* nb_inplace_or */
- (binaryfunc)complex_int_div, /* nb_floor_divide */
+ 0, /* nb_floor_divide */
(binaryfunc)complex_div, /* nb_true_divide */
0, /* nb_inplace_floor_divide */
0, /* nb_inplace_true_divide */
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index 4a83bb45aa..9d8449bb30 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -314,6 +314,24 @@ reversed_new_impl(PyTypeObject *type, PyObject *seq)
return (PyObject *)ro;
}
+static PyObject *
+reversed_vectorcall(PyObject *type, PyObject * const*args,
+ size_t nargsf, PyObject *kwnames)
+{
+ assert(PyType_Check(type));
+
+ if (!_PyArg_NoKwnames("reversed", kwnames)) {
+ return NULL;
+ }
+
+ Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
+ if (!_PyArg_CheckPositional("reversed", nargs, 1, 1)) {
+ return NULL;
+ }
+
+ return reversed_new_impl((PyTypeObject *)type, args[0]);
+}
+
static void
reversed_dealloc(reversedobject *ro)
{
@@ -445,4 +463,5 @@ PyTypeObject PyReversed_Type = {
PyType_GenericAlloc, /* tp_alloc */
reversed_new, /* tp_new */
PyObject_GC_Del, /* tp_free */
+ .tp_vectorcall = (vectorcallfunc)reversed_vectorcall,
};
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 1c6ecaf82c..9b89448006 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -223,6 +223,17 @@ PyObject_AsFileDescriptor(PyObject *o)
return fd;
}
+int
+_PyLong_FileDescriptor_Converter(PyObject *o, void *ptr)
+{
+ int fd = PyObject_AsFileDescriptor(o);
+ if (fd == -1) {
+ return 0;
+ }
+ *(int *)ptr = fd;
+ return 1;
+}
+
/*
** Py_UniversalNewlineFgets is an fgets variation that understands
** all of \r, \n and \r\n conventions.
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 0606f29ff5..828bde18df 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -215,7 +215,7 @@ PyFloat_FromString(PyObject *v)
}
else {
PyErr_Format(PyExc_TypeError,
- "float() argument must be a string or a number, not '%.200s'",
+ "float() argument must be a string or a real number, not '%.200s'",
Py_TYPE(v)->tp_name);
return NULL;
}
@@ -1649,6 +1649,24 @@ float_subtype_new(PyTypeObject *type, PyObject *x)
return newobj;
}
+static PyObject *
+float_vectorcall(PyObject *type, PyObject * const*args,
+ size_t nargsf, PyObject *kwnames)
+{
+ if (!_PyArg_NoKwnames("float", kwnames)) {
+ return NULL;
+ }
+
+ Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
+ if (!_PyArg_CheckPositional("float", nargs, 0, 1)) {
+ return NULL;
+ }
+
+ PyObject *x = nargs >= 1 ? args[0] : _PyLong_Zero;
+ return float_new_impl((PyTypeObject *)type, x);
+}
+
+
/*[clinic input]
float.__getnewargs__
[clinic start generated code]*/
@@ -1937,6 +1955,7 @@ PyTypeObject PyFloat_Type = {
0, /* tp_init */
0, /* tp_alloc */
float_new, /* tp_new */
+ .tp_vectorcall = (vectorcallfunc)float_vectorcall,
};
int
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c
index ab56e1c4bf..6508c69cbf 100644
--- a/Objects/genericaliasobject.c
+++ b/Objects/genericaliasobject.c
@@ -582,7 +582,7 @@ PyTypeObject Py_GenericAliasType = {
.tp_name = "types.GenericAlias",
.tp_doc = "Represent a PEP 585 generic type\n"
"\n"
- "E.g. for t = list[int], t.origin is list and t.args is (int,).",
+ "E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).",
.tp_basicsize = sizeof(gaobject),
.tp_dealloc = ga_dealloc,
.tp_repr = ga_repr,
diff --git a/Objects/genobject.c b/Objects/genobject.c
index f0943ae847..c1b26e9da3 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -269,13 +269,29 @@ gen_send_ex2(PyGenObject *gen, PyObject *arg, PyObject **presult,
}
PySendResult
-PyGen_Send(PyGenObject *gen, PyObject *arg, PyObject **result)
+PyIter_Send(PyObject *iter, PyObject *arg, PyObject **result)
{
- assert(PyGen_CheckExact(gen) || PyCoro_CheckExact(gen));
- assert(result != NULL);
+ _Py_IDENTIFIER(send);
assert(arg != NULL);
+ assert(result != NULL);
- return gen_send_ex2(gen, arg, result, 0, 0);
+ if (PyGen_CheckExact(iter) || PyCoro_CheckExact(iter)) {
+ return gen_send_ex2((PyGenObject *)iter, arg, result, 0, 0);
+ }
+
+ if (arg == Py_None && PyIter_Check(iter)) {
+ *result = Py_TYPE(iter)->tp_iternext(iter);
+ }
+ else {
+ *result = _PyObject_CallMethodIdOneArg(iter, &PyId_send, arg);
+ }
+ if (*result != NULL) {
+ return PYGEN_NEXT;
+ }
+ if (_PyGen_FetchStopIterationValue(result) == 0) {
+ return PYGEN_RETURN;
+ }
+ return PYGEN_ERROR;
}
static PyObject *
@@ -308,12 +324,6 @@ gen_send(PyGenObject *gen, PyObject *arg)
return gen_send_ex(gen, arg, 0, 0);
}
-PyObject *
-_PyGen_Send(PyGenObject *gen, PyObject *arg)
-{
- return gen_send(gen, arg);
-}
-
PyDoc_STRVAR(close_doc,
"close() -> raise GeneratorExit inside generator.");
@@ -1012,7 +1022,7 @@ PyDoc_STRVAR(coro_close_doc,
"close() -> raise GeneratorExit inside coroutine.");
static PyMethodDef coro_methods[] = {
- {"send",(PyCFunction)_PyGen_Send, METH_O, coro_send_doc},
+ {"send",(PyCFunction)gen_send, METH_O, coro_send_doc},
{"throw",(PyCFunction)gen_throw, METH_VARARGS, coro_throw_doc},
{"close",(PyCFunction)gen_close, METH_NOARGS, coro_close_doc},
{NULL, NULL} /* Sentinel */
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 5659f2143d..7b430416c5 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -164,9 +164,11 @@ meth_dealloc(PyCFunctionObject *m)
if (m->m_weakreflist != NULL) {
PyObject_ClearWeakRefs((PyObject*) m);
}
+ // Dereference class before m_self: PyCFunction_GET_CLASS accesses
+ // PyMethodDef m_ml, which could be kept alive by m_self
+ Py_XDECREF(PyCFunction_GET_CLASS(m));
Py_XDECREF(m->m_self);
Py_XDECREF(m->m_module);
- Py_XDECREF(PyCFunction_GET_CLASS(m));
PyObject_GC_Del(m);
}
@@ -243,9 +245,9 @@ meth_get__qualname__(PyCFunctionObject *m, void *closure)
static int
meth_traverse(PyCFunctionObject *m, visitproc visit, void *arg)
{
+ Py_VISIT(PyCFunction_GET_CLASS(m));
Py_VISIT(m->m_self);
Py_VISIT(m->m_module);
- Py_VISIT(PyCFunction_GET_CLASS(m));
return 0;
}
diff --git a/Objects/object.c b/Objects/object.c
index fe3734404f..7bc3e48d40 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -855,17 +855,6 @@ _PyObject_GetAttrId(PyObject *v, _Py_Identifier *name)
}
int
-_PyObject_HasAttrId(PyObject *v, _Py_Identifier *name)
-{
- int result;
- PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
- if (!oname)
- return -1;
- result = PyObject_HasAttr(v, oname);
- return result;
-}
-
-int
_PyObject_SetAttrId(PyObject *v, _Py_Identifier *name, PyObject *w)
{
int result;
@@ -1387,7 +1376,7 @@ PyObject_GenericSetDict(PyObject *obj, PyObject *value, void *context)
}
-/* Test a value used as condition, e.g., in a for or if statement.
+/* Test a value used as condition, e.g., in a while or if statement.
Return -1 if an error occurred */
int
diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h
index 197605b012..b6ca404b1a 100644
--- a/Objects/stringlib/codecs.h
+++ b/Objects/stringlib/codecs.h
@@ -6,14 +6,14 @@
#include "pycore_bitutils.h" // _Py_bswap32()
-/* Mask to quickly check whether a C 'long' contains a
+/* Mask to quickly check whether a C 'size_t' contains a
non-ASCII, UTF8-encoded char. */
-#if (SIZEOF_LONG == 8)
-# define ASCII_CHAR_MASK 0x8080808080808080UL
-#elif (SIZEOF_LONG == 4)
-# define ASCII_CHAR_MASK 0x80808080UL
+#if (SIZEOF_SIZE_T == 8)
+# define ASCII_CHAR_MASK 0x8080808080808080ULL
+#elif (SIZEOF_SIZE_T == 4)
+# define ASCII_CHAR_MASK 0x80808080U
#else
-# error C 'long' size should be either 4 or 8!
+# error C 'size_t' size should be either 4 or 8!
#endif
/* 10xxxxxx */
@@ -26,7 +26,7 @@ STRINGLIB(utf8_decode)(const char **inptr, const char *end,
{
Py_UCS4 ch;
const char *s = *inptr;
- const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_LONG);
+ const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T);
STRINGLIB_CHAR *p = dest + *outpos;
while (s < end) {
@@ -36,19 +36,19 @@ STRINGLIB(utf8_decode)(const char **inptr, const char *end,
/* Fast path for runs of ASCII characters. Given that common UTF-8
input will consist of an overwhelming majority of ASCII
characters, we try to optimize for this case by checking
- as many characters as a C 'long' can contain.
+ as many characters as a C 'size_t' can contain.
First, check if we can do an aligned read, as most CPUs have
a penalty for unaligned reads.
*/
- if (_Py_IS_ALIGNED(s, SIZEOF_LONG)) {
+ if (_Py_IS_ALIGNED(s, SIZEOF_SIZE_T)) {
/* Help register allocation */
const char *_s = s;
STRINGLIB_CHAR *_p = p;
while (_s < aligned_end) {
- /* Read a whole long at a time (either 4 or 8 bytes),
+ /* Read a whole size_t at a time (either 4 or 8 bytes),
and do a fast unrolled copy if it only contains ASCII
characters. */
- unsigned long value = *(const unsigned long *) _s;
+ size_t value = *(const size_t *) _s;
if (value & ASCII_CHAR_MASK)
break;
#if PY_LITTLE_ENDIAN
@@ -56,14 +56,14 @@ STRINGLIB(utf8_decode)(const char **inptr, const char *end,
_p[1] = (STRINGLIB_CHAR)((value >> 8) & 0xFFu);
_p[2] = (STRINGLIB_CHAR)((value >> 16) & 0xFFu);
_p[3] = (STRINGLIB_CHAR)((value >> 24) & 0xFFu);
-# if SIZEOF_LONG == 8
+# if SIZEOF_SIZE_T == 8
_p[4] = (STRINGLIB_CHAR)((value >> 32) & 0xFFu);
_p[5] = (STRINGLIB_CHAR)((value >> 40) & 0xFFu);
_p[6] = (STRINGLIB_CHAR)((value >> 48) & 0xFFu);
_p[7] = (STRINGLIB_CHAR)((value >> 56) & 0xFFu);
# endif
#else
-# if SIZEOF_LONG == 8
+# if SIZEOF_SIZE_T == 8
_p[0] = (STRINGLIB_CHAR)((value >> 56) & 0xFFu);
_p[1] = (STRINGLIB_CHAR)((value >> 48) & 0xFFu);
_p[2] = (STRINGLIB_CHAR)((value >> 40) & 0xFFu);
@@ -79,8 +79,8 @@ STRINGLIB(utf8_decode)(const char **inptr, const char *end,
_p[3] = (STRINGLIB_CHAR)(value & 0xFFu);
# endif
#endif
- _s += SIZEOF_LONG;
- _p += SIZEOF_LONG;
+ _s += SIZEOF_SIZE_T;
+ _p += SIZEOF_SIZE_T;
}
s = _s;
p = _p;
diff --git a/Objects/stringlib/find_max_char.h b/Objects/stringlib/find_max_char.h
index f4e0a7761d..3319a46461 100644
--- a/Objects/stringlib/find_max_char.h
+++ b/Objects/stringlib/find_max_char.h
@@ -4,14 +4,14 @@
# error "find_max_char.h is specific to Unicode"
#endif
-/* Mask to quickly check whether a C 'long' contains a
+/* Mask to quickly check whether a C 'size_t' contains a
non-ASCII, UTF8-encoded char. */
-#if (SIZEOF_LONG == 8)
-# define UCS1_ASCII_CHAR_MASK 0x8080808080808080UL
-#elif (SIZEOF_LONG == 4)
-# define UCS1_ASCII_CHAR_MASK 0x80808080UL
+#if (SIZEOF_SIZE_T == 8)
+# define UCS1_ASCII_CHAR_MASK 0x8080808080808080ULL
+#elif (SIZEOF_SIZE_T == 4)
+# define UCS1_ASCII_CHAR_MASK 0x80808080U
#else
-# error C 'long' size should be either 4 or 8!
+# error C 'size_t' size should be either 4 or 8!
#endif
#if STRINGLIB_SIZEOF_CHAR == 1
@@ -21,17 +21,17 @@ STRINGLIB(find_max_char)(const STRINGLIB_CHAR *begin, const STRINGLIB_CHAR *end)
{
const unsigned char *p = (const unsigned char *) begin;
const unsigned char *aligned_end =
- (const unsigned char *) _Py_ALIGN_DOWN(end, SIZEOF_LONG);
+ (const unsigned char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T);
while (p < end) {
- if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
+ if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) {
/* Help register allocation */
const unsigned char *_p = p;
while (_p < aligned_end) {
- unsigned long value = *(const unsigned long *) _p;
+ size_t value = *(const size_t *) _p;
if (value & UCS1_ASCII_CHAR_MASK)
return 255;
- _p += SIZEOF_LONG;
+ _p += SIZEOF_SIZE_T;
}
p = _p;
if (p == end)
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 3bb2c338fe..36c7662e08 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2612,10 +2612,10 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
slots = NULL;
/* Initialize tp_flags */
+ // All heap types need GC, since we can create a reference cycle by storing
+ // an instance on one of its parents:
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE |
- Py_TPFLAGS_BASETYPE;
- if (base->tp_flags & Py_TPFLAGS_HAVE_GC)
- type->tp_flags |= Py_TPFLAGS_HAVE_GC;
+ Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC;
/* Initialize essential fields */
type->tp_as_async = &et->as_async;
@@ -2815,21 +2815,11 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
}
type->tp_dealloc = subtype_dealloc;
- /* Enable GC unless this class is not adding new instance variables and
- the base class did not use GC. */
- if ((base->tp_flags & Py_TPFLAGS_HAVE_GC) ||
- type->tp_basicsize > base->tp_basicsize)
- type->tp_flags |= Py_TPFLAGS_HAVE_GC;
-
/* Always override allocation strategy to use regular heap */
type->tp_alloc = PyType_GenericAlloc;
- if (type->tp_flags & Py_TPFLAGS_HAVE_GC) {
- type->tp_free = PyObject_GC_Del;
- type->tp_traverse = subtype_traverse;
- type->tp_clear = subtype_clear;
- }
- else
- type->tp_free = PyObject_Del;
+ type->tp_free = PyObject_GC_Del;
+ type->tp_traverse = subtype_traverse;
+ type->tp_clear = subtype_clear;
/* store type in class' cell if one is supplied */
cell = _PyDict_GetItemIdWithError(dict, &PyId___classcell__);
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index f32ab417c3..f963deb020 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -5025,21 +5025,21 @@ PyUnicode_DecodeUTF8(const char *s,
#include "stringlib/codecs.h"
#include "stringlib/undef.h"
-/* Mask to quickly check whether a C 'long' contains a
+/* Mask to quickly check whether a C 'size_t' contains a
non-ASCII, UTF8-encoded char. */
-#if (SIZEOF_LONG == 8)
-# define ASCII_CHAR_MASK 0x8080808080808080UL
-#elif (SIZEOF_LONG == 4)
-# define ASCII_CHAR_MASK 0x80808080UL
+#if (SIZEOF_SIZE_T == 8)
+# define ASCII_CHAR_MASK 0x8080808080808080ULL
+#elif (SIZEOF_SIZE_T == 4)
+# define ASCII_CHAR_MASK 0x80808080U
#else
-# error C 'long' size should be either 4 or 8!
+# error C 'size_t' size should be either 4 or 8!
#endif
static Py_ssize_t
ascii_decode(const char *start, const char *end, Py_UCS1 *dest)
{
const char *p = start;
- const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_LONG);
+ const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T);
/*
* Issue #17237: m68k is a bit different from most architectures in
@@ -5049,21 +5049,21 @@ ascii_decode(const char *start, const char *end, Py_UCS1 *dest)
* version" will even speed up m68k.
*/
#if !defined(__m68k__)
-#if SIZEOF_LONG <= SIZEOF_VOID_P
- assert(_Py_IS_ALIGNED(dest, SIZEOF_LONG));
- if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
+#if SIZEOF_SIZE_T <= SIZEOF_VOID_P
+ assert(_Py_IS_ALIGNED(dest, SIZEOF_SIZE_T));
+ if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) {
/* Fast path, see in STRINGLIB(utf8_decode) for
an explanation. */
/* Help allocation */
const char *_p = p;
Py_UCS1 * q = dest;
while (_p < aligned_end) {
- unsigned long value = *(const unsigned long *) _p;
+ size_t value = *(const size_t *) _p;
if (value & ASCII_CHAR_MASK)
break;
- *((unsigned long *)q) = value;
- _p += SIZEOF_LONG;
- q += SIZEOF_LONG;
+ *((size_t *)q) = value;
+ _p += SIZEOF_SIZE_T;
+ q += SIZEOF_SIZE_T;
}
p = _p;
while (p < end) {
@@ -5078,14 +5078,14 @@ ascii_decode(const char *start, const char *end, Py_UCS1 *dest)
while (p < end) {
/* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h
for an explanation. */
- if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
+ if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) {
/* Help allocation */
const char *_p = p;
while (_p < aligned_end) {
- unsigned long value = *(const unsigned long *) _p;
+ size_t value = *(const size_t *) _p;
if (value & ASCII_CHAR_MASK)
break;
- _p += SIZEOF_LONG;
+ _p += SIZEOF_SIZE_T;
}
p = _p;
if (_p == end)
@@ -8304,7 +8304,7 @@ charmap_decode_mapping(const char *s,
goto Undefined;
if (value < 0 || value > MAX_UNICODE) {
PyErr_Format(PyExc_TypeError,
- "character mapping must be in range(0x%lx)",
+ "character mapping must be in range(0x%x)",
(unsigned long)MAX_UNICODE + 1);
goto onError;
}
@@ -14839,7 +14839,7 @@ wrongtype:
break;
default:
PyErr_Format(PyExc_TypeError,
- "%%%c format: a number is required, "
+ "%%%c format: a real number is required, "
"not %.200s",
type, Py_TYPE(v)->tp_name);
break;
@@ -15734,9 +15734,7 @@ PyUnicode_InternInPlace(PyObject **p)
}
PyObject *t;
- Py_ALLOW_RECURSION
t = PyDict_SetDefault(interned, s, s);
- Py_END_ALLOW_RECURSION
if (t == NULL) {
PyErr_Clear();
@@ -15764,6 +15762,15 @@ PyUnicode_InternInPlace(PyObject **p)
void
PyUnicode_InternImmortal(PyObject **p)
{
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "PyUnicode_InternImmortal() is deprecated; "
+ "use PyUnicode_InternInPlace() instead", 1) < 0)
+ {
+ // The function has no return value, the exception cannot
+ // be reported to the caller, so just log it.
+ PyErr_WriteUnraisable(NULL);
+ }
+
PyUnicode_InternInPlace(p);
if (PyUnicode_CHECK_INTERNED(*p) != SSTATE_INTERNED_IMMORTAL) {
_PyUnicode_STATE(*p).interned = SSTATE_INTERNED_IMMORTAL;
diff --git a/Objects/unionobject.c b/Objects/unionobject.c
index e055a55e91..89fdaf4256 100644
--- a/Objects/unionobject.c
+++ b/Objects/unionobject.c
@@ -202,8 +202,8 @@ flatten_args(PyObject* args)
PyTypeObject* arg_type = Py_TYPE(arg);
if (arg_type == &_Py_UnionType) {
PyObject* nested_args = ((unionobject*)arg)->args;
- int nested_arg_length = PyTuple_GET_SIZE(nested_args);
- for (int j = 0; j < nested_arg_length; j++) {
+ Py_ssize_t nested_arg_length = PyTuple_GET_SIZE(nested_args);
+ for (Py_ssize_t j = 0; j < nested_arg_length; j++) {
PyObject* nested_arg = PyTuple_GET_ITEM(nested_args, j);
Py_INCREF(nested_arg);
PyTuple_SET_ITEM(flattened_args, pos, nested_arg);
@@ -231,7 +231,7 @@ dedup_and_flatten_args(PyObject* args)
return NULL;
}
// Add unique elements to an array.
- int added_items = 0;
+ Py_ssize_t added_items = 0;
for (Py_ssize_t i = 0; i < arg_length; i++) {
int is_duplicate = 0;
PyObject* i_element = PyTuple_GET_ITEM(args, i);
@@ -311,21 +311,22 @@ union_repr_item(_PyUnicodeWriter *writer, PyObject *p)
_Py_IDENTIFIER(__args__);
PyObject *qualname = NULL;
PyObject *module = NULL;
+ PyObject *tmp;
PyObject *r = NULL;
int err;
- int has_origin = _PyObject_HasAttrId(p, &PyId___origin__);
- if (has_origin < 0) {
+ if (_PyObject_LookupAttrId(p, &PyId___origin__, &tmp) < 0) {
goto exit;
}
- if (has_origin) {
- int has_args = _PyObject_HasAttrId(p, &PyId___args__);
- if (has_args < 0) {
+ if (tmp) {
+ Py_DECREF(tmp);
+ if (_PyObject_LookupAttrId(p, &PyId___args__, &tmp) < 0) {
goto exit;
}
- if (has_args) {
+ if (tmp) {
// It looks like a GenericAlias
+ Py_DECREF(tmp);
goto use_repr;
}
}
diff --git a/PC/python3dll.c b/PC/python3dll.c
index ff69ea7ca5..153ba612b7 100644
--- a/PC/python3dll.c
+++ b/PC/python3dll.c
@@ -287,6 +287,7 @@ EXPORT_FUNC(PyInterpreterState_GetID)
EXPORT_FUNC(PyInterpreterState_New)
EXPORT_FUNC(PyIter_Check)
EXPORT_FUNC(PyIter_Next)
+EXPORT_FUNC(PyIter_Send)
EXPORT_FUNC(PyList_Append)
EXPORT_FUNC(PyList_AsTuple)
EXPORT_FUNC(PyList_GetItem)
diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
index b1709ac82b..799c46641f 100644
--- a/PCbuild/get_externals.bat
+++ b/PCbuild/get_externals.bat
@@ -54,7 +54,7 @@ set libraries=
set libraries=%libraries% bzip2-1.0.6
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1g
-set libraries=%libraries% sqlite-3.32.3.0
+set libraries=%libraries% sqlite-3.33.0.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.10.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.10.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tix-8.4.3.6
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 5f4926efa2..acc41a2c01 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -56,7 +56,7 @@
<ExternalsDir>$(EXTERNALS_DIR)</ExternalsDir>
<ExternalsDir Condition="$(ExternalsDir) == ''">$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`))</ExternalsDir>
<ExternalsDir Condition="!HasTrailingSlash($(ExternalsDir))">$(ExternalsDir)\</ExternalsDir>
- <sqlite3Dir>$(ExternalsDir)sqlite-3.32.3.0\</sqlite3Dir>
+ <sqlite3Dir>$(ExternalsDir)sqlite-3.33.0.0\</sqlite3Dir>
<bz2Dir>$(ExternalsDir)bzip2-1.0.6\</bz2Dir>
<lzmaDir>$(ExternalsDir)xz-5.2.2\</lzmaDir>
<libffiDir>$(ExternalsDir)libffi\</libffiDir>
diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt
index b8849757e8..73833d5463 100644
--- a/PCbuild/readme.txt
+++ b/PCbuild/readme.txt
@@ -185,7 +185,7 @@ _ssl
again when building.
_sqlite3
- Wraps SQLite 3.32.3.0, which is itself built by sqlite3.vcxproj
+ Wraps SQLite 3.33.0, which is itself built by sqlite3.vcxproj
Homepage:
http://www.sqlite.org/
_tkinter
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 242eccf3d3..481261cd85 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -618,16 +618,6 @@ class Obj2ModVisitor(PickleVisitor):
self.emit("}", depth)
-class MarshalPrototypeVisitor(PickleVisitor):
-
- def prototype(self, sum, name):
- ctype = get_c_type(name)
- self.emit("static int marshal_write_%s(PyObject **, int *, %s);"
- % (name, ctype), 0)
-
- visitProduct = visitSum = prototype
-
-
class SequenceConstructorVisitor(EmitVisitor):
def visitModule(self, mod):
for dfn in mod.dfns:
@@ -1167,25 +1157,6 @@ PyInit__ast(void)
self.emit("Py_INCREF(state->%s_type);" % name, 1)
-_SPECIALIZED_SEQUENCES = ('stmt', 'expr')
-
-def find_sequence(fields, doing_specialization):
- """Return True if any field uses a sequence."""
- for f in fields:
- if f.seq:
- if not doing_specialization:
- return True
- if str(f.type) not in _SPECIALIZED_SEQUENCES:
- return True
- return False
-
-def has_sequence(types, doing_specialization):
- for t in types:
- if find_sequence(t.fields, doing_specialization):
- return True
- return False
-
-
class StaticVisitor(PickleVisitor):
CODE = '''Very simple, always emit this static code. Override CODE'''
@@ -1283,18 +1254,6 @@ class ObjVisitor(PickleVisitor):
emit("goto failed;", 1)
emit("Py_DECREF(value);", 0)
- def emitSeq(self, field, value, depth, emit):
- emit("seq = %s;" % value, 0)
- emit("n = asdl_seq_LEN(seq);", 0)
- emit("value = PyList_New(n);", 0)
- emit("if (!value) goto failed;", 0)
- emit("for (i = 0; i < n; i++) {", 0)
- self.set("value", field, "asdl_seq_GET(seq, i)", depth + 1)
- emit("if (!value1) goto failed;", 1)
- emit("PyList_SET_ITEM(value, i, value1);", 1)
- emit("value1 = NULL;", 1)
- emit("}", 0)
-
def set(self, field, value, depth):
if field.seq:
# XXX should really check for is_simple, but that requires a symbol table
@@ -1313,7 +1272,6 @@ class ObjVisitor(PickleVisitor):
else:
self.emit("value = ast2obj_list(state, (asdl_seq*)%s, ast2obj_%s);" % (value, field.type), depth)
else:
- ctype = get_c_type(field.type)
self.emit("value = ast2obj_%s(state, %s);" % (field.type, value), depth, reflow=False)
diff --git a/Parser/parser.c b/Parser/parser.c
index 1bd74a38fb..0d92256a3e 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -4290,7 +4290,10 @@ with_stmt_rule(Parser *p)
return _res;
}
-// with_item: expression 'as' target &(',' | ')' | ':') | invalid_with_item | expression
+// with_item:
+// | expression 'as' star_target &(',' | ')' | ':')
+// | invalid_with_item
+// | expression
static withitem_ty
with_item_rule(Parser *p)
{
@@ -4301,12 +4304,12 @@ with_item_rule(Parser *p)
}
withitem_ty _res = NULL;
int _mark = p->mark;
- { // expression 'as' target &(',' | ')' | ':')
+ { // expression 'as' star_target &(',' | ')' | ':')
if (p->error_indicator) {
D(p->level--);
return NULL;
}
- D(fprintf(stderr, "%*c> with_item[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression 'as' target &(',' | ')' | ':')"));
+ D(fprintf(stderr, "%*c> with_item[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression 'as' star_target &(',' | ')' | ':')"));
Token * _keyword;
expr_ty e;
expr_ty t;
@@ -4315,12 +4318,12 @@ with_item_rule(Parser *p)
&&
(_keyword = _PyPegen_expect_token(p, 520)) // token='as'
&&
- (t = target_rule(p)) // target
+ (t = star_target_rule(p)) // star_target
&&
_PyPegen_lookahead(1, _tmp_47_rule, p)
)
{
- D(fprintf(stderr, "%*c+ with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression 'as' target &(',' | ')' | ':')"));
+ D(fprintf(stderr, "%*c+ with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression 'as' star_target &(',' | ')' | ':')"));
_res = _Py_withitem ( e , t , p -> arena );
if (_res == NULL && PyErr_Occurred()) {
p->error_indicator = 1;
@@ -4331,7 +4334,7 @@ with_item_rule(Parser *p)
}
p->mark = _mark;
D(fprintf(stderr, "%*c%s with_item[%d-%d]: %s failed!\n", p->level, ' ',
- p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression 'as' target &(',' | ')' | ':')"));
+ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression 'as' star_target &(',' | ')' | ':')"));
}
{ // invalid_with_item
if (p->error_indicator) {
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 1de495eaf3..efa5ed9f28 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -1897,7 +1897,7 @@ _PyPegen_empty_arguments(Parser *p)
return NULL;
}
- return _Py_arguments(posonlyargs, posargs, NULL, kwonlyargs, kwdefaults, NULL, kwdefaults,
+ return _Py_arguments(posonlyargs, posargs, NULL, kwonlyargs, kwdefaults, NULL, posdefaults,
p->arena);
}
diff --git a/Python/ast.c b/Python/ast.c
index 4b7bbd229c..5e74f65a2c 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -1,18 +1,12 @@
/*
- * This file includes functions to transform a concrete syntax tree (CST) to
- * an abstract syntax tree (AST). The main function is PyAST_FromNode().
- *
+ * This file exposes PyAST_Validate interface to check the integrity
+ * of the given abstract syntax tree (potentially constructed manually).
*/
#include "Python.h"
#include "Python-ast.h"
#include "ast.h"
-#include "token.h"
-#include "pythonrun.h"
#include <assert.h>
-#include <stdbool.h>
-
-#define MAXLEVEL 200 /* Max parentheses level */
static int validate_stmts(asdl_stmt_seq *);
static int validate_exprs(asdl_expr_seq*, expr_context_ty, int);
@@ -62,7 +56,7 @@ validate_keywords(asdl_keyword_seq *keywords)
{
Py_ssize_t i;
for (i = 0; i < asdl_seq_LEN(keywords); i++)
- if (!validate_expr(((keyword_ty)asdl_seq_GET(keywords, i))->value, Load))
+ if (!validate_expr((asdl_seq_GET(keywords, i))->value, Load))
return 0;
return 1;
}
@@ -556,7 +550,7 @@ _PyAST_GetDocString(asdl_stmt_seq *body)
if (!asdl_seq_LEN(body)) {
return NULL;
}
- stmt_ty st = (stmt_ty)asdl_seq_GET(body, 0);
+ stmt_ty st = asdl_seq_GET(body, 0);
if (st->kind != Expr_kind) {
return NULL;
}
diff --git a/Python/ast_opt.c b/Python/ast_opt.c
index 5efaac4c89..22ca6f23ae 100644
--- a/Python/ast_opt.c
+++ b/Python/ast_opt.c
@@ -392,7 +392,6 @@ static int astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state
static int astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
static int astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
static int astfold_keyword(keyword_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
-static int astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
static int astfold_withitem(withitem_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
static int astfold_excepthandler(excepthandler_ty node_, PyArena *ctx_, _PyASTOptimizeState *state);
#define CALL(FUNC, TYPE, ARG) \
@@ -595,26 +594,12 @@ astfold_comprehension(comprehension_ty node_, PyArena *ctx_, _PyASTOptimizeState
static int
astfold_arguments(arguments_ty node_, PyArena *ctx_, _PyASTOptimizeState *state)
{
- CALL_SEQ(astfold_arg, arg, node_->posonlyargs);
- CALL_SEQ(astfold_arg, arg, node_->args);
- CALL_OPT(astfold_arg, arg_ty, node_->vararg);
- CALL_SEQ(astfold_arg, arg, node_->kwonlyargs);
CALL_SEQ(astfold_expr, expr, node_->kw_defaults);
- CALL_OPT(astfold_arg, arg_ty, node_->kwarg);
CALL_SEQ(astfold_expr, expr, node_->defaults);
return 1;
}
static int
-astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state)
-{
- if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) {
- CALL_OPT(astfold_expr, expr_ty, node_->annotation);
- }
- return 1;
-}
-
-static int
astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state)
{
switch (node_->kind) {
@@ -622,17 +607,11 @@ astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state)
CALL(astfold_arguments, arguments_ty, node_->v.FunctionDef.args);
CALL(astfold_body, asdl_seq, node_->v.FunctionDef.body);
CALL_SEQ(astfold_expr, expr, node_->v.FunctionDef.decorator_list);
- if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) {
- CALL_OPT(astfold_expr, expr_ty, node_->v.FunctionDef.returns);
- }
break;
case AsyncFunctionDef_kind:
CALL(astfold_arguments, arguments_ty, node_->v.AsyncFunctionDef.args);
CALL(astfold_body, asdl_seq, node_->v.AsyncFunctionDef.body);
CALL_SEQ(astfold_expr, expr, node_->v.AsyncFunctionDef.decorator_list);
- if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) {
- CALL_OPT(astfold_expr, expr_ty, node_->v.AsyncFunctionDef.returns);
- }
break;
case ClassDef_kind:
CALL_SEQ(astfold_expr, expr, node_->v.ClassDef.bases);
@@ -656,9 +635,6 @@ astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state)
break;
case AnnAssign_kind:
CALL(astfold_expr, expr_ty, node_->v.AnnAssign.target);
- if (!(state->ff_features & CO_FUTURE_ANNOTATIONS)) {
- CALL(astfold_expr, expr_ty, node_->v.AnnAssign.annotation);
- }
CALL_OPT(astfold_expr, expr_ty, node_->v.AnnAssign.value);
break;
case For_kind:
diff --git a/Python/ceval.c b/Python/ceval.c
index 6430e792b8..762de577e6 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -814,9 +814,6 @@ _Py_CheckRecursiveCall(PyThreadState *tstate, const char *where)
return -1;
}
#endif
- if (tstate->recursion_critical)
- /* Somebody asked that we don't check for recursion. */
- return 0;
if (tstate->overflowed) {
if (tstate->recursion_depth > recursion_limit + 50) {
/* Overflowing while handling an overflow. Give up. */
@@ -1701,7 +1698,7 @@ main_loop:
PyObject *right = POP();
PyObject *left = TOP();
PyObject *sum;
- /* NOTE(haypo): Please don't try to micro-optimize int+int on
+ /* NOTE(vstinner): Please don't try to micro-optimize int+int on
CPython using bytecode, it is simply worthless.
See http://bugs.python.org/issue21955 and
http://bugs.python.org/issue10044 for the discussion. In short,
@@ -2213,24 +2210,17 @@ main_loop:
case TARGET(YIELD_FROM): {
PyObject *v = POP();
PyObject *receiver = TOP();
- int is_gen_or_coro = PyGen_CheckExact(receiver) || PyCoro_CheckExact(receiver);
- int gen_status;
- if (tstate->c_tracefunc == NULL && is_gen_or_coro) {
- gen_status = PyGen_Send((PyGenObject *)receiver, v, &retval);
+ PySendResult gen_status;
+ if (tstate->c_tracefunc == NULL) {
+ gen_status = PyIter_Send(receiver, v, &retval);
} else {
- if (is_gen_or_coro) {
- retval = _PyGen_Send((PyGenObject *)receiver, v);
+ _Py_IDENTIFIER(send);
+ if (v == Py_None && PyIter_Check(receiver)) {
+ retval = Py_TYPE(receiver)->tp_iternext(receiver);
}
else {
- _Py_IDENTIFIER(send);
- if (v == Py_None) {
- retval = Py_TYPE(receiver)->tp_iternext(receiver);
- }
- else {
- retval = _PyObject_CallMethodIdOneArg(receiver, &PyId_send, v);
- }
+ retval = _PyObject_CallMethodIdOneArg(receiver, &PyId_send, v);
}
-
if (retval == NULL) {
if (tstate->c_tracefunc != NULL
&& _PyErr_ExceptionMatches(tstate, PyExc_StopIteration))
@@ -2311,7 +2301,6 @@ main_loop:
}
case TARGET(POP_BLOCK): {
- PREDICTED(POP_BLOCK);
PyFrame_BlockPop(f);
DISPATCH();
}
@@ -3366,7 +3355,6 @@ main_loop:
STACK_SHRINK(1);
Py_DECREF(iter);
JUMPBY(oparg);
- PREDICT(POP_BLOCK);
DISPATCH();
}
diff --git a/Python/codecs.c b/Python/codecs.c
index 0f18c27e5f..ade1418720 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -50,6 +50,31 @@ int PyCodec_Register(PyObject *search_function)
return -1;
}
+int
+PyCodec_Unregister(PyObject *search_function)
+{
+ PyInterpreterState *interp = PyInterpreterState_Get();
+ PyObject *codec_search_path = interp->codec_search_path;
+ /* Do nothing if codec_search_path is not created yet or was cleared. */
+ if (codec_search_path == NULL) {
+ return 0;
+ }
+
+ assert(PyList_CheckExact(codec_search_path));
+ Py_ssize_t n = PyList_GET_SIZE(codec_search_path);
+ for (Py_ssize_t i = 0; i < n; i++) {
+ PyObject *item = PyList_GET_ITEM(codec_search_path, i);
+ if (item == search_function) {
+ if (interp->codec_search_cache != NULL) {
+ assert(PyDict_CheckExact(interp->codec_search_cache));
+ PyDict_Clear(interp->codec_search_cache);
+ }
+ return PyList_SetSlice(codec_search_path, i, i+1, NULL);
+ }
+ }
+ return 0;
+}
+
extern int _Py_normalize_encoding(const char *, char *, size_t);
/* Convert a string to a normalized Python string(decoded from UTF-8): all characters are
@@ -183,31 +208,6 @@ PyObject *_PyCodec_Lookup(const char *encoding)
return NULL;
}
-int _PyCodec_Forget(const char *encoding)
-{
- PyObject *v;
- int result;
-
- PyInterpreterState *interp = _PyInterpreterState_GET();
- if (interp->codec_search_path == NULL) {
- return -1;
- }
-
- /* Convert the encoding to a normalized Python string: all
- characters are converted to lower case, spaces and hyphens are
- replaced with underscores. */
- v = normalizestring(encoding);
- if (v == NULL) {
- return -1;
- }
-
- /* Drop the named codec from the internal cache */
- result = PyDict_DelItem(interp->codec_search_cache, v);
- Py_DECREF(v);
-
- return result;
-}
-
/* Codec registry encoding check API. */
int PyCodec_KnownEncoding(const char *encoding)
diff --git a/Python/compile.c b/Python/compile.c
index 0f9e5c276c..ddd2a04962 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -108,8 +108,8 @@ It's called a frame block to distinguish it from a basic block in the
compiler IR.
*/
-enum fblocktype { WHILE_LOOP, FOR_LOOP, EXCEPT, FINALLY_TRY, FINALLY_END,
- WITH, ASYNC_WITH, HANDLER_CLEANUP, POP_VALUE };
+enum fblocktype { WHILE_LOOP, FOR_LOOP, TRY_EXCEPT, FINALLY_TRY, FINALLY_END,
+ WITH, ASYNC_WITH, HANDLER_CLEANUP, POP_VALUE, EXCEPTION_HANDLER };
struct fblockinfo {
enum fblocktype fb_type;
@@ -1623,9 +1623,7 @@ compiler_push_fblock(struct compiler *c, enum fblocktype t, basicblock *b,
{
struct fblockinfo *f;
if (c->u->u_nfblocks >= CO_MAXBLOCKS) {
- PyErr_SetString(PyExc_SyntaxError,
- "too many statically nested blocks");
- return 0;
+ return compiler_error(c, "too many statically nested blocks");
}
f = &c->u->u_fblock[c->u->u_nfblocks++];
f->fb_type = t;
@@ -1665,6 +1663,7 @@ compiler_unwind_fblock(struct compiler *c, struct fblockinfo *info,
{
switch (info->fb_type) {
case WHILE_LOOP:
+ case EXCEPTION_HANDLER:
return 1;
case FOR_LOOP:
@@ -1675,7 +1674,7 @@ compiler_unwind_fblock(struct compiler *c, struct fblockinfo *info,
ADDOP(c, POP_TOP);
return 1;
- case EXCEPT:
+ case TRY_EXCEPT:
ADDOP(c, POP_BLOCK);
return 1;
@@ -2027,12 +2026,7 @@ compiler_visit_argannotation(struct compiler *c, identifier id,
{
if (annotation) {
PyObject *mangled;
- if (c->c_future->ff_features & CO_FUTURE_ANNOTATIONS) {
- VISIT(c, annexpr, annotation)
- }
- else {
- VISIT(c, expr, annotation);
- }
+ VISIT(c, annexpr, annotation);
mangled = _Py_Mangle(c->u->u_private, id);
if (!mangled)
return 0;
@@ -3060,14 +3054,17 @@ compiler_try_except(struct compiler *c, stmt_ty s)
return 0;
ADDOP_JUMP(c, SETUP_FINALLY, except);
compiler_use_next_block(c, body);
- if (!compiler_push_fblock(c, EXCEPT, body, NULL, NULL))
+ if (!compiler_push_fblock(c, TRY_EXCEPT, body, NULL, NULL))
return 0;
VISIT_SEQ(c, stmt, s->v.Try.body);
ADDOP(c, POP_BLOCK);
- compiler_pop_fblock(c, EXCEPT, body);
+ compiler_pop_fblock(c, TRY_EXCEPT, body);
ADDOP_JUMP(c, JUMP_FORWARD, orelse);
n = asdl_seq_LEN(s->v.Try.handlers);
compiler_use_next_block(c, except);
+ /* Runtime will push a block here, so we need to account for that */
+ if (!compiler_push_fblock(c, EXCEPTION_HANDLER, NULL, NULL, NULL))
+ return 0;
for (i = 0; i < n; i++) {
excepthandler_ty handler = (excepthandler_ty)asdl_seq_GET(
s->v.Try.handlers, i);
@@ -3152,6 +3149,7 @@ compiler_try_except(struct compiler *c, stmt_ty s)
}
compiler_use_next_block(c, except);
}
+ compiler_pop_fblock(c, EXCEPTION_HANDLER, NULL);
ADDOP(c, RERAISE);
compiler_use_next_block(c, orelse);
VISIT_SEQ(c, stmt, s->v.Try.orelse);
@@ -5258,12 +5256,7 @@ compiler_annassign(struct compiler *c, stmt_ty s)
if (s->v.AnnAssign.simple &&
(c->u->u_scope_type == COMPILER_SCOPE_MODULE ||
c->u->u_scope_type == COMPILER_SCOPE_CLASS)) {
- if (c->c_future->ff_features & CO_FUTURE_ANNOTATIONS) {
- VISIT(c, annexpr, s->v.AnnAssign.annotation)
- }
- else {
- VISIT(c, expr, s->v.AnnAssign.annotation);
- }
+ VISIT(c, annexpr, s->v.AnnAssign.annotation);
ADDOP_NAME(c, LOAD_NAME, __annotations__, names);
mangled = _Py_Mangle(c->u->u_private, targ->v.Name.id);
ADDOP_LOAD_CONST_NEW(c, mangled);
diff --git a/Python/dynload_aix.c b/Python/dynload_aix.c
deleted file mode 100644
index 684f10a8b9..0000000000
--- a/Python/dynload_aix.c
+++ /dev/null
@@ -1,184 +0,0 @@
-
-/* Support for dynamic loading of extension modules */
-
-#include "Python.h"
-#include "importdl.h"
-
-#include <errno.h> /* for global errno */
-#include <string.h> /* for strerror() */
-#include <stdlib.h> /* for malloc(), free() */
-#include <sys/ldr.h>
-
-
-#ifdef AIX_GENUINE_CPLUSPLUS
-#include <load.h>
-#define aix_load loadAndInit
-#else
-#define aix_load load
-#endif
-
-
-extern char *Py_GetProgramName(void);
-
-typedef struct Module {
- struct Module *next;
- void *entry;
-} Module, *ModulePtr;
-
-const char *_PyImport_DynLoadFiletab[] = {".so", NULL};
-
-static int
-aix_getoldmodules(void **modlistptr)
-{
- ModulePtr modptr, prevmodptr;
- struct ld_info *ldiptr;
- char *ldibuf;
- int errflag, bufsize = 1024;
- unsigned int offset;
- char *progname = Py_GetProgramName();
-
- /*
- -- Get the list of loaded modules into ld_info structures.
- */
- if ((ldibuf = malloc(bufsize)) == NULL) {
- PyErr_SetString(PyExc_ImportError, strerror(errno));
- return -1;
- }
- while ((errflag = loadquery(L_GETINFO, ldibuf, bufsize)) == -1
- && errno == ENOMEM) {
- free(ldibuf);
- bufsize += 1024;
- if ((ldibuf = malloc(bufsize)) == NULL) {
- PyErr_SetString(PyExc_ImportError, strerror(errno));
- return -1;
- }
- }
- if (errflag == -1) {
- PyErr_SetString(PyExc_ImportError, strerror(errno));
- return -1;
- }
- /*
- -- Make the modules list from the ld_info structures.
- */
- ldiptr = (struct ld_info *)ldibuf;
- prevmodptr = NULL;
- do {
- if (strstr(progname, ldiptr->ldinfo_filename) == NULL &&
- strstr(ldiptr->ldinfo_filename, "python") == NULL) {
- /*
- -- Extract only the modules belonging to the main
- -- executable + those containing "python" as a
- -- substring (like the "python[version]" binary or
- -- "libpython[version].a" in case it's a shared lib).
- */
- offset = (unsigned int)ldiptr->ldinfo_next;
- ldiptr = (struct ld_info *)((char*)ldiptr + offset);
- continue;
- }
- if ((modptr = (ModulePtr)malloc(sizeof(Module))) == NULL) {
- PyErr_SetString(PyExc_ImportError, strerror(errno));
- while (*modlistptr) {
- modptr = (ModulePtr)*modlistptr;
- *modlistptr = (void *)modptr->next;
- free(modptr);
- }
- return -1;
- }
- modptr->entry = ldiptr->ldinfo_dataorg;
- modptr->next = NULL;
- if (prevmodptr == NULL)
- *modlistptr = (void *)modptr;
- else
- prevmodptr->next = modptr;
- prevmodptr = modptr;
- offset = (unsigned int)ldiptr->ldinfo_next;
- ldiptr = (struct ld_info *)((char*)ldiptr + offset);
- } while (offset);
- free(ldibuf);
- return 0;
-}
-
-
-static void
-aix_loaderror(const char *pathname)
-{
-
- char *message[1024], errbuf[1024];
- PyObject *pathname_ob = NULL;
- PyObject *errbuf_ob = NULL;
- int i,j;
-
- struct errtab {
- int errNo;
- char *errstr;
- } load_errtab[] = {
- {L_ERROR_TOOMANY, "too many errors, rest skipped."},
- {L_ERROR_NOLIB, "can't load library:"},
- {L_ERROR_UNDEF, "can't find symbol in library:"},
- {L_ERROR_RLDBAD,
- "RLD index out of range or bad relocation type:"},
- {L_ERROR_FORMAT, "not a valid, executable xcoff file:"},
- {L_ERROR_MEMBER,
- "file not an archive or does not contain requested member:"},
- {L_ERROR_TYPE, "symbol table mismatch:"},
- {L_ERROR_ALIGN, "text alignment in file is wrong."},
- {L_ERROR_SYSTEM, "System error:"},
- {L_ERROR_ERRNO, NULL}
- };
-
-#define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1)
-
- PyOS_snprintf(errbuf, sizeof(errbuf), "from module %.200s ", pathname);
-
- if (!loadquery(L_GETMESSAGES, &message[0], sizeof(message))) {
- ERRBUF_APPEND(strerror(errno));
- ERRBUF_APPEND("\n");
- }
- for(i = 0; message[i] && *message[i]; i++) {
- int nerr = atoi(message[i]);
- for (j=0; j < Py_ARRAY_LENGTH(load_errtab); j++) {
- if (nerr == load_errtab[j].errNo && load_errtab[j].errstr)
- ERRBUF_APPEND(load_errtab[j].errstr);
- }
- while (Py_ISDIGIT(*message[i])) message[i]++ ;
- ERRBUF_APPEND(message[i]);
- ERRBUF_APPEND("\n");
- }
- errbuf[strlen(errbuf)-1] = '\0'; /* trim off last newline */
- pathname_ob = PyUnicode_FromString(pathname);
- errbuf_ob = PyUnicode_FromString(errbuf);
- PyErr_SetImportError(errbuf_ob, NULL, pathname);
- Py_DECREF(pathname_ob);
- Py_DECREF(errbuf_ob);
- return;
-}
-
-
-dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix,
- const char *shortname,
- const char *pathname, FILE *fp)
-{
- dl_funcptr p;
-
- /*
- -- Invoke load() with L_NOAUTODEFER leaving the imported symbols
- -- of the shared module unresolved. Thus we have to resolve them
- -- explicitly with loadbind. The new module is loaded, then we
- -- resolve its symbols using the list of already loaded modules
- -- (only those that belong to the python executable). Get these
- -- with loadquery(L_GETINFO).
- */
-
- static void *staticmodlistptr = NULL;
-
- if (!staticmodlistptr)
- if (aix_getoldmodules(&staticmodlistptr) == -1)
- return NULL;
- p = (dl_funcptr) aix_load((char *)pathname, L_NOAUTODEFER, 0);
- if (p == NULL) {
- aix_loaderror(pathname);
- return NULL;
- }
-
- return p;
-}
diff --git a/Python/dynload_dl.c b/Python/dynload_dl.c
deleted file mode 100644
index 2bec645fbd..0000000000
--- a/Python/dynload_dl.c
+++ /dev/null
@@ -1,23 +0,0 @@
-
-/* Support for dynamic loading of extension modules */
-
-#include "dl.h"
-
-#include "Python.h"
-#include "importdl.h"
-
-
-extern char *Py_GetProgramName(void);
-
-const char *_PyImport_DynLoadFiletab[] = {".o", NULL};
-
-
-dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix,
- const char *shortname,
- const char *pathname, FILE *fp)
-{
- char funcname[258];
-
- PyOS_snprintf(funcname, sizeof(funcname), "%.20s_%.200s", prefix, shortname);
- return dl_loadmod(Py_GetProgramName(), pathname, funcname);
-}
diff --git a/Python/dynload_hpux.c b/Python/dynload_hpux.c
index 4b964a69d3..e36d608c6d 100644
--- a/Python/dynload_hpux.c
+++ b/Python/dynload_hpux.c
@@ -36,9 +36,20 @@ dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix,
char buf[256];
PyOS_snprintf(buf, sizeof(buf), "Failed to load %.200s",
pathname);
- PyObject *buf_ob = PyUnicode_FromString(buf);
+ PyObject *buf_ob = PyUnicode_DecodeFSDefault(buf);
+ if (buf_ob == NULL)
+ return NULL;
PyObject *shortname_ob = PyUnicode_FromString(shortname);
- PyObject *pathname_ob = PyUnicode_FromString(pathname);
+ if (shortname_ob == NULL) {
+ Py_DECREF(buf_ob);
+ return NULL;
+ }
+ PyObject *pathname_ob = PyUnicode_DecodeFSDefault(pathname);
+ if (pathname_ob == NULL) {
+ Py_DECREF(buf_ob);
+ Py_DECREF(shortname_ob);
+ return NULL;
+ }
PyErr_SetImportError(buf_ob, shortname_ob, pathname_ob);
Py_DECREF(buf_ob);
Py_DECREF(shortname_ob);
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index 082154dd91..23828898d3 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -106,7 +106,7 @@ _PyImport_FindSharedFuncptr(const char *prefix,
const char *error = dlerror();
if (error == NULL)
error = "unknown dlopen() error";
- error_ob = PyUnicode_FromString(error);
+ error_ob = PyUnicode_DecodeLocale(error, "surrogateescape");
if (error_ob == NULL)
return NULL;
mod_name = PyUnicode_FromString(shortname);
@@ -114,7 +114,7 @@ _PyImport_FindSharedFuncptr(const char *prefix,
Py_DECREF(error_ob);
return NULL;
}
- path = PyUnicode_FromString(pathname);
+ path = PyUnicode_DecodeFSDefault(pathname);
if (path == NULL) {
Py_DECREF(error_ob);
Py_DECREF(mod_name);
diff --git a/Python/errors.c b/Python/errors.c
index 720f18bc22..02cf47992b 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -1593,9 +1593,18 @@ PyErr_SyntaxLocationObject(PyObject *filename, int lineno, int col_offset)
}
Py_DECREF(tmp);
}
+ else {
+ _PyErr_Clear(tstate);
+ }
}
if (exc != PyExc_SyntaxError) {
- if (!_PyObject_HasAttrId(v, &PyId_msg)) {
+ if (_PyObject_LookupAttrId(v, &PyId_msg, &tmp) < 0) {
+ _PyErr_Clear(tstate);
+ }
+ else if (tmp) {
+ Py_DECREF(tmp);
+ }
+ else {
tmp = PyObject_Str(v);
if (tmp) {
if (_PyObject_SetAttrId(v, &PyId_msg, tmp)) {
@@ -1607,7 +1616,13 @@ PyErr_SyntaxLocationObject(PyObject *filename, int lineno, int col_offset)
_PyErr_Clear(tstate);
}
}
- if (!_PyObject_HasAttrId(v, &PyId_print_file_and_line)) {
+ if (_PyObject_LookupAttrId(v, &PyId_print_file_and_line, &tmp) < 0) {
+ _PyErr_Clear(tstate);
+ }
+ else if (tmp) {
+ Py_DECREF(tmp);
+ }
+ else {
if (_PyObject_SetAttrId(v, &PyId_print_file_and_line,
Py_None)) {
_PyErr_Clear(tstate);
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 50ef3c174a..b79067f2b5 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -2106,3 +2106,79 @@ done:
PyMem_Free(oldloc);
return res;
}
+
+/* Our selection logic for which function to use is as follows:
+ * 1. If close_range(2) is available, always prefer that; it's better for
+ * contiguous ranges like this than fdwalk(3) which entails iterating over
+ * the entire fd space and simply doing nothing for those outside the range.
+ * 2. If closefrom(2) is available, we'll attempt to use that next if we're
+ * closing up to sysconf(_SC_OPEN_MAX).
+ * 2a. Fallback to fdwalk(3) if we're not closing up to sysconf(_SC_OPEN_MAX),
+ * as that will be more performant if the range happens to have any chunk of
+ * non-opened fd in the middle.
+ * 2b. If fdwalk(3) isn't available, just do a plain close(2) loop.
+ */
+#ifdef __FreeBSD__
+# define USE_CLOSEFROM
+#endif /* __FreeBSD__ */
+
+#ifdef HAVE_FDWALK
+# define USE_FDWALK
+#endif /* HAVE_FDWALK */
+
+#ifdef USE_FDWALK
+static int
+_fdwalk_close_func(void *lohi, int fd)
+{
+ int lo = ((int *)lohi)[0];
+ int hi = ((int *)lohi)[1];
+
+ if (fd >= hi) {
+ return 1;
+ }
+ else if (fd >= lo) {
+ /* Ignore errors */
+ (void)close(fd);
+ }
+ return 0;
+}
+#endif /* USE_FDWALK */
+
+/* Closes all file descriptors in [first, last], ignoring errors. */
+void
+_Py_closerange(int first, int last)
+{
+ first = Py_MAX(first, 0);
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef HAVE_CLOSE_RANGE
+ if (close_range(first, last, 0) == 0 || errno != ENOSYS) {
+ /* Any errors encountered while closing file descriptors are ignored;
+ * ENOSYS means no kernel support, though,
+ * so we'll fallback to the other methods. */
+ }
+ else
+#endif /* HAVE_CLOSE_RANGE */
+#ifdef USE_CLOSEFROM
+ if (last >= sysconf(_SC_OPEN_MAX)) {
+ /* Any errors encountered while closing file descriptors are ignored */
+ closefrom(first);
+ }
+ else
+#endif /* USE_CLOSEFROM */
+#ifdef USE_FDWALK
+ {
+ int lohi[2];
+ lohi[0] = first;
+ lohi[1] = last + 1;
+ fdwalk(_fdwalk_close_func, lohi);
+ }
+#else
+ {
+ for (int i = first; i <= last; i++) {
+ /* Ignore errors */
+ (void)close(i);
+ }
+ }
+#endif /* USE_FDWALK */
+ _Py_END_SUPPRESS_IPH
+}
diff --git a/Python/future.c b/Python/future.c
index 3cea4fee78..4b73eb6412 100644
--- a/Python/future.c
+++ b/Python/future.c
@@ -41,7 +41,7 @@ future_check_features(PyFutureFeatures *ff, stmt_ty s, PyObject *filename)
} else if (strcmp(feature, FUTURE_GENERATOR_STOP) == 0) {
continue;
} else if (strcmp(feature, FUTURE_ANNOTATIONS) == 0) {
- ff->ff_features |= CO_FUTURE_ANNOTATIONS;
+ continue;
} else if (strcmp(feature, "braces") == 0) {
PyErr_SetString(PyExc_SyntaxError,
"not a chance");
diff --git a/Python/import.c b/Python/import.c
index 505688400e..26b80f320c 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -902,7 +902,11 @@ PyImport_AddModule(const char *name)
}
-/* Remove name from sys.modules, if it's there. */
+/* Remove name from sys.modules, if it's there.
+ * Can be called with an exception raised.
+ * If fail to remove name a new exception will be chained with the old
+ * exception, otherwise the old exception is preserved.
+ */
static void
remove_module(PyThreadState *tstate, PyObject *name)
{
@@ -910,18 +914,17 @@ remove_module(PyThreadState *tstate, PyObject *name)
_PyErr_Fetch(tstate, &type, &value, &traceback);
PyObject *modules = tstate->interp->modules;
- if (!PyMapping_HasKey(modules, name)) {
- goto out;
+ if (PyDict_CheckExact(modules)) {
+ PyObject *mod = _PyDict_Pop(modules, name, Py_None);
+ Py_XDECREF(mod);
}
- if (PyMapping_DelItem(modules, name) < 0) {
- _PyErr_SetString(tstate, PyExc_RuntimeError,
- "deleting key in sys.modules failed");
- _PyErr_ChainExceptions(type, value, traceback);
- return;
+ else if (PyMapping_DelItem(modules, name) < 0) {
+ if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {
+ _PyErr_Clear(tstate);
+ }
}
-out:
- _PyErr_Restore(tstate, type, value, traceback);
+ _PyErr_ChainExceptions(type, value, traceback);
}
diff --git a/Python/importlib_external.h b/Python/importlib_external.h
index 0ef1b45594..6daddb1fb8 100644
--- a/Python/importlib_external.h
+++ b/Python/importlib_external.h
@@ -285,7 +285,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,218,13,95,119,114,105,116,101,95,97,116,111,109,105,99,
120,0,0,0,115,28,0,0,0,0,5,16,1,6,1,22,
255,4,2,2,3,14,1,40,1,16,1,12,1,2,1,14,
- 1,12,1,6,1,114,69,0,0,0,105,97,13,0,0,114,
+ 1,12,1,6,1,114,69,0,0,0,105,102,13,0,0,114,
28,0,0,0,114,17,0,0,0,115,2,0,0,0,13,10,
90,11,95,95,112,121,99,97,99,104,101,95,95,122,4,111,
112,116,45,122,3,46,112,121,122,4,46,112,121,99,78,41,
@@ -399,7 +399,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
90,15,97,108,109,111,115,116,95,102,105,108,101,110,97,109,
101,218,8,102,105,108,101,110,97,109,101,114,5,0,0,0,
114,5,0,0,0,114,8,0,0,0,218,17,99,97,99,104,
- 101,95,102,114,111,109,95,115,111,117,114,99,101,45,1,0,
+ 101,95,102,114,111,109,95,115,111,117,114,99,101,46,1,0,
0,115,72,0,0,0,0,18,8,1,6,1,2,255,4,2,
8,1,4,1,8,1,12,1,10,1,12,1,16,1,8,1,
8,1,8,1,24,1,8,1,12,1,6,2,8,1,8,1,
@@ -480,7 +480,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,90,9,111,112,116,95,108,101,118,101,108,90,13,98,
97,115,101,95,102,105,108,101,110,97,109,101,114,5,0,0,
0,114,5,0,0,0,114,8,0,0,0,218,17,115,111,117,
- 114,99,101,95,102,114,111,109,95,99,97,99,104,101,116,1,
+ 114,99,101,95,102,114,111,109,95,99,97,99,104,101,117,1,
0,0,115,60,0,0,0,0,9,12,1,8,1,10,1,12,
1,4,1,10,1,12,1,14,1,16,1,4,1,4,1,12,
1,8,1,8,1,2,255,8,2,10,1,8,1,16,1,10,
@@ -516,7 +516,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
120,116,101,110,115,105,111,110,218,11,115,111,117,114,99,101,
95,112,97,116,104,114,5,0,0,0,114,5,0,0,0,114,
8,0,0,0,218,15,95,103,101,116,95,115,111,117,114,99,
- 101,102,105,108,101,156,1,0,0,115,20,0,0,0,0,7,
+ 101,102,105,108,101,157,1,0,0,115,20,0,0,0,0,7,
12,1,4,1,16,1,24,1,4,1,2,1,12,1,16,1,
18,1,114,108,0,0,0,99,1,0,0,0,0,0,0,0,
0,0,0,0,1,0,0,0,8,0,0,0,67,0,0,0,
@@ -529,7 +529,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
101,114,101,0,0,0,114,97,0,0,0,114,82,0,0,0,
114,88,0,0,0,41,1,114,96,0,0,0,114,5,0,0,
0,114,5,0,0,0,114,8,0,0,0,218,11,95,103,101,
- 116,95,99,97,99,104,101,100,175,1,0,0,115,16,0,0,
+ 116,95,99,97,99,104,101,100,176,1,0,0,115,16,0,0,
0,0,1,14,1,2,1,10,1,12,1,6,1,14,1,4,
2,114,112,0,0,0,99,1,0,0,0,0,0,0,0,0,
0,0,0,2,0,0,0,8,0,0,0,67,0,0,0,115,
@@ -543,7 +543,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,233,128,0,0,0,41,3,114,49,0,0,0,114,51,
0,0,0,114,50,0,0,0,41,2,114,44,0,0,0,114,
52,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,
- 0,0,0,218,10,95,99,97,108,99,95,109,111,100,101,187,
+ 0,0,0,218,10,95,99,97,108,99,95,109,111,100,101,188,
1,0,0,115,12,0,0,0,0,2,2,1,14,1,12,1,
10,3,8,1,114,114,0,0,0,99,1,0,0,0,0,0,
0,0,0,0,0,0,3,0,0,0,8,0,0,0,3,0,
@@ -582,7 +582,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
103,115,218,6,107,119,97,114,103,115,169,1,218,6,109,101,
116,104,111,100,114,5,0,0,0,114,8,0,0,0,218,19,
95,99,104,101,99,107,95,110,97,109,101,95,119,114,97,112,
- 112,101,114,207,1,0,0,115,18,0,0,0,0,1,8,1,
+ 112,101,114,208,1,0,0,115,18,0,0,0,0,1,8,1,
8,1,10,1,4,1,8,255,2,1,2,255,6,2,122,40,
95,99,104,101,99,107,95,110,97,109,101,46,60,108,111,99,
97,108,115,62,46,95,99,104,101,99,107,95,110,97,109,101,
@@ -600,7 +600,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
95,100,105,99,116,95,95,218,6,117,112,100,97,116,101,41,
3,90,3,110,101,119,90,3,111,108,100,114,67,0,0,0,
114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,
- 5,95,119,114,97,112,218,1,0,0,115,8,0,0,0,0,
+ 5,95,119,114,97,112,219,1,0,0,115,8,0,0,0,0,
1,8,1,10,1,20,1,122,26,95,99,104,101,99,107,95,
110,97,109,101,46,60,108,111,99,97,108,115,62,46,95,119,
114,97,112,41,1,78,41,3,218,10,95,98,111,111,116,115,
@@ -608,7 +608,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,114,111,114,41,3,114,122,0,0,0,114,123,0,0,0,
114,133,0,0,0,114,5,0,0,0,114,121,0,0,0,114,
8,0,0,0,218,11,95,99,104,101,99,107,95,110,97,109,
- 101,199,1,0,0,115,14,0,0,0,0,8,14,7,2,1,
+ 101,200,1,0,0,115,14,0,0,0,0,8,14,7,2,1,
10,1,12,2,14,5,10,1,114,136,0,0,0,99,2,0,
0,0,0,0,0,0,0,0,0,0,5,0,0,0,6,0,
0,0,67,0,0,0,115,60,0,0,0,124,0,160,0,124,
@@ -636,7 +636,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
111,97,100,101,114,218,8,112,111,114,116,105,111,110,115,218,
3,109,115,103,114,5,0,0,0,114,5,0,0,0,114,8,
0,0,0,218,17,95,102,105,110,100,95,109,111,100,117,108,
- 101,95,115,104,105,109,227,1,0,0,115,10,0,0,0,0,
+ 101,95,115,104,105,109,228,1,0,0,115,10,0,0,0,0,
10,14,1,16,1,4,1,22,1,114,143,0,0,0,99,3,
0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,4,
0,0,0,67,0,0,0,115,166,0,0,0,124,0,100,1,
@@ -703,7 +703,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
99,95,100,101,116,97,105,108,115,90,5,109,97,103,105,99,
114,92,0,0,0,114,2,0,0,0,114,5,0,0,0,114,
5,0,0,0,114,8,0,0,0,218,13,95,99,108,97,115,
- 115,105,102,121,95,112,121,99,244,1,0,0,115,28,0,0,
+ 115,105,102,121,95,112,121,99,245,1,0,0,115,28,0,0,
0,0,16,12,1,8,1,16,1,12,1,16,1,12,1,10,
1,12,1,8,1,16,2,8,1,16,1,16,1,114,152,0,
0,0,99,5,0,0,0,0,0,0,0,0,0,0,0,6,
@@ -758,7 +758,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,116,0,0,0,114,151,0,0,0,114,92,0,0,0,114,
5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,23,
95,118,97,108,105,100,97,116,101,95,116,105,109,101,115,116,
- 97,109,112,95,112,121,99,21,2,0,0,115,16,0,0,0,
+ 97,109,112,95,112,121,99,22,2,0,0,115,16,0,0,0,
0,19,24,1,10,1,12,1,16,1,8,1,22,255,2,2,
114,156,0,0,0,99,4,0,0,0,0,0,0,0,0,0,
0,0,4,0,0,0,4,0,0,0,67,0,0,0,115,42,
@@ -804,7 +804,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
218,11,115,111,117,114,99,101,95,104,97,115,104,114,116,0,
0,0,114,151,0,0,0,114,5,0,0,0,114,5,0,0,
0,114,8,0,0,0,218,18,95,118,97,108,105,100,97,116,
- 101,95,104,97,115,104,95,112,121,99,49,2,0,0,115,12,
+ 101,95,104,97,115,104,95,112,121,99,50,2,0,0,115,12,
0,0,0,0,17,16,1,2,1,8,255,4,2,2,254,114,
158,0,0,0,99,4,0,0,0,0,0,0,0,0,0,0,
0,5,0,0,0,5,0,0,0,67,0,0,0,115,80,0,
@@ -828,7 +828,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,114,116,0,0,0,114,106,0,0,0,114,107,0,
0,0,218,4,99,111,100,101,114,5,0,0,0,114,5,0,
0,0,114,8,0,0,0,218,17,95,99,111,109,112,105,108,
- 101,95,98,121,116,101,99,111,100,101,73,2,0,0,115,18,
+ 101,95,98,121,116,101,99,111,100,101,74,2,0,0,115,18,
0,0,0,0,2,10,1,10,1,12,1,8,1,12,1,4,
2,10,1,4,255,114,165,0,0,0,114,73,0,0,0,99,
3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,
@@ -847,7 +847,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,155,0,0,0,114,26,0,0,0,114,5,0,0,0,114,
5,0,0,0,114,8,0,0,0,218,22,95,99,111,100,101,
95,116,111,95,116,105,109,101,115,116,97,109,112,95,112,121,
- 99,86,2,0,0,115,12,0,0,0,0,2,8,1,14,1,
+ 99,87,2,0,0,115,12,0,0,0,0,2,8,1,14,1,
14,1,14,1,16,1,114,170,0,0,0,84,99,3,0,0,
0,0,0,0,0,0,0,0,0,5,0,0,0,5,0,0,
0,67,0,0,0,115,80,0,0,0,116,0,116,1,131,1,
@@ -865,7 +865,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
7,99,104,101,99,107,101,100,114,26,0,0,0,114,2,0,
0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,
0,218,17,95,99,111,100,101,95,116,111,95,104,97,115,104,
- 95,112,121,99,96,2,0,0,115,14,0,0,0,0,2,8,
+ 95,112,121,99,97,2,0,0,115,14,0,0,0,0,2,8,
1,12,1,14,1,16,1,10,1,16,1,114,171,0,0,0,
99,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,
0,6,0,0,0,67,0,0,0,115,62,0,0,0,100,1,
@@ -892,7 +892,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
108,105,110,101,218,8,101,110,99,111,100,105,110,103,90,15,
110,101,119,108,105,110,101,95,100,101,99,111,100,101,114,114,
5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,13,
- 100,101,99,111,100,101,95,115,111,117,114,99,101,107,2,0,
+ 100,101,99,111,100,101,95,115,111,117,114,99,101,108,2,0,
0,115,10,0,0,0,0,5,8,1,12,1,10,1,12,1,
114,176,0,0,0,169,2,114,140,0,0,0,218,26,115,117,
98,109,111,100,117,108,101,95,115,101,97,114,99,104,95,108,
@@ -954,7 +954,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,90,7,100,105,114,110,97,109,101,114,5,0,0,0,114,
5,0,0,0,114,8,0,0,0,218,23,115,112,101,99,95,
102,114,111,109,95,102,105,108,101,95,108,111,99,97,116,105,
- 111,110,124,2,0,0,115,62,0,0,0,0,12,8,4,4,
+ 111,110,125,2,0,0,115,62,0,0,0,0,12,8,4,4,
1,10,2,2,1,14,1,12,1,6,2,10,8,16,1,6,
3,8,1,14,1,14,1,10,1,6,1,6,2,4,3,8,
2,10,1,2,1,14,1,12,1,6,2,4,1,8,2,6,
@@ -991,7 +991,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
65,76,95,77,65,67,72,73,78,69,41,2,218,3,99,108,
115,114,7,0,0,0,114,5,0,0,0,114,5,0,0,0,
114,8,0,0,0,218,14,95,111,112,101,110,95,114,101,103,
- 105,115,116,114,121,204,2,0,0,115,8,0,0,0,0,2,
+ 105,115,116,114,121,205,2,0,0,115,8,0,0,0,0,2,
2,1,16,1,12,1,122,36,87,105,110,100,111,119,115,82,
101,103,105,115,116,114,121,70,105,110,100,101,114,46,95,111,
112,101,110,95,114,101,103,105,115,116,114,121,99,2,0,0,
@@ -1018,7 +1018,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
95,107,101,121,114,7,0,0,0,90,4,104,107,101,121,218,
8,102,105,108,101,112,97,116,104,114,5,0,0,0,114,5,
0,0,0,114,8,0,0,0,218,16,95,115,101,97,114,99,
- 104,95,114,101,103,105,115,116,114,121,211,2,0,0,115,24,
+ 104,95,114,101,103,105,115,116,114,121,212,2,0,0,115,24,
0,0,0,0,2,6,1,8,2,6,1,6,1,16,255,6,
2,2,1,12,1,46,1,12,1,8,1,122,38,87,105,110,
100,111,119,115,82,101,103,105,115,116,114,121,70,105,110,100,
@@ -1040,7 +1040,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,114,44,0,0,0,218,6,116,97,114,103,101,116,
114,199,0,0,0,114,140,0,0,0,114,189,0,0,0,114,
187,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,
- 0,0,0,218,9,102,105,110,100,95,115,112,101,99,226,2,
+ 0,0,0,218,9,102,105,110,100,95,115,112,101,99,227,2,
0,0,115,28,0,0,0,0,2,10,1,8,1,4,1,2,
1,12,1,12,1,8,1,14,1,14,1,6,1,8,1,2,
254,6,3,122,31,87,105,110,100,111,119,115,82,101,103,105,
@@ -1059,7 +1059,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
78,169,2,114,203,0,0,0,114,140,0,0,0,169,4,114,
193,0,0,0,114,139,0,0,0,114,44,0,0,0,114,187,
0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,
- 0,0,218,11,102,105,110,100,95,109,111,100,117,108,101,242,
+ 0,0,218,11,102,105,110,100,95,109,111,100,117,108,101,243,
2,0,0,115,8,0,0,0,0,7,12,1,8,1,6,2,
122,33,87,105,110,100,111,119,115,82,101,103,105,115,116,114,
121,70,105,110,100,101,114,46,102,105,110,100,95,109,111,100,
@@ -1069,7 +1069,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
11,99,108,97,115,115,109,101,116,104,111,100,114,194,0,0,
0,114,200,0,0,0,114,203,0,0,0,114,206,0,0,0,
114,5,0,0,0,114,5,0,0,0,114,5,0,0,0,114,
- 8,0,0,0,114,191,0,0,0,192,2,0,0,115,28,0,
+ 8,0,0,0,114,191,0,0,0,193,2,0,0,115,28,0,
0,0,8,2,4,3,2,255,2,4,2,255,2,3,4,2,
2,1,10,6,2,1,10,14,2,1,12,15,2,1,114,191,
0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -1105,7 +1105,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,114,139,0,0,0,114,96,0,0,0,90,13,102,105,108,
101,110,97,109,101,95,98,97,115,101,90,9,116,97,105,108,
95,110,97,109,101,114,5,0,0,0,114,5,0,0,0,114,
- 8,0,0,0,114,182,0,0,0,5,3,0,0,115,8,0,
+ 8,0,0,0,114,182,0,0,0,6,3,0,0,115,8,0,
0,0,0,3,18,1,16,1,14,1,122,24,95,76,111,97,
100,101,114,66,97,115,105,99,115,46,105,115,95,112,97,99,
107,97,103,101,99,2,0,0,0,0,0,0,0,0,0,0,
@@ -1116,7 +1116,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
105,111,110,46,78,114,5,0,0,0,169,2,114,118,0,0,
0,114,187,0,0,0,114,5,0,0,0,114,5,0,0,0,
114,8,0,0,0,218,13,99,114,101,97,116,101,95,109,111,
- 100,117,108,101,13,3,0,0,115,2,0,0,0,0,1,122,
+ 100,117,108,101,14,3,0,0,115,2,0,0,0,0,1,122,
27,95,76,111,97,100,101,114,66,97,115,105,99,115,46,99,
114,101,97,116,101,95,109,111,100,117,108,101,99,2,0,0,
0,0,0,0,0,0,0,0,0,3,0,0,0,5,0,0,
@@ -1136,7 +1136,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
99,114,131,0,0,0,41,3,114,118,0,0,0,218,6,109,
111,100,117,108,101,114,164,0,0,0,114,5,0,0,0,114,
5,0,0,0,114,8,0,0,0,218,11,101,120,101,99,95,
- 109,111,100,117,108,101,16,3,0,0,115,12,0,0,0,0,
+ 109,111,100,117,108,101,17,3,0,0,115,12,0,0,0,0,
2,12,1,8,1,6,1,4,255,6,2,122,25,95,76,111,
97,100,101,114,66,97,115,105,99,115,46,101,120,101,99,95,
109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,0,
@@ -1148,13 +1148,13 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
117,108,101,95,115,104,105,109,169,2,114,118,0,0,0,114,
139,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,
0,0,0,218,11,108,111,97,100,95,109,111,100,117,108,101,
- 24,3,0,0,115,2,0,0,0,0,2,122,25,95,76,111,
+ 25,3,0,0,115,2,0,0,0,0,2,122,25,95,76,111,
97,100,101,114,66,97,115,105,99,115,46,108,111,97,100,95,
109,111,100,117,108,101,78,41,8,114,125,0,0,0,114,124,
0,0,0,114,126,0,0,0,114,127,0,0,0,114,182,0,
0,0,114,212,0,0,0,114,217,0,0,0,114,220,0,0,
0,114,5,0,0,0,114,5,0,0,0,114,5,0,0,0,
- 114,8,0,0,0,114,208,0,0,0,0,3,0,0,115,10,
+ 114,8,0,0,0,114,208,0,0,0,1,3,0,0,115,10,
0,0,0,8,2,4,3,8,8,8,3,8,8,114,208,0,
0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,3,0,0,0,64,0,0,0,115,74,0,0,0,
@@ -1179,7 +1179,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
10,32,32,32,32,32,32,32,32,78,41,1,114,50,0,0,
0,169,2,114,118,0,0,0,114,44,0,0,0,114,5,0,
0,0,114,5,0,0,0,114,8,0,0,0,218,10,112,97,
- 116,104,95,109,116,105,109,101,31,3,0,0,115,2,0,0,
+ 116,104,95,109,116,105,109,101,32,3,0,0,115,2,0,0,
0,0,6,122,23,83,111,117,114,99,101,76,111,97,100,101,
114,46,112,97,116,104,95,109,116,105,109,101,99,2,0,0,
0,0,0,0,0,0,0,0,0,2,0,0,0,4,0,0,
@@ -1213,7 +1213,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
108,101,100,46,10,32,32,32,32,32,32,32,32,114,169,0,
0,0,41,1,114,223,0,0,0,114,222,0,0,0,114,5,
0,0,0,114,5,0,0,0,114,8,0,0,0,218,10,112,
- 97,116,104,95,115,116,97,116,115,39,3,0,0,115,2,0,
+ 97,116,104,95,115,116,97,116,115,40,3,0,0,115,2,0,
0,0,0,12,122,23,83,111,117,114,99,101,76,111,97,100,
101,114,46,112,97,116,104,95,115,116,97,116,115,99,4,0,
0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,
@@ -1237,7 +1237,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,114,107,0,0,0,90,10,99,97,99,104,101,95,112,
97,116,104,114,26,0,0,0,114,5,0,0,0,114,5,0,
0,0,114,8,0,0,0,218,15,95,99,97,99,104,101,95,
- 98,121,116,101,99,111,100,101,53,3,0,0,115,2,0,0,
+ 98,121,116,101,99,111,100,101,54,3,0,0,115,2,0,0,
0,0,8,122,28,83,111,117,114,99,101,76,111,97,100,101,
114,46,95,99,97,99,104,101,95,98,121,116,101,99,111,100,
101,99,3,0,0,0,0,0,0,0,0,0,0,0,3,0,
@@ -1254,7 +1254,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
108,101,115,46,10,32,32,32,32,32,32,32,32,78,114,5,
0,0,0,41,3,114,118,0,0,0,114,44,0,0,0,114,
26,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,
- 0,0,0,114,225,0,0,0,63,3,0,0,115,2,0,0,
+ 0,0,0,114,225,0,0,0,64,3,0,0,115,2,0,0,
0,0,1,122,21,83,111,117,114,99,101,76,111,97,100,101,
114,46,115,101,116,95,100,97,116,97,99,2,0,0,0,0,
0,0,0,0,0,0,0,5,0,0,0,10,0,0,0,67,
@@ -1275,7 +1275,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,41,5,114,118,0,0,0,114,139,0,0,0,114,
44,0,0,0,114,174,0,0,0,218,3,101,120,99,114,5,
0,0,0,114,5,0,0,0,114,8,0,0,0,218,10,103,
- 101,116,95,115,111,117,114,99,101,70,3,0,0,115,20,0,
+ 101,116,95,115,111,117,114,99,101,71,3,0,0,115,20,0,
0,0,0,2,10,1,2,1,14,1,14,1,4,1,2,255,
4,1,2,255,24,2,122,23,83,111,117,114,99,101,76,111,
97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,114,
@@ -1298,7 +1298,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,114,26,0,0,0,114,44,0,0,0,114,230,0,0,
0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,
218,14,115,111,117,114,99,101,95,116,111,95,99,111,100,101,
- 80,3,0,0,115,6,0,0,0,0,5,12,1,4,255,122,
+ 81,3,0,0,115,6,0,0,0,0,5,12,1,4,255,122,
27,83,111,117,114,99,101,76,111,97,100,101,114,46,115,111,
117,114,99,101,95,116,111,95,99,111,100,101,99,2,0,0,
0,0,0,0,0,0,0,0,0,15,0,0,0,9,0,0,
@@ -1374,7 +1374,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
115,116,114,26,0,0,0,114,151,0,0,0,114,2,0,0,
0,90,10,98,121,116,101,115,95,100,97,116,97,90,11,99,
111,100,101,95,111,98,106,101,99,116,114,5,0,0,0,114,
- 5,0,0,0,114,8,0,0,0,114,213,0,0,0,88,3,
+ 5,0,0,0,114,8,0,0,0,114,213,0,0,0,89,3,
0,0,115,152,0,0,0,0,7,10,1,4,1,4,1,4,
1,4,1,4,1,2,1,12,1,12,1,12,2,2,1,14,
1,12,1,8,2,12,1,2,1,14,1,12,1,6,3,2,
@@ -1391,7 +1391,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,114,226,0,0,0,114,225,0,0,0,114,229,0,0,
0,114,233,0,0,0,114,213,0,0,0,114,5,0,0,0,
114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,
- 221,0,0,0,29,3,0,0,115,14,0,0,0,8,2,8,
+ 221,0,0,0,30,3,0,0,115,14,0,0,0,8,2,8,
8,8,14,8,10,8,7,8,10,14,8,114,221,0,0,0,
99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,4,0,0,0,0,0,0,0,115,92,0,0,0,101,0,
@@ -1418,7 +1418,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
32,32,32,32,32,32,32,102,105,110,100,101,114,46,78,114,
159,0,0,0,41,3,114,118,0,0,0,114,139,0,0,0,
114,44,0,0,0,114,5,0,0,0,114,5,0,0,0,114,
- 8,0,0,0,114,209,0,0,0,178,3,0,0,115,4,0,
+ 8,0,0,0,114,209,0,0,0,179,3,0,0,115,4,0,
0,0,0,3,6,1,122,19,70,105,108,101,76,111,97,100,
101,114,46,95,95,105,110,105,116,95,95,99,2,0,0,0,
0,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,
@@ -1427,7 +1427,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,114,109,0,0,0,169,2,218,9,95,95,99,108,97,115,
115,95,95,114,131,0,0,0,169,2,114,118,0,0,0,90,
5,111,116,104,101,114,114,5,0,0,0,114,5,0,0,0,
- 114,8,0,0,0,218,6,95,95,101,113,95,95,184,3,0,
+ 114,8,0,0,0,218,6,95,95,101,113,95,95,185,3,0,
0,115,6,0,0,0,0,1,12,1,10,255,122,17,70,105,
108,101,76,111,97,100,101,114,46,95,95,101,113,95,95,99,
1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
@@ -1436,7 +1436,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,114,109,0,0,0,169,3,218,4,104,97,115,104,114,116,
0,0,0,114,44,0,0,0,169,1,114,118,0,0,0,114,
5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,8,
- 95,95,104,97,115,104,95,95,188,3,0,0,115,2,0,0,
+ 95,95,104,97,115,104,95,95,189,3,0,0,115,2,0,0,
0,0,1,122,19,70,105,108,101,76,111,97,100,101,114,46,
95,95,104,97,115,104,95,95,99,2,0,0,0,0,0,0,
0,0,0,0,0,2,0,0,0,3,0,0,0,3,0,0,
@@ -1450,7 +1450,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
101,97,100,46,10,10,32,32,32,32,32,32,32,32,41,3,
218,5,115,117,112,101,114,114,239,0,0,0,114,220,0,0,
0,114,219,0,0,0,169,1,114,241,0,0,0,114,5,0,
- 0,0,114,8,0,0,0,114,220,0,0,0,191,3,0,0,
+ 0,0,114,8,0,0,0,114,220,0,0,0,192,3,0,0,
115,2,0,0,0,0,10,122,22,70,105,108,101,76,111,97,
100,101,114,46,108,111,97,100,95,109,111,100,117,108,101,99,
2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,
@@ -1460,7 +1460,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
117,114,99,101,32,102,105,108,101,32,97,115,32,102,111,117,
110,100,32,98,121,32,116,104,101,32,102,105,110,100,101,114,
46,114,48,0,0,0,114,219,0,0,0,114,5,0,0,0,
- 114,5,0,0,0,114,8,0,0,0,114,179,0,0,0,203,
+ 114,5,0,0,0,114,8,0,0,0,114,179,0,0,0,204,
3,0,0,115,2,0,0,0,0,3,122,23,70,105,108,101,
76,111,97,100,101,114,46,103,101,116,95,102,105,108,101,110,
97,109,101,99,2,0,0,0,0,0,0,0,0,0,0,0,
@@ -1482,7 +1482,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
84,0,0,0,90,4,114,101,97,100,114,65,0,0,0,41,
3,114,118,0,0,0,114,44,0,0,0,114,68,0,0,0,
114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,
- 227,0,0,0,208,3,0,0,115,10,0,0,0,0,2,14,
+ 227,0,0,0,209,3,0,0,115,10,0,0,0,0,2,14,
1,16,1,40,2,14,1,122,19,70,105,108,101,76,111,97,
100,101,114,46,103,101,116,95,100,97,116,97,99,2,0,0,
0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,
@@ -1494,7 +1494,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,118,0,0,0,114,216,0,0,0,114,253,0,0,0,114,
5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,19,
103,101,116,95,114,101,115,111,117,114,99,101,95,114,101,97,
- 100,101,114,217,3,0,0,115,4,0,0,0,0,2,12,1,
+ 100,101,114,218,3,0,0,115,4,0,0,0,0,2,12,1,
122,30,70,105,108,101,76,111,97,100,101,114,46,103,101,116,
95,114,101,115,111,117,114,99,101,95,114,101,97,100,101,114,
41,13,114,125,0,0,0,114,124,0,0,0,114,126,0,0,
@@ -1503,7 +1503,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
179,0,0,0,114,227,0,0,0,114,254,0,0,0,90,13,
95,95,99,108,97,115,115,99,101,108,108,95,95,114,5,0,
0,0,114,5,0,0,0,114,249,0,0,0,114,8,0,0,
- 0,114,239,0,0,0,173,3,0,0,115,22,0,0,0,8,
+ 0,114,239,0,0,0,174,3,0,0,115,22,0,0,0,8,
2,4,3,8,6,8,4,8,3,2,1,14,11,2,1,10,
4,8,9,2,1,114,239,0,0,0,99,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,64,
@@ -1525,7 +1525,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
3,114,49,0,0,0,218,8,115,116,95,109,116,105,109,101,
90,7,115,116,95,115,105,122,101,41,3,114,118,0,0,0,
114,44,0,0,0,114,238,0,0,0,114,5,0,0,0,114,
- 5,0,0,0,114,8,0,0,0,114,224,0,0,0,227,3,
+ 5,0,0,0,114,8,0,0,0,114,224,0,0,0,228,3,
0,0,115,4,0,0,0,0,2,8,1,122,27,83,111,117,
114,99,101,70,105,108,101,76,111,97,100,101,114,46,112,97,
116,104,95,115,116,97,116,115,99,4,0,0,0,0,0,0,
@@ -1536,7 +1536,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,114,225,0,0,0,41,5,114,118,0,0,0,114,107,0,
0,0,114,106,0,0,0,114,26,0,0,0,114,52,0,0,
0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,
- 114,226,0,0,0,232,3,0,0,115,4,0,0,0,0,2,
+ 114,226,0,0,0,233,3,0,0,115,4,0,0,0,0,2,
8,1,122,32,83,111,117,114,99,101,70,105,108,101,76,111,
97,100,101,114,46,95,99,97,99,104,101,95,98,121,116,101,
99,111,100,101,114,60,0,0,0,114,1,1,0,0,99,3,
@@ -1571,7 +1571,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,218,6,112,97,114,101,110,116,114,96,0,0,0,114,37,
0,0,0,114,33,0,0,0,114,228,0,0,0,114,5,0,
0,0,114,5,0,0,0,114,8,0,0,0,114,225,0,0,
- 0,237,3,0,0,115,46,0,0,0,0,2,12,1,4,2,
+ 0,238,3,0,0,115,46,0,0,0,0,2,12,1,4,2,
12,1,12,1,12,2,12,1,10,1,2,1,14,1,12,2,
8,1,14,3,6,1,4,255,4,2,26,1,2,1,12,1,
16,1,14,2,8,1,2,255,122,25,83,111,117,114,99,101,
@@ -1580,7 +1580,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,126,0,0,0,114,127,0,0,0,114,224,0,0,0,114,
226,0,0,0,114,225,0,0,0,114,5,0,0,0,114,5,
0,0,0,114,5,0,0,0,114,8,0,0,0,114,255,0,
- 0,0,223,3,0,0,115,8,0,0,0,8,2,4,2,8,
+ 0,0,224,3,0,0,115,8,0,0,0,8,2,4,2,8,
5,8,5,114,255,0,0,0,99,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,2,0,0,0,64,0,0,
0,115,32,0,0,0,101,0,90,1,100,0,90,2,100,1,
@@ -1602,7 +1602,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,41,5,114,118,0,0,0,114,139,0,0,0,114,
44,0,0,0,114,26,0,0,0,114,151,0,0,0,114,5,
0,0,0,114,5,0,0,0,114,8,0,0,0,114,213,0,
- 0,0,16,4,0,0,115,22,0,0,0,0,1,10,1,10,
+ 0,0,17,4,0,0,115,22,0,0,0,0,1,10,1,10,
4,2,1,2,254,6,4,12,1,2,1,14,1,2,1,2,
253,122,29,83,111,117,114,99,101,108,101,115,115,70,105,108,
101,76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,
@@ -1612,14 +1612,14 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
101,32,97,115,32,116,104,101,114,101,32,105,115,32,110,111,
32,115,111,117,114,99,101,32,99,111,100,101,46,78,114,5,
0,0,0,114,219,0,0,0,114,5,0,0,0,114,5,0,
- 0,0,114,8,0,0,0,114,229,0,0,0,32,4,0,0,
+ 0,0,114,8,0,0,0,114,229,0,0,0,33,4,0,0,
115,2,0,0,0,0,2,122,31,83,111,117,114,99,101,108,
101,115,115,70,105,108,101,76,111,97,100,101,114,46,103,101,
116,95,115,111,117,114,99,101,78,41,6,114,125,0,0,0,
114,124,0,0,0,114,126,0,0,0,114,127,0,0,0,114,
213,0,0,0,114,229,0,0,0,114,5,0,0,0,114,5,
0,0,0,114,5,0,0,0,114,8,0,0,0,114,5,1,
- 0,0,12,4,0,0,115,6,0,0,0,8,2,4,2,8,
+ 0,0,13,4,0,0,115,6,0,0,0,8,2,4,2,8,
16,114,5,1,0,0,99,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115,
92,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,
@@ -1640,7 +1640,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
100,0,83,0,114,109,0,0,0,114,159,0,0,0,41,3,
114,118,0,0,0,114,116,0,0,0,114,44,0,0,0,114,
5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,209,
- 0,0,0,49,4,0,0,115,4,0,0,0,0,1,6,1,
+ 0,0,0,50,4,0,0,115,4,0,0,0,0,1,6,1,
122,28,69,120,116,101,110,115,105,111,110,70,105,108,101,76,
111,97,100,101,114,46,95,95,105,110,105,116,95,95,99,2,
0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,2,
@@ -1648,7 +1648,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
124,1,106,0,107,2,111,22,124,0,106,1,124,1,106,1,
107,2,83,0,114,109,0,0,0,114,240,0,0,0,114,242,
0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,
- 0,0,114,243,0,0,0,53,4,0,0,115,6,0,0,0,
+ 0,0,114,243,0,0,0,54,4,0,0,115,6,0,0,0,
0,1,12,1,10,255,122,26,69,120,116,101,110,115,105,111,
110,70,105,108,101,76,111,97,100,101,114,46,95,95,101,113,
95,95,99,1,0,0,0,0,0,0,0,0,0,0,0,1,
@@ -1656,7 +1656,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
116,0,124,0,106,1,131,1,116,0,124,0,106,2,131,1,
65,0,83,0,114,109,0,0,0,114,244,0,0,0,114,246,
0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,
- 0,0,114,247,0,0,0,57,4,0,0,115,2,0,0,0,
+ 0,0,114,247,0,0,0,58,4,0,0,115,2,0,0,0,
0,1,122,28,69,120,116,101,110,115,105,111,110,70,105,108,
101,76,111,97,100,101,114,46,95,95,104,97,115,104,95,95,
99,2,0,0,0,0,0,0,0,0,0,0,0,3,0,0,
@@ -1673,7 +1673,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
110,97,109,105,99,114,149,0,0,0,114,116,0,0,0,114,
44,0,0,0,41,3,114,118,0,0,0,114,187,0,0,0,
114,216,0,0,0,114,5,0,0,0,114,5,0,0,0,114,
- 8,0,0,0,114,212,0,0,0,60,4,0,0,115,14,0,
+ 8,0,0,0,114,212,0,0,0,61,4,0,0,115,14,0,
0,0,0,2,4,1,6,255,4,2,6,1,8,255,4,2,
122,33,69,120,116,101,110,115,105,111,110,70,105,108,101,76,
111,97,100,101,114,46,99,114,101,97,116,101,95,109,111,100,
@@ -1691,7 +1691,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
99,114,149,0,0,0,114,116,0,0,0,114,44,0,0,0,
169,2,114,118,0,0,0,114,216,0,0,0,114,5,0,0,
0,114,5,0,0,0,114,8,0,0,0,114,217,0,0,0,
- 68,4,0,0,115,8,0,0,0,0,2,14,1,6,1,8,
+ 69,4,0,0,115,8,0,0,0,0,2,14,1,6,1,8,
255,122,31,69,120,116,101,110,115,105,111,110,70,105,108,101,
76,111,97,100,101,114,46,101,120,101,99,95,109,111,100,117,
108,101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,
@@ -1709,7 +1709,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,169,2,114,32,0,0,0,218,6,115,117,102,102,
105,120,169,1,90,9,102,105,108,101,95,110,97,109,101,114,
5,0,0,0,114,8,0,0,0,218,9,60,103,101,110,101,
- 120,112,114,62,77,4,0,0,115,4,0,0,0,4,1,2,
+ 120,112,114,62,78,4,0,0,115,4,0,0,0,4,1,2,
255,122,49,69,120,116,101,110,115,105,111,110,70,105,108,101,
76,111,97,100,101,114,46,105,115,95,112,97,99,107,97,103,
101,46,60,108,111,99,97,108,115,62,46,60,103,101,110,101,
@@ -1717,7 +1717,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
218,3,97,110,121,218,18,69,88,84,69,78,83,73,79,78,
95,83,85,70,70,73,88,69,83,114,219,0,0,0,114,5,
0,0,0,114,9,1,0,0,114,8,0,0,0,114,182,0,
- 0,0,74,4,0,0,115,8,0,0,0,0,2,14,1,12,
+ 0,0,75,4,0,0,115,8,0,0,0,0,2,14,1,12,
1,2,255,122,30,69,120,116,101,110,115,105,111,110,70,105,
108,101,76,111,97,100,101,114,46,105,115,95,112,97,99,107,
97,103,101,99,2,0,0,0,0,0,0,0,0,0,0,0,
@@ -1728,7 +1728,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
111,116,32,99,114,101,97,116,101,32,97,32,99,111,100,101,
32,111,98,106,101,99,116,46,78,114,5,0,0,0,114,219,
0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,
- 0,0,114,213,0,0,0,80,4,0,0,115,2,0,0,0,
+ 0,0,114,213,0,0,0,81,4,0,0,115,2,0,0,0,
0,2,122,28,69,120,116,101,110,115,105,111,110,70,105,108,
101,76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,
99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,
@@ -1738,14 +1738,14 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
111,100,117,108,101,115,32,104,97,118,101,32,110,111,32,115,
111,117,114,99,101,32,99,111,100,101,46,78,114,5,0,0,
0,114,219,0,0,0,114,5,0,0,0,114,5,0,0,0,
- 114,8,0,0,0,114,229,0,0,0,84,4,0,0,115,2,
+ 114,8,0,0,0,114,229,0,0,0,85,4,0,0,115,2,
0,0,0,0,2,122,30,69,120,116,101,110,115,105,111,110,
70,105,108,101,76,111,97,100,101,114,46,103,101,116,95,115,
111,117,114,99,101,99,2,0,0,0,0,0,0,0,0,0,
0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,6,
0,0,0,124,0,106,0,83,0,114,250,0,0,0,114,48,
0,0,0,114,219,0,0,0,114,5,0,0,0,114,5,0,
- 0,0,114,8,0,0,0,114,179,0,0,0,88,4,0,0,
+ 0,0,114,8,0,0,0,114,179,0,0,0,89,4,0,0,
115,2,0,0,0,0,3,122,32,69,120,116,101,110,115,105,
111,110,70,105,108,101,76,111,97,100,101,114,46,103,101,116,
95,102,105,108,101,110,97,109,101,78,41,14,114,125,0,0,
@@ -1754,7 +1754,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
212,0,0,0,114,217,0,0,0,114,182,0,0,0,114,213,
0,0,0,114,229,0,0,0,114,136,0,0,0,114,179,0,
0,0,114,5,0,0,0,114,5,0,0,0,114,5,0,0,
- 0,114,8,0,0,0,114,252,0,0,0,41,4,0,0,115,
+ 0,114,8,0,0,0,114,252,0,0,0,42,4,0,0,115,
22,0,0,0,8,2,4,6,8,4,8,4,8,3,8,8,
8,6,8,6,8,4,8,4,2,1,114,252,0,0,0,99,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -1797,7 +1797,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,169,4,114,118,0,0,0,114,116,0,0,0,114,44,0,
0,0,90,11,112,97,116,104,95,102,105,110,100,101,114,114,
5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,209,
- 0,0,0,101,4,0,0,115,8,0,0,0,0,1,6,1,
+ 0,0,0,102,4,0,0,115,8,0,0,0,0,1,6,1,
6,1,14,1,122,23,95,78,97,109,101,115,112,97,99,101,
80,97,116,104,46,95,95,105,110,105,116,95,95,99,1,0,
0,0,0,0,0,0,0,0,0,0,4,0,0,0,3,0,
@@ -1814,7 +1814,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
4,114,118,0,0,0,114,4,1,0,0,218,3,100,111,116,
90,2,109,101,114,5,0,0,0,114,5,0,0,0,114,8,
0,0,0,218,23,95,102,105,110,100,95,112,97,114,101,110,
- 116,95,112,97,116,104,95,110,97,109,101,115,107,4,0,0,
+ 116,95,112,97,116,104,95,110,97,109,101,115,108,4,0,0,
115,8,0,0,0,0,2,18,1,8,2,4,3,122,38,95,
78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,102,
105,110,100,95,112,97,114,101,110,116,95,112,97,116,104,95,
@@ -1827,7 +1827,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,118,0,0,0,90,18,112,97,114,101,110,116,95,109,111,
100,117,108,101,95,110,97,109,101,90,14,112,97,116,104,95,
97,116,116,114,95,110,97,109,101,114,5,0,0,0,114,5,
- 0,0,0,114,8,0,0,0,114,16,1,0,0,117,4,0,
+ 0,0,0,114,8,0,0,0,114,16,1,0,0,118,4,0,
0,115,4,0,0,0,0,1,12,1,122,31,95,78,97,109,
101,115,112,97,99,101,80,97,116,104,46,95,103,101,116,95,
112,97,114,101,110,116,95,112,97,116,104,99,1,0,0,0,
@@ -1843,7 +1843,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,114,15,1,0,0,41,3,114,118,0,0,0,90,
11,112,97,114,101,110,116,95,112,97,116,104,114,187,0,0,
0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,
- 218,12,95,114,101,99,97,108,99,117,108,97,116,101,121,4,
+ 218,12,95,114,101,99,97,108,99,117,108,97,116,101,122,4,
0,0,115,16,0,0,0,0,2,12,1,10,1,14,3,18,
1,6,1,8,1,6,1,122,27,95,78,97,109,101,115,112,
97,99,101,80,97,116,104,46,95,114,101,99,97,108,99,117,
@@ -1852,7 +1852,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,116,0,124,0,160,1,161,0,131,1,83,0,114,109,
0,0,0,41,2,218,4,105,116,101,114,114,23,1,0,0,
114,246,0,0,0,114,5,0,0,0,114,5,0,0,0,114,
- 8,0,0,0,218,8,95,95,105,116,101,114,95,95,134,4,
+ 8,0,0,0,218,8,95,95,105,116,101,114,95,95,135,4,
0,0,115,2,0,0,0,0,1,122,23,95,78,97,109,101,
115,112,97,99,101,80,97,116,104,46,95,95,105,116,101,114,
95,95,99,2,0,0,0,0,0,0,0,0,0,0,0,2,
@@ -1861,7 +1861,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,169,1,114,23,1,0,0,41,2,114,118,0,0,0,218,
5,105,110,100,101,120,114,5,0,0,0,114,5,0,0,0,
114,8,0,0,0,218,11,95,95,103,101,116,105,116,101,109,
- 95,95,137,4,0,0,115,2,0,0,0,0,1,122,26,95,
+ 95,95,138,4,0,0,115,2,0,0,0,0,1,122,26,95,
78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,95,
103,101,116,105,116,101,109,95,95,99,3,0,0,0,0,0,
0,0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,
@@ -1869,7 +1869,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,100,0,83,0,114,109,0,0,0,41,1,114,15,1,0,
0,41,3,114,118,0,0,0,114,27,1,0,0,114,44,0,
0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,
- 0,218,11,95,95,115,101,116,105,116,101,109,95,95,140,4,
+ 0,218,11,95,95,115,101,116,105,116,101,109,95,95,141,4,
0,0,115,2,0,0,0,0,1,122,26,95,78,97,109,101,
115,112,97,99,101,80,97,116,104,46,95,95,115,101,116,105,
116,101,109,95,95,99,1,0,0,0,0,0,0,0,0,0,
@@ -1877,7 +1877,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,116,0,124,0,160,1,161,0,131,1,83,0,114,
109,0,0,0,41,2,114,23,0,0,0,114,23,1,0,0,
114,246,0,0,0,114,5,0,0,0,114,5,0,0,0,114,
- 8,0,0,0,218,7,95,95,108,101,110,95,95,143,4,0,
+ 8,0,0,0,218,7,95,95,108,101,110,95,95,144,4,0,
0,115,2,0,0,0,0,1,122,22,95,78,97,109,101,115,
112,97,99,101,80,97,116,104,46,95,95,108,101,110,95,95,
99,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
@@ -1886,7 +1886,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
78,97,109,101,115,112,97,99,101,80,97,116,104,40,123,33,
114,125,41,41,2,114,62,0,0,0,114,15,1,0,0,114,
246,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,
- 0,0,0,218,8,95,95,114,101,112,114,95,95,146,4,0,
+ 0,0,0,218,8,95,95,114,101,112,114,95,95,147,4,0,
0,115,2,0,0,0,0,1,122,23,95,78,97,109,101,115,
112,97,99,101,80,97,116,104,46,95,95,114,101,112,114,95,
95,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,
@@ -1894,7 +1894,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
1,124,0,160,0,161,0,118,0,83,0,114,109,0,0,0,
114,26,1,0,0,169,2,114,118,0,0,0,218,4,105,116,
101,109,114,5,0,0,0,114,5,0,0,0,114,8,0,0,
- 0,218,12,95,95,99,111,110,116,97,105,110,115,95,95,149,
+ 0,218,12,95,95,99,111,110,116,97,105,110,115,95,95,150,
4,0,0,115,2,0,0,0,0,1,122,27,95,78,97,109,
101,115,112,97,99,101,80,97,116,104,46,95,95,99,111,110,
116,97,105,110,115,95,95,99,2,0,0,0,0,0,0,0,
@@ -1902,7 +1902,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
115,16,0,0,0,124,0,106,0,160,1,124,1,161,1,1,
0,100,0,83,0,114,109,0,0,0,41,2,114,15,1,0,
0,114,186,0,0,0,114,32,1,0,0,114,5,0,0,0,
- 114,5,0,0,0,114,8,0,0,0,114,186,0,0,0,152,
+ 114,5,0,0,0,114,8,0,0,0,114,186,0,0,0,153,
4,0,0,115,2,0,0,0,0,1,122,21,95,78,97,109,
101,115,112,97,99,101,80,97,116,104,46,97,112,112,101,110,
100,78,41,15,114,125,0,0,0,114,124,0,0,0,114,126,
@@ -1911,7 +1911,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,114,28,1,0,0,114,29,1,0,0,114,30,1,0,0,
114,31,1,0,0,114,34,1,0,0,114,186,0,0,0,114,
5,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,
- 0,0,0,114,13,1,0,0,94,4,0,0,115,24,0,0,
+ 0,0,0,114,13,1,0,0,95,4,0,0,115,24,0,0,
0,8,1,4,6,8,6,8,10,8,4,8,13,8,3,8,
3,8,3,8,3,8,3,8,3,114,13,1,0,0,99,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,
@@ -1927,7 +1927,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
124,1,124,2,124,3,131,3,124,0,95,1,100,0,83,0,
114,109,0,0,0,41,2,114,13,1,0,0,114,15,1,0,
0,114,19,1,0,0,114,5,0,0,0,114,5,0,0,0,
- 114,8,0,0,0,114,209,0,0,0,158,4,0,0,115,2,
+ 114,8,0,0,0,114,209,0,0,0,159,4,0,0,115,2,
0,0,0,0,1,122,25,95,78,97,109,101,115,112,97,99,
101,76,111,97,100,101,114,46,95,95,105,110,105,116,95,95,
99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,
@@ -1945,20 +1945,20 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,114,125,0,0,0,41,2,114,193,0,0,0,114,
216,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,
0,0,0,218,11,109,111,100,117,108,101,95,114,101,112,114,
- 161,4,0,0,115,2,0,0,0,0,7,122,28,95,78,97,
+ 162,4,0,0,115,2,0,0,0,0,7,122,28,95,78,97,
109,101,115,112,97,99,101,76,111,97,100,101,114,46,109,111,
100,117,108,101,95,114,101,112,114,99,2,0,0,0,0,0,
0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,
0,0,115,4,0,0,0,100,1,83,0,41,2,78,84,114,
5,0,0,0,114,219,0,0,0,114,5,0,0,0,114,5,
- 0,0,0,114,8,0,0,0,114,182,0,0,0,170,4,0,
+ 0,0,0,114,8,0,0,0,114,182,0,0,0,171,4,0,
0,115,2,0,0,0,0,1,122,27,95,78,97,109,101,115,
112,97,99,101,76,111,97,100,101,114,46,105,115,95,112,97,
99,107,97,103,101,99,2,0,0,0,0,0,0,0,0,0,
0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4,
0,0,0,100,1,83,0,41,2,78,114,40,0,0,0,114,
5,0,0,0,114,219,0,0,0,114,5,0,0,0,114,5,
- 0,0,0,114,8,0,0,0,114,229,0,0,0,173,4,0,
+ 0,0,0,114,8,0,0,0,114,229,0,0,0,174,4,0,
0,115,2,0,0,0,0,1,122,27,95,78,97,109,101,115,
112,97,99,101,76,111,97,100,101,114,46,103,101,116,95,115,
111,117,114,99,101,99,2,0,0,0,0,0,0,0,0,0,
@@ -1968,20 +1968,20 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,105,110,103,62,114,215,0,0,0,84,41,1,114,231,0,
0,0,41,1,114,232,0,0,0,114,219,0,0,0,114,5,
0,0,0,114,5,0,0,0,114,8,0,0,0,114,213,0,
- 0,0,176,4,0,0,115,2,0,0,0,0,1,122,25,95,
+ 0,0,177,4,0,0,115,2,0,0,0,0,1,122,25,95,
78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,46,
103,101,116,95,99,111,100,101,99,2,0,0,0,0,0,0,
0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,
0,115,4,0,0,0,100,1,83,0,114,210,0,0,0,114,
5,0,0,0,114,211,0,0,0,114,5,0,0,0,114,5,
- 0,0,0,114,8,0,0,0,114,212,0,0,0,179,4,0,
+ 0,0,0,114,8,0,0,0,114,212,0,0,0,180,4,0,
0,115,2,0,0,0,0,1,122,30,95,78,97,109,101,115,
112,97,99,101,76,111,97,100,101,114,46,99,114,101,97,116,
101,95,109,111,100,117,108,101,99,2,0,0,0,0,0,0,
0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,
0,115,4,0,0,0,100,0,83,0,114,109,0,0,0,114,
5,0,0,0,114,6,1,0,0,114,5,0,0,0,114,5,
- 0,0,0,114,8,0,0,0,114,217,0,0,0,182,4,0,
+ 0,0,0,114,8,0,0,0,114,217,0,0,0,183,4,0,
0,115,2,0,0,0,0,1,122,28,95,78,97,109,101,115,
112,97,99,101,76,111,97,100,101,114,46,101,120,101,99,95,
109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,0,
@@ -1999,7 +1999,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
116,104,32,112,97,116,104,32,123,33,114,125,41,4,114,134,
0,0,0,114,149,0,0,0,114,15,1,0,0,114,218,0,
0,0,114,219,0,0,0,114,5,0,0,0,114,5,0,0,
- 0,114,8,0,0,0,114,220,0,0,0,185,4,0,0,115,
+ 0,114,8,0,0,0,114,220,0,0,0,186,4,0,0,115,
8,0,0,0,0,7,6,1,4,255,4,2,122,28,95,78,
97,109,101,115,112,97,99,101,76,111,97,100,101,114,46,108,
111,97,100,95,109,111,100,117,108,101,78,41,12,114,125,0,
@@ -2008,7 +2008,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,229,0,0,0,114,213,0,0,0,114,212,0,0,0,114,
217,0,0,0,114,220,0,0,0,114,5,0,0,0,114,5,
0,0,0,114,5,0,0,0,114,8,0,0,0,114,35,1,
- 0,0,157,4,0,0,115,18,0,0,0,8,1,8,3,2,
+ 0,0,158,4,0,0,115,18,0,0,0,8,1,8,3,2,
1,10,8,8,3,8,3,8,3,8,3,8,3,114,35,1,
0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,4,0,0,0,64,0,0,0,115,118,0,0,0,
@@ -2045,7 +2045,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,128,0,0,0,114,38,1,0,0,41,3,114,193,0,0,
0,114,116,0,0,0,218,6,102,105,110,100,101,114,114,5,
0,0,0,114,5,0,0,0,114,8,0,0,0,114,38,1,
- 0,0,203,4,0,0,115,10,0,0,0,0,4,22,1,8,
+ 0,0,204,4,0,0,115,10,0,0,0,0,4,22,1,8,
1,10,1,10,1,122,28,80,97,116,104,70,105,110,100,101,
114,46,105,110,118,97,108,105,100,97,116,101,95,99,97,99,
104,101,115,99,2,0,0,0,0,0,0,0,0,0,0,0,
@@ -2065,7 +2065,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
117,0,0,0,41,3,114,193,0,0,0,114,44,0,0,0,
90,4,104,111,111,107,114,5,0,0,0,114,5,0,0,0,
114,8,0,0,0,218,11,95,112,97,116,104,95,104,111,111,
- 107,115,213,4,0,0,115,16,0,0,0,0,3,16,1,12,
+ 107,115,214,4,0,0,115,16,0,0,0,0,3,16,1,12,
1,10,1,2,1,14,1,12,1,10,2,122,22,80,97,116,
104,70,105,110,100,101,114,46,95,112,97,116,104,95,104,111,
111,107,115,99,2,0,0,0,0,0,0,0,0,0,0,0,
@@ -2096,7 +2096,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,114,111,114,114,44,1,0,0,41,3,114,193,0,0,0,
114,44,0,0,0,114,42,1,0,0,114,5,0,0,0,114,
5,0,0,0,114,8,0,0,0,218,20,95,112,97,116,104,
- 95,105,109,112,111,114,116,101,114,95,99,97,99,104,101,226,
+ 95,105,109,112,111,114,116,101,114,95,99,97,99,104,101,227,
4,0,0,115,22,0,0,0,0,8,8,1,2,1,12,1,
12,3,8,1,2,1,14,1,12,1,10,1,16,1,122,31,
80,97,116,104,70,105,110,100,101,114,46,95,112,97,116,104,
@@ -2114,7 +2114,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,114,139,0,0,0,114,42,1,0,0,114,140,0,
0,0,114,141,0,0,0,114,187,0,0,0,114,5,0,0,
0,114,5,0,0,0,114,8,0,0,0,218,16,95,108,101,
- 103,97,99,121,95,103,101,116,95,115,112,101,99,248,4,0,
+ 103,97,99,121,95,103,101,116,95,115,112,101,99,249,4,0,
0,115,18,0,0,0,0,4,10,1,16,2,10,1,4,1,
8,1,12,1,12,1,6,1,122,27,80,97,116,104,70,105,
110,100,101,114,46,95,108,101,103,97,99,121,95,103,101,116,
@@ -2146,7 +2146,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
97,116,104,90,5,101,110,116,114,121,114,42,1,0,0,114,
187,0,0,0,114,141,0,0,0,114,5,0,0,0,114,5,
0,0,0,114,8,0,0,0,218,9,95,103,101,116,95,115,
- 112,101,99,7,5,0,0,115,40,0,0,0,0,5,4,1,
+ 112,101,99,8,5,0,0,115,40,0,0,0,0,5,4,1,
8,1,14,1,2,1,10,1,8,1,10,1,14,2,12,1,
8,1,2,1,10,1,8,1,6,1,8,1,8,5,12,2,
12,1,6,1,122,20,80,97,116,104,70,105,110,100,101,114,
@@ -2173,7 +2173,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
193,0,0,0,114,139,0,0,0,114,44,0,0,0,114,202,
0,0,0,114,187,0,0,0,114,50,1,0,0,114,5,0,
0,0,114,5,0,0,0,114,8,0,0,0,114,203,0,0,
- 0,39,5,0,0,115,26,0,0,0,0,6,8,1,6,1,
+ 0,40,5,0,0,115,26,0,0,0,0,6,8,1,6,1,
14,1,8,1,4,1,10,1,6,1,4,3,6,1,16,1,
4,2,4,2,122,20,80,97,116,104,70,105,110,100,101,114,
46,102,105,110,100,95,115,112,101,99,99,3,0,0,0,0,
@@ -2193,7 +2193,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
41,32,105,110,115,116,101,97,100,46,10,10,32,32,32,32,
32,32,32,32,78,114,204,0,0,0,114,205,0,0,0,114,
5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,206,
- 0,0,0,63,5,0,0,115,8,0,0,0,0,8,12,1,
+ 0,0,0,64,5,0,0,115,8,0,0,0,0,8,12,1,
8,1,4,1,122,22,80,97,116,104,70,105,110,100,101,114,
46,102,105,110,100,95,109,111,100,117,108,101,99,1,0,0,
0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,0,
@@ -2225,7 +2225,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
98,117,116,105,111,110,115,41,4,114,193,0,0,0,114,119,
0,0,0,114,120,0,0,0,114,52,1,0,0,114,5,0,
0,0,114,5,0,0,0,114,8,0,0,0,114,53,1,0,
- 0,76,5,0,0,115,4,0,0,0,0,10,12,1,122,29,
+ 0,77,5,0,0,115,4,0,0,0,0,10,12,1,122,29,
80,97,116,104,70,105,110,100,101,114,46,102,105,110,100,95,
100,105,115,116,114,105,98,117,116,105,111,110,115,41,1,78,
41,2,78,78,41,1,78,41,13,114,125,0,0,0,114,124,
@@ -2234,7 +2234,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,114,48,1,0,0,114,51,1,0,0,114,203,0,0,0,
114,206,0,0,0,114,53,1,0,0,114,5,0,0,0,114,
5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,37,
- 1,0,0,199,4,0,0,115,34,0,0,0,8,2,4,2,
+ 1,0,0,200,4,0,0,115,34,0,0,0,8,2,4,2,
2,1,10,9,2,1,10,12,2,1,10,21,2,1,10,14,
2,1,12,31,2,1,12,23,2,1,12,12,2,1,114,37,
1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -2279,7 +2279,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
2,86,0,1,0,113,2,100,0,83,0,114,109,0,0,0,
114,5,0,0,0,114,7,1,0,0,169,1,114,140,0,0,
0,114,5,0,0,0,114,8,0,0,0,114,10,1,0,0,
- 105,5,0,0,243,0,0,0,0,122,38,70,105,108,101,70,
+ 106,5,0,0,243,0,0,0,0,122,38,70,105,108,101,70,
105,110,100,101,114,46,95,95,105,110,105,116,95,95,46,60,
108,111,99,97,108,115,62,46,60,103,101,110,101,120,112,114,
62,114,71,0,0,0,114,104,0,0,0,78,41,7,114,167,
@@ -2291,7 +2291,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,218,14,108,111,97,100,101,114,95,100,101,116,97,105,
108,115,90,7,108,111,97,100,101,114,115,114,189,0,0,0,
114,5,0,0,0,114,55,1,0,0,114,8,0,0,0,114,
- 209,0,0,0,99,5,0,0,115,16,0,0,0,0,4,4,
+ 209,0,0,0,100,5,0,0,115,16,0,0,0,0,4,4,
1,12,1,26,1,6,2,10,1,6,1,8,1,122,19,70,
105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,116,
95,95,99,1,0,0,0,0,0,0,0,0,0,0,0,1,
@@ -2301,7 +2301,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
101,99,116,111,114,121,32,109,116,105,109,101,46,114,104,0,
0,0,78,41,1,114,58,1,0,0,114,246,0,0,0,114,
5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,38,
- 1,0,0,113,5,0,0,115,2,0,0,0,0,2,122,28,
+ 1,0,0,114,5,0,0,115,2,0,0,0,0,2,122,28,
70,105,108,101,70,105,110,100,101,114,46,105,110,118,97,108,
105,100,97,116,101,95,99,97,99,104,101,115,99,2,0,0,
0,0,0,0,0,0,0,0,0,3,0,0,0,3,0,0,
@@ -2324,7 +2324,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,203,0,0,0,114,140,0,0,0,114,178,0,0,0,41,
3,114,118,0,0,0,114,139,0,0,0,114,187,0,0,0,
114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,
- 137,0,0,0,119,5,0,0,115,8,0,0,0,0,7,10,
+ 137,0,0,0,120,5,0,0,115,8,0,0,0,0,7,10,
1,8,1,8,1,122,22,70,105,108,101,70,105,110,100,101,
114,46,102,105,110,100,95,108,111,97,100,101,114,99,6,0,
0,0,0,0,0,0,0,0,0,0,7,0,0,0,6,0,
@@ -2334,7 +2334,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
190,0,0,0,41,7,114,118,0,0,0,114,188,0,0,0,
114,139,0,0,0,114,44,0,0,0,90,4,115,109,115,108,
114,202,0,0,0,114,140,0,0,0,114,5,0,0,0,114,
- 5,0,0,0,114,8,0,0,0,114,51,1,0,0,131,5,
+ 5,0,0,0,114,8,0,0,0,114,51,1,0,0,132,5,
0,0,115,8,0,0,0,0,1,10,1,8,1,2,255,122,
20,70,105,108,101,70,105,110,100,101,114,46,95,103,101,116,
95,115,112,101,99,78,99,3,0,0,0,0,0,0,0,0,
@@ -2389,7 +2389,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
13,105,110,105,116,95,102,105,108,101,110,97,109,101,90,9,
102,117,108,108,95,112,97,116,104,114,187,0,0,0,114,5,
0,0,0,114,5,0,0,0,114,8,0,0,0,114,203,0,
- 0,0,136,5,0,0,115,72,0,0,0,0,5,4,1,14,
+ 0,0,137,5,0,0,115,72,0,0,0,0,5,4,1,14,
1,2,1,24,1,12,1,10,1,10,1,8,1,6,2,6,
1,6,1,10,2,6,1,4,2,8,1,12,1,14,1,8,
1,10,1,8,1,24,4,8,2,14,1,16,1,16,1,12,
@@ -2420,7 +2420,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
124,1,160,0,161,0,146,2,113,4,83,0,114,5,0,0,
0,41,1,114,105,0,0,0,41,2,114,32,0,0,0,90,
2,102,110,114,5,0,0,0,114,5,0,0,0,114,8,0,
- 0,0,218,9,60,115,101,116,99,111,109,112,62,213,5,0,
+ 0,0,218,9,60,115,101,116,99,111,109,112,62,214,5,0,
0,114,56,1,0,0,122,41,70,105,108,101,70,105,110,100,
101,114,46,95,102,105,108,108,95,99,97,99,104,101,46,60,
108,111,99,97,108,115,62,46,60,115,101,116,99,111,109,112,
@@ -2437,7 +2437,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
120,95,99,111,110,116,101,110,116,115,114,33,1,0,0,114,
116,0,0,0,114,20,1,0,0,114,8,1,0,0,90,8,
110,101,119,95,110,97,109,101,114,5,0,0,0,114,5,0,
- 0,0,114,8,0,0,0,114,63,1,0,0,184,5,0,0,
+ 0,0,114,8,0,0,0,114,63,1,0,0,185,5,0,0,
115,34,0,0,0,0,2,6,1,2,1,22,1,18,3,10,
3,12,1,12,7,6,1,8,1,16,1,4,1,18,2,4,
1,12,1,6,1,12,1,122,22,70,105,108,101,70,105,110,
@@ -2476,14 +2476,14 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,169,2,114,193,0,0,0,114,62,1,0,0,114,
5,0,0,0,114,8,0,0,0,218,24,112,97,116,104,95,
104,111,111,107,95,102,111,114,95,70,105,108,101,70,105,110,
- 100,101,114,225,5,0,0,115,6,0,0,0,0,2,8,1,
+ 100,101,114,226,5,0,0,115,6,0,0,0,0,2,8,1,
12,1,122,54,70,105,108,101,70,105,110,100,101,114,46,112,
97,116,104,95,104,111,111,107,46,60,108,111,99,97,108,115,
62,46,112,97,116,104,95,104,111,111,107,95,102,111,114,95,
70,105,108,101,70,105,110,100,101,114,114,5,0,0,0,41,
3,114,193,0,0,0,114,62,1,0,0,114,69,1,0,0,
114,5,0,0,0,114,68,1,0,0,114,8,0,0,0,218,
- 9,112,97,116,104,95,104,111,111,107,215,5,0,0,115,4,
+ 9,112,97,116,104,95,104,111,111,107,216,5,0,0,115,4,
0,0,0,0,10,14,6,122,20,70,105,108,101,70,105,110,
100,101,114,46,112,97,116,104,95,104,111,111,107,99,1,0,
0,0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,
@@ -2492,7 +2492,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
70,105,110,100,101,114,40,123,33,114,125,41,41,2,114,62,
0,0,0,114,44,0,0,0,114,246,0,0,0,114,5,0,
0,0,114,5,0,0,0,114,8,0,0,0,114,31,1,0,
- 0,233,5,0,0,115,2,0,0,0,0,1,122,19,70,105,
+ 0,234,5,0,0,115,2,0,0,0,0,1,122,19,70,105,
108,101,70,105,110,100,101,114,46,95,95,114,101,112,114,95,
95,41,1,78,41,15,114,125,0,0,0,114,124,0,0,0,
114,126,0,0,0,114,127,0,0,0,114,209,0,0,0,114,
@@ -2500,7 +2500,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,0,0,114,51,1,0,0,114,203,0,0,0,114,63,1,
0,0,114,207,0,0,0,114,70,1,0,0,114,31,1,0,
0,114,5,0,0,0,114,5,0,0,0,114,5,0,0,0,
- 114,8,0,0,0,114,54,1,0,0,90,5,0,0,115,22,
+ 114,8,0,0,0,114,54,1,0,0,91,5,0,0,115,22,
0,0,0,8,2,4,7,8,14,8,4,4,2,8,12,8,
5,10,48,8,31,2,1,10,17,114,54,1,0,0,99,4,
0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,8,
@@ -2523,7 +2523,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,90,8,112,97,116,104,110,97,109,101,90,9,99,112,97,
116,104,110,97,109,101,114,140,0,0,0,114,187,0,0,0,
114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,
- 14,95,102,105,120,95,117,112,95,109,111,100,117,108,101,239,
+ 14,95,102,105,120,95,117,112,95,109,111,100,117,108,101,240,
5,0,0,115,34,0,0,0,0,2,10,1,10,1,4,1,
4,1,8,1,8,1,12,2,10,1,4,1,14,1,2,1,
8,1,8,1,8,1,12,1,12,2,114,75,1,0,0,99,
@@ -2543,7 +2543,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
114,5,1,0,0,114,88,0,0,0,41,3,90,10,101,120,
116,101,110,115,105,111,110,115,90,6,115,111,117,114,99,101,
90,8,98,121,116,101,99,111,100,101,114,5,0,0,0,114,
- 5,0,0,0,114,8,0,0,0,114,184,0,0,0,6,6,
+ 5,0,0,0,114,8,0,0,0,114,184,0,0,0,7,6,
0,0,115,8,0,0,0,0,5,12,1,8,1,8,1,114,
184,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,
0,10,0,0,0,9,0,0,0,67,0,0,0,115,130,1,
@@ -2591,7 +2591,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
100,0,107,2,86,0,1,0,113,2,100,1,83,0,41,2,
114,39,0,0,0,78,41,1,114,23,0,0,0,41,2,114,
32,0,0,0,114,94,0,0,0,114,5,0,0,0,114,5,
- 0,0,0,114,8,0,0,0,114,10,1,0,0,35,6,0,
+ 0,0,0,114,8,0,0,0,114,10,1,0,0,36,6,0,
0,114,56,1,0,0,122,25,95,115,101,116,117,112,46,60,
108,111,99,97,108,115,62,46,60,103,101,110,101,120,112,114,
62,114,73,0,0,0,122,30,105,109,112,111,114,116,108,105,
@@ -2603,7 +2603,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,93,14,125,1,100,0,124,1,155,0,157,2,146,2,113,
4,83,0,41,1,114,74,0,0,0,114,5,0,0,0,41,
2,114,32,0,0,0,218,1,115,114,5,0,0,0,114,5,
- 0,0,0,114,8,0,0,0,114,64,1,0,0,52,6,0,
+ 0,0,0,114,8,0,0,0,114,64,1,0,0,53,6,0,
0,114,56,1,0,0,122,25,95,115,101,116,117,112,46,60,
108,111,99,97,108,115,62,46,60,115,101,116,99,111,109,112,
62,41,3,114,64,0,0,0,114,75,0,0,0,114,160,0,
@@ -2624,7 +2624,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
110,97,109,101,115,90,12,98,117,105,108,116,105,110,95,110,
97,109,101,90,14,98,117,105,108,116,105,110,95,109,111,100,
117,108,101,114,5,0,0,0,114,5,0,0,0,114,8,0,
- 0,0,218,6,95,115,101,116,117,112,17,6,0,0,115,70,
+ 0,0,218,6,95,115,101,116,117,112,18,6,0,0,115,70,
0,0,0,0,8,4,1,6,1,6,2,10,3,22,1,12,
2,22,1,8,1,10,1,10,1,6,2,2,1,10,1,10,
1,12,1,10,2,8,2,12,1,12,1,18,1,22,3,8,
@@ -2644,7 +2644,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
0,114,37,1,0,0,41,2,114,81,1,0,0,90,17,115,
117,112,112,111,114,116,101,100,95,108,111,97,100,101,114,115,
114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,
- 8,95,105,110,115,116,97,108,108,74,6,0,0,115,8,0,
+ 8,95,105,110,115,116,97,108,108,75,6,0,0,115,8,0,
0,0,0,2,8,1,6,1,20,1,114,84,1,0,0,41,
1,114,60,0,0,0,41,1,78,41,3,78,78,78,41,2,
114,73,0,0,0,114,73,0,0,0,41,1,84,41,1,78,
@@ -2678,7 +2678,7 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = {
100,117,108,101,62,1,0,0,0,115,126,0,0,0,4,22,
4,1,4,1,2,1,2,255,4,4,8,17,8,5,8,5,
8,6,8,6,8,12,8,10,8,9,8,5,8,7,8,9,
- 10,22,10,127,0,20,16,1,12,2,4,1,4,2,6,2,
+ 10,22,10,127,0,21,16,1,12,2,4,1,4,2,6,2,
6,2,8,2,16,71,8,40,8,19,8,12,8,12,8,28,
8,17,8,33,8,28,8,24,10,13,10,10,10,11,8,14,
6,3,4,1,2,255,12,68,14,64,14,29,16,127,0,17,
diff --git a/Python/pystate.c b/Python/pystate.c
index f6d1956e9d..eb24f2b800 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -581,7 +581,6 @@ new_threadstate(PyInterpreterState *interp, int init)
tstate->frame = NULL;
tstate->recursion_depth = 0;
tstate->overflowed = 0;
- tstate->recursion_critical = 0;
tstate->stackcheck_counter = 0;
tstate->tracing = 0;
tstate->use_tracing = 0;
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index ff80103050..a45ca3b183 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -770,7 +770,7 @@ static void
print_exception(PyObject *f, PyObject *value)
{
int err = 0;
- PyObject *type, *tb;
+ PyObject *type, *tb, *tmp;
_Py_IDENTIFIER(print_file_and_line);
if (!PyExceptionInstance_Check(value)) {
@@ -789,10 +789,12 @@ print_exception(PyObject *f, PyObject *value)
if (tb && tb != Py_None)
err = PyTraceBack_Print(tb, f);
if (err == 0 &&
- _PyObject_HasAttrId(value, &PyId_print_file_and_line))
+ (err = _PyObject_LookupAttrId(value, &PyId_print_file_and_line, &tmp)) > 0)
{
PyObject *message, *filename, *text;
Py_ssize_t lineno, offset;
+ err = 0;
+ Py_DECREF(tmp);
if (!parse_syntax_error(value, &message, &filename,
&lineno, &offset, &text))
PyErr_Clear();
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 9fcdb5dbc4..bfcf4e8514 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2649,18 +2649,7 @@ static struct PyModuleDef sysmodule = {
};
/* Updating the sys namespace, returning NULL pointer on error */
-#define SET_SYS_FROM_STRING_BORROW(key, value) \
- do { \
- PyObject *v = (value); \
- if (v == NULL) { \
- goto err_occurred; \
- } \
- res = PyDict_SetItemString(sysdict, key, v); \
- if (res < 0) { \
- goto err_occurred; \
- } \
- } while (0)
-#define SET_SYS_FROM_STRING(key, value) \
+#define SET_SYS(key, value) \
do { \
PyObject *v = (value); \
if (v == NULL) { \
@@ -2673,6 +2662,9 @@ static struct PyModuleDef sysmodule = {
} \
} while (0)
+#define SET_SYS_FROM_STRING(key, value) \
+ SET_SYS(key, PyUnicode_FromString(value))
+
static PyStatus
_PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
{
@@ -2681,65 +2673,48 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
/* stdin/stdout/stderr are set in pylifecycle.c */
- SET_SYS_FROM_STRING_BORROW("__displayhook__",
- PyDict_GetItemString(sysdict, "displayhook"));
- SET_SYS_FROM_STRING_BORROW("__excepthook__",
- PyDict_GetItemString(sysdict, "excepthook"));
- SET_SYS_FROM_STRING_BORROW(
- "__breakpointhook__",
- PyDict_GetItemString(sysdict, "breakpointhook"));
- SET_SYS_FROM_STRING_BORROW("__unraisablehook__",
- PyDict_GetItemString(sysdict, "unraisablehook"));
-
- SET_SYS_FROM_STRING("version",
- PyUnicode_FromString(Py_GetVersion()));
- SET_SYS_FROM_STRING("hexversion",
- PyLong_FromLong(PY_VERSION_HEX));
- SET_SYS_FROM_STRING("_git",
- Py_BuildValue("(szz)", "CPython", _Py_gitidentifier(),
- _Py_gitversion()));
- SET_SYS_FROM_STRING("_framework", PyUnicode_FromString(_PYTHONFRAMEWORK));
- SET_SYS_FROM_STRING("api_version",
- PyLong_FromLong(PYTHON_API_VERSION));
- SET_SYS_FROM_STRING("copyright",
- PyUnicode_FromString(Py_GetCopyright()));
- SET_SYS_FROM_STRING("platform",
- PyUnicode_FromString(Py_GetPlatform()));
- SET_SYS_FROM_STRING("maxsize",
- PyLong_FromSsize_t(PY_SSIZE_T_MAX));
- SET_SYS_FROM_STRING("float_info",
- PyFloat_GetInfo());
- SET_SYS_FROM_STRING("int_info",
- PyLong_GetInfo());
+#define COPY_SYS_ATTR(tokey, fromkey) \
+ SET_SYS(tokey, PyMapping_GetItemString(sysdict, fromkey))
+
+ COPY_SYS_ATTR("__displayhook__", "displayhook");
+ COPY_SYS_ATTR("__excepthook__", "excepthook");
+ COPY_SYS_ATTR("__breakpointhook__", "breakpointhook");
+ COPY_SYS_ATTR("__unraisablehook__", "unraisablehook");
+
+#undef COPY_SYS_ATTR
+
+ SET_SYS_FROM_STRING("version", Py_GetVersion());
+ SET_SYS("hexversion", PyLong_FromLong(PY_VERSION_HEX));
+ SET_SYS("_git", Py_BuildValue("(szz)", "CPython", _Py_gitidentifier(),
+ _Py_gitversion()));
+ SET_SYS_FROM_STRING("_framework", _PYTHONFRAMEWORK);
+ SET_SYS("api_version", PyLong_FromLong(PYTHON_API_VERSION));
+ SET_SYS_FROM_STRING("copyright", Py_GetCopyright());
+ SET_SYS_FROM_STRING("platform", Py_GetPlatform());
+ SET_SYS("maxsize", PyLong_FromSsize_t(PY_SSIZE_T_MAX));
+ SET_SYS("float_info", PyFloat_GetInfo());
+ SET_SYS("int_info", PyLong_GetInfo());
/* initialize hash_info */
if (Hash_InfoType.tp_name == NULL) {
if (PyStructSequence_InitType2(&Hash_InfoType, &hash_info_desc) < 0) {
goto type_init_failed;
}
}
- SET_SYS_FROM_STRING("hash_info",
- get_hash_info(tstate));
- SET_SYS_FROM_STRING("maxunicode",
- PyLong_FromLong(0x10FFFF));
- SET_SYS_FROM_STRING("builtin_module_names",
- list_builtin_module_names());
+ SET_SYS("hash_info", get_hash_info(tstate));
+ SET_SYS("maxunicode", PyLong_FromLong(0x10FFFF));
+ SET_SYS("builtin_module_names", list_builtin_module_names());
#if PY_BIG_ENDIAN
- SET_SYS_FROM_STRING("byteorder",
- PyUnicode_FromString("big"));
+ SET_SYS_FROM_STRING("byteorder", "big");
#else
- SET_SYS_FROM_STRING("byteorder",
- PyUnicode_FromString("little"));
+ SET_SYS_FROM_STRING("byteorder", "little");
#endif
#ifdef MS_COREDLL
- SET_SYS_FROM_STRING("dllhandle",
- PyLong_FromVoidPtr(PyWin_DLLhModule));
- SET_SYS_FROM_STRING("winver",
- PyUnicode_FromString(PyWin_DLLVersionString));
+ SET_SYS("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule));
+ SET_SYS_FROM_STRING("winver", PyWin_DLLVersionString);
#endif
#ifdef ABIFLAGS
- SET_SYS_FROM_STRING("abiflags",
- PyUnicode_FromString(ABIFLAGS));
+ SET_SYS_FROM_STRING("abiflags", ABIFLAGS);
#endif
/* version_info */
@@ -2750,7 +2725,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
}
}
version_info = make_version_info(tstate);
- SET_SYS_FROM_STRING("version_info", version_info);
+ SET_SYS("version_info", version_info);
/* prevent user from creating new instances */
VersionInfoType.tp_init = NULL;
VersionInfoType.tp_new = NULL;
@@ -2760,7 +2735,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
}
/* implementation */
- SET_SYS_FROM_STRING("implementation", make_impl_info(version_info));
+ SET_SYS("implementation", make_impl_info(version_info));
/* flags */
if (FlagsType.tp_name == 0) {
@@ -2769,7 +2744,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
}
}
/* Set flags to their default values (updated by _PySys_InitMain()) */
- SET_SYS_FROM_STRING("flags", make_flags(tstate));
+ SET_SYS("flags", make_flags(tstate));
#if defined(MS_WINDOWS)
/* getwindowsversion */
@@ -2790,14 +2765,12 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
/* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */
#ifndef PY_NO_SHORT_FLOAT_REPR
- SET_SYS_FROM_STRING("float_repr_style",
- PyUnicode_FromString("short"));
+ SET_SYS_FROM_STRING("float_repr_style", "short");
#else
- SET_SYS_FROM_STRING("float_repr_style",
- PyUnicode_FromString("legacy"));
+ SET_SYS_FROM_STRING("float_repr_style", "legacy");
#endif
- SET_SYS_FROM_STRING("thread_info", PyThread_GetInfo());
+ SET_SYS("thread_info", PyThread_GetInfo());
/* initialize asyncgen_hooks */
if (AsyncGenHooksType.tp_name == NULL) {
@@ -2819,20 +2792,6 @@ err_occurred:
return _PyStatus_ERR("can't initialize sys module");
}
-/* Updating the sys namespace, returning integer error codes */
-#define SET_SYS_FROM_STRING_INT_RESULT(key, value) \
- do { \
- PyObject *v = (value); \
- if (v == NULL) \
- return -1; \
- res = PyDict_SetItemString(sysdict, key, v); \
- Py_DECREF(v); \
- if (res < 0) { \
- return res; \
- } \
- } while (0)
-
-
static int
sys_add_xoption(PyObject *opts, const wchar_t *s)
{
@@ -2895,24 +2854,10 @@ _PySys_InitMain(PyThreadState *tstate)
int res;
#define COPY_LIST(KEY, VALUE) \
- do { \
- PyObject *list = _PyWideStringList_AsList(&(VALUE)); \
- if (list == NULL) { \
- return -1; \
- } \
- SET_SYS_FROM_STRING_BORROW(KEY, list); \
- Py_DECREF(list); \
- } while (0)
+ SET_SYS(KEY, _PyWideStringList_AsList(&(VALUE)));
#define SET_SYS_FROM_WSTR(KEY, VALUE) \
- do { \
- PyObject *str = PyUnicode_FromWideChar(VALUE, -1); \
- if (str == NULL) { \
- return -1; \
- } \
- SET_SYS_FROM_STRING_BORROW(KEY, str); \
- Py_DECREF(str); \
- } while (0)
+ SET_SYS(KEY, PyUnicode_FromWideChar(VALUE, -1));
COPY_LIST("path", config->module_search_paths);
@@ -2934,19 +2879,14 @@ _PySys_InitMain(PyThreadState *tstate)
COPY_LIST("orig_argv", config->orig_argv);
COPY_LIST("warnoptions", config->warnoptions);
- PyObject *xoptions = sys_create_xoptions_dict(config);
- if (xoptions == NULL) {
- return -1;
- }
- SET_SYS_FROM_STRING_BORROW("_xoptions", xoptions);
- Py_DECREF(xoptions);
+ SET_SYS("_xoptions", sys_create_xoptions_dict(config));
#undef COPY_LIST
#undef SET_SYS_FROM_WSTR
/* Set flags to their final values */
- SET_SYS_FROM_STRING_INT_RESULT("flags", make_flags(tstate));
+ SET_SYS("flags", make_flags(tstate));
/* prevent user from creating new instances */
FlagsType.tp_init = NULL;
FlagsType.tp_new = NULL;
@@ -2958,8 +2898,7 @@ _PySys_InitMain(PyThreadState *tstate)
_PyErr_Clear(tstate);
}
- SET_SYS_FROM_STRING_INT_RESULT("dont_write_bytecode",
- PyBool_FromLong(!config->write_bytecode));
+ SET_SYS("dont_write_bytecode", PyBool_FromLong(!config->write_bytecode));
if (get_warnoptions(tstate) == NULL) {
return -1;
@@ -2978,9 +2917,8 @@ err_occurred:
return -1;
}
+#undef SET_SYS
#undef SET_SYS_FROM_STRING
-#undef SET_SYS_FROM_STRING_BORROW
-#undef SET_SYS_FROM_STRING_INT_RESULT
/* Set up a preliminary stderr printer until we have enough
diff --git a/README.rst b/README.rst
index 14f4f32bca..33ccfc01d9 100644
--- a/README.rst
+++ b/README.rst
@@ -1,4 +1,4 @@
-This is Python version 3.10.0 alpha 0
+This is Python version 3.10.0 alpha 1
=====================================
.. image:: https://travis-ci.com/python/cpython.svg?branch=master
@@ -244,7 +244,7 @@ All current PEPs, as well as guidelines for submitting a new PEP, are listed at
Release Schedule
----------------
-See :pep:`596` for Python 3.9 release details.
+See :pep:`619` for Python 3.10 release details.
Copyright and License Information
diff --git a/Tools/c-analyzer/c_analyzer/common/files.py b/Tools/c-analyzer/c_analyzer/common/files.py
index f630afe625..a8a044757d 100644
--- a/Tools/c-analyzer/c_analyzer/common/files.py
+++ b/Tools/c-analyzer/c_analyzer/common/files.py
@@ -60,7 +60,7 @@ def glob_tree(root, *,
def iter_files(root, suffix=None, relparent=None, *,
- get_files=os.walk,
+ get_files=None,
_glob=glob_tree,
_walk=walk_tree,
):
@@ -75,6 +75,8 @@ def iter_files(root, suffix=None, relparent=None, *,
if "relparent" is provided then it is used to resolve each
filename as a relative path.
"""
+ if get_files is None:
+ get_files = os.walk
if not isinstance(root, str):
roots = root
for root in roots:
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 1bbbd4f9fb..5f2eb53e6a 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -3103,6 +3103,19 @@ class size_t_converter(CConverter):
return super().parse_arg(argname, displayname)
+class fildes_converter(CConverter):
+ type = 'int'
+ converter = '_PyLong_FileDescriptor_Converter'
+
+ def _parse_arg(self, argname, displayname):
+ return """
+ {paramname} = PyObject_AsFileDescriptor({argname});
+ if ({paramname} == -1) {{{{
+ goto exit;
+ }}}}
+ """.format(argname=argname, paramname=self.name)
+
+
class float_converter(CConverter):
type = 'float'
default_type = float
diff --git a/Tools/peg_generator/pegen/sccutils.py b/Tools/peg_generator/pegen/sccutils.py
index 0c29519660..1f0586bb2f 100644
--- a/Tools/peg_generator/pegen/sccutils.py
+++ b/Tools/peg_generator/pegen/sccutils.py
@@ -18,7 +18,7 @@ def strongly_connected_components(
exactly once; vertices not part of a SCC are returned as
singleton sets.
- From https://github.com/ActiveState/code/tree/master/recipes/Python/578507_Strongly_connected_components_directed/recipe-578507.py.
+ From http://code.activestate.com/recipes/578507/.
"""
identified: Set[str] = set()
stack: List[str] = []
@@ -81,7 +81,7 @@ def topsort(
{B, C}
{A}
- From https://github.com/ActiveState/code/tree/master/recipes/Python/577413_Topological_Sort/recipe-577413.py.
+ From http://code.activestate.com/recipes/577413/.
"""
# TODO: Use a faster algorithm?
for k, v in data.items():
diff --git a/configure b/configure
index ad74754e9a..88b7894776 100755
--- a/configure
+++ b/configure
@@ -11625,12 +11625,6 @@ $as_echo_n "checking DYNLOADFILE... " >&6; }
if test -z "$DYNLOADFILE"
then
case $ac_sys_system/$ac_sys_release in
- AIX*) # Use dynload_shlib.c and dlopen() if we have it; otherwise dynload_aix.c
- if test "$ac_cv_func_dlopen" = yes
- then DYNLOADFILE="dynload_shlib.o"
- else DYNLOADFILE="dynload_aix.o"
- fi
- ;;
hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
*)
# use dynload_shlib.c and dlopen() if we have it; otherwise stub
@@ -11672,8 +11666,8 @@ fi
# checks for library functions
for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
- clock confstr copy_file_range ctermid dup3 execv explicit_bzero explicit_memset \
- faccessat fchmod fchmodat fchown fchownat \
+ clock confstr close_range copy_file_range ctermid dup3 execv explicit_bzero \
+ explicit_memset faccessat fchmod fchmodat fchown fchownat \
fdwalk fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
futimens futimes gai_strerror getentropy \
getgrgid_r getgrnam_r \
diff --git a/configure.ac b/configure.ac
index f0bc8c6258..6ffe90a4c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3622,12 +3622,6 @@ AC_MSG_CHECKING(DYNLOADFILE)
if test -z "$DYNLOADFILE"
then
case $ac_sys_system/$ac_sys_release in
- AIX*) # Use dynload_shlib.c and dlopen() if we have it; otherwise dynload_aix.c
- if test "$ac_cv_func_dlopen" = yes
- then DYNLOADFILE="dynload_shlib.o"
- else DYNLOADFILE="dynload_aix.o"
- fi
- ;;
hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
*)
# use dynload_shlib.c and dlopen() if we have it; otherwise stub
@@ -3664,8 +3658,8 @@ fi
# checks for library functions
AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
- clock confstr copy_file_range ctermid dup3 execv explicit_bzero explicit_memset \
- faccessat fchmod fchmodat fchown fchownat \
+ clock confstr close_range copy_file_range ctermid dup3 execv explicit_bzero \
+ explicit_memset faccessat fchmod fchmodat fchown fchownat \
fdwalk fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
futimens futimes gai_strerror getentropy \
getgrgid_r getgrnam_r \
diff --git a/pyconfig.h.in b/pyconfig.h.in
index c162a3c33e..298cb4fa12 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -139,6 +139,9 @@
/* Define to 1 if you have the `clock_settime' function. */
#undef HAVE_CLOCK_SETTIME
+/* Define to 1 if you have the `close_range' function. */
+#undef HAVE_CLOSE_RANGE
+
/* Define if the C compiler supports computed gotos. */
#undef HAVE_COMPUTED_GOTOS
diff --git a/setup.py b/setup.py
index 04b1358bc9..d3fd7bca64 100644
--- a/setup.py
+++ b/setup.py
@@ -950,7 +950,8 @@ class PyBuildExt(build_ext):
self.add(Extension('_csv', ['_csv.c']))
# POSIX subprocess module helper.
- self.add(Extension('_posixsubprocess', ['_posixsubprocess.c']))
+ self.add(Extension('_posixsubprocess', ['_posixsubprocess.c'],
+ extra_compile_args=['-DPy_BUILD_CORE_MODULE']))
def detect_test_extensions(self):
# Python C API test module
@@ -1881,9 +1882,9 @@ class PyBuildExt(build_ext):
# you want to build and link with a framework build of Tcl and Tk
# that is not in /Library/Frameworks, say, in your private
# $HOME/Library/Frameworks directory or elsewhere. It turns
- # out to be difficult to make that work automtically here
+ # out to be difficult to make that work automatically here
# without bringing into play more tools and magic. That case
- # can be hamdled using a recipe with the right arguments
+ # can be handled using a recipe with the right arguments
# to detect_tkinter_explicitly().
#
# Note also that the fallback case here is to try to use the
@@ -1891,7 +1892,7 @@ class PyBuildExt(build_ext):
# be forewarned that they are deprecated by Apple and typically
# out-of-date and buggy; their use should be avoided if at
# all possible by installing a newer version of Tcl and Tk in
- # /Library/Frameworks before bwfore building Python without
+ # /Library/Frameworks before building Python without
# an explicit SDK or by configuring build arguments explicitly.
from os.path import join, exists
@@ -1908,7 +1909,7 @@ class PyBuildExt(build_ext):
else:
# Use case #1: no explicit SDK selected.
# Search the local system-wide /Library/Frameworks,
- # not the one in the default SDK, othewise fall back to
+ # not the one in the default SDK, otherwise fall back to
# /System/Library/Frameworks whose header files may be in
# the default SDK or, on older systems, actually installed.
framework_dirs = [
@@ -1924,7 +1925,7 @@ class PyBuildExt(build_ext):
if not exists(join(F, fw + '.framework')):
break
else:
- # ok, F is now directory with both frameworks. Continure
+ # ok, F is now directory with both frameworks. Continue
# building
break
else: