Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: python/cpython
base: v3.9.6
head repository: python/cpython
compare: v3.9.7
Commits on Jun 28, 2021
Commits on Jun 29, 2021
…ethod (GH-26834) (GH-26952)

(cherry picked from commit 0d7f797)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
…ally. (GH-26935) (GH-26957)

(cherry picked from commit 12803c5)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
GH-26950) (GH-26960)

(cherry picked from commit e2fea10)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Commits on Jun 30, 2021
(cherry picked from commit d3a95c1)

Co-authored-by: Steve Dower <steve.dower@python.org>
Commits on Jul 02, 2021
…26989)

Co-authored-by: Jordan Speicher <jordan@jspeicher.com>
(cherry picked from commit 85b9204)

Co-authored-by: finefoot <33361833+finefoot@users.noreply.github.com>
(cherry picked from commit 2560c61)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Commits on Jul 03, 2021
…27005)

(cherry picked from commit d968a63)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Commits on Jul 04, 2021
…nericAlias … (GH-27016) (GH-27018)

(cherry picked from commit d33943a)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Commits on Jul 05, 2021
…H-27012)

(cherry picked from commit 0930240)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
)

In debug build failed tee.fromiterable() corrupted the linked list of all GC objects.
(cherry picked from commit f64de53)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Commits on Jul 08, 2021
(cherry picked from commit af4a2dc)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Commits on Jul 10, 2021
…stead of IsADirectoryError (GH-27049) (GH-27082)

Fixes the misleading IsADirectoryError to be FileNotFoundError.
(cherry picked from commit 248173c)


Co-authored-by: andrei kulakov <andrei.avk@gmail.com>

Automerge-Triggered-By: GH:gpshead
Commits on Jul 12, 2021
) (#26831)

(cherry picked from commit 06cda80)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
…DK installed (GH-26800) (#26803)

(cherry picked from commit 80190b3)

Co-authored-by: Steve Dower <steve.dower@python.org>
…) (#26322)

Making the description of `InspectLoader.is_package` aligned with the current implementation.

Automerge-Triggered-By: GH:jaraco
(cherry picked from commit 8b9310d)

Co-authored-by: Junnosuke Kuroda <Isa-rentacs@users.noreply.github.com>
Also use new make target to install FIPS provider..
(cherry picked from commit e852556)

Co-authored-by: Christian Heimes <christian@python.org>
(cherry picked from commit 66c5853)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
…py3.9 (GH-24460) (#24460)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
GH-23026) (#27098)

(cherry picked from commit da2e673)

Co-authored-by: David Sanders <shang.xiao.sanders@gmail.com>
Commits on Jul 13, 2021
#27111)

Add testcleanup section to configparser and bz2 documentation which
removes temporary files created in the filesystem when 'make doctest'
is run.
(cherry picked from commit 48a5aa7)

Co-authored-by: Kevin Follstad <kfollstad@gmail.com>
…7114)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 3b5b99d)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Fix incorrect handling of exceptions when interpreting dialect objects in
the csv module. Not clearing exceptions between calls to
PyObject_GetAttrString() causes assertion failures in pydebug mode (or with
assertions enabled).

Add a minimal test that would've caught this (passing None as dialect, or
any object that isn't a csv.Dialect subclass, which the csv module allows
and caters to, even though it is not documented.) In pydebug mode, the test
triggers the assertion failure in the old code.

Contributed-By: T. Wouters [Google]
(cherry picked from commit 0093876)

Co-authored-by: T. Wouters <thomas@python.org>
Commits on Jul 14, 2021
if it is called with a sequence or set, but not list or tuple.
(cherry picked from commit f572cbf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…prevent erroneous STDIN consumption (GH-27092)

(cherry picked from commit 0ee0a74)

Co-authored-by: Konstantin-Glukhov <glukhov.k@gmail.com>
…) (GH-27149)

To my understanding, this is supposed to say "transaction".

See the relevant source:

https://github.com/python/cpython/blob/a158b20019b50e3ece6e4743ec4e6ae8d818b690/Modules/_sqlite/connection.cGH-L1434-L1467
(cherry picked from commit 1ca27f2)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
Commits on Jul 15, 2021
…nviron on Windows (GH-27161) (#27170)

GH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This test serializes all of os.environ on the server side. For non-UTF8 locales this can fail for some Unicode characters found in environment variables. This change fixes the HTTP_ACCEPT test.
(cherry picked from commit 82b218f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
GH-27165) (GH-27175)

The non-GC-type branch of subtype_dealloc is using the type of an object after freeing in the same unsafe way as GH-26274 fixes. (I believe the old news entry covers this change well enough.)

https://bugs.python.org/issue44184
(cherry picked from commit 074e765)

Co-authored-by: T. Wouters <thomas@python.org>
Fix a crash at Python exit when a deallocator function removes the
last strong reference to a heap type.

Don't read type memory after calling basedealloc() since
basedealloc() can deallocate the type and free its memory.

_PyMem_IsPtrFreed() argument is now constant.
(cherry picked from commit 615069e)

Co-authored-by: Victor Stinner <vstinner@python.org>
Commits on Jul 17, 2021
…spect.signature` (GH-27177) (GH-27209)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 6aab5f9)

Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
…H-27205)

This fixes TypedDict to work with get_type_hints and postponed evaluation of annotations across modules.

This is done by adding the module name to ForwardRef at the time the object is created and using that to resolve the globals during the evaluation.

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Germán Méndez Bravo <german.mb@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
) (#27213)

(cherry picked from commit 311ee83)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Commits on Jul 18, 2021
GH-25669) (GH-27221)

(cherry picked from commit b38b2fa)


Co-authored-by: Paul Moore <p.f.moore@gmail.com>

Automerge-Triggered-By: GH:jaraco
The check was backwards so we were not correctly detecting removals.
Commits on Jul 19, 2021
…27032) (GH-27233)

* Update hyperlinks in Doc/distributing/index.rst

Update three expired hyperlinks.

Closes [bpo-44561]().
(cherry picked from commit b494685)


Co-authored-by: Steven Hsu <hsuhaochun@gmail.com>

Automerge-Triggered-By: GH:ncoghlan
…13797) (#27245)

getaddresses() should be able to handle a Header object if passed
one.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 89f4c34)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Commits on Jul 20, 2021
…e unused pre-10.5 vestiges. (GH-27253) (GH-27264)

(cherry picked from commit 42205ee)


Co-authored-by: Ned Deily <nad@python.org>

Automerge-Triggered-By: GH:ned-deily
(cherry picked from commit 6564656)


Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>

Automerge-Triggered-By: GH:gpshead
…contextmanager (GH-27024). (#27269)

(cherry picked from commit 7f1c330)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Commits on Jul 21, 2021
…) (GH-27275)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 64f54b7)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Commits on Jul 22, 2021
…n(..., shell=True) (GH-26755) (GH-27289)

(cherry picked from commit 50ffbe3)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
…sly failing test methods (GH-27287) (GH-27293)

* Move to a static argparse.Namespace subclass
* Roughly annotate runtest.py
* Refactor libregrtest to use lossless test result objects
* Only re-run test methods that match names of previously failing test methods
* Adopt tests to cover test method name matching

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>.
(cherry picked from commit f1afef5)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Commits on Jul 23, 2021
…H-27304)

(cherry picked from commit 17575f7)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
Commits on Jul 24, 2021
…next__ (GH-27316) (#27325)

(cherry picked from commit 5370f0a)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
This fixes a small typo. The code fragment should not be quoted. Thank you
@merwok for the feedback.
(cherry picked from commit 7d25254)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
Commits on Jul 26, 2021
…-27358)

Replace sentence with confusing "pseudo-module" with two sentences
separating future statements and the __future__ module.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 0363a40)

Co-authored-by: Steven Hsu <hsuhaochun@gmail.com>

Co-authored-by: Steven Hsu <hsuhaochun@gmail.com>
(cherry picked from commit 3f135c0)

Co-authored-by: Logan Jones <loganasherjones@gmail.com>
…) (GH-27367)

(cherry picked from commit 1d582bb)

Co-authored-by: T. Wouters <thomas@python.org>
) (GH-27370)

(cherry picked from commit c97c2a0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…nd, but (GH-26785) (GH-27372)

the implementation uses [] and will raise KeyError instead.

Noticed by @srittau in python/typeshed@5659.
(cherry picked from commit f22737a)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
"Mac OS X" has been rebranded as macOS

https://www.apple.com/macos
(cherry picked from commit 5fdd2a1)

Co-authored-by: partev <petrosyan@gmail.com>
Commits on Jul 27, 2021
…ge (GH-26770)

(cherry picked from commit d61b69f)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Commits on Jul 28, 2021
…ON (GH-27202)

(cherry picked from commit ddf8ae3)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
…H-27411)

- venv rule is now conditional, and only does anything if $VENVDIR does not exist
- add rule "clean-venv"
(cherry picked from commit d22c876)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
(cherry picked from commit 2ff5bb4)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
preceeding -> preceding
(cherry picked from commit fbe8702)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
(cherry picked from commit 531e2fb)

Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
…H-26698) (#27422)

`pathlib.PureWindowsPath.is_reserved()` now identifies as reserved
filenames with trailing spaces or colons.

Co-authored-by: Barney Gale <barney.gale@foundry.com>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
(cherry picked from commit 56c1f6d)
(cherry picked from commit c1e39d6)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
) (GH-27427)

(cherry picked from commit cb1d76f)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
…s_impl (GH-19501)

(cherry picked from commit 92b5dc7)

Co-authored-by: Ray Donnelly <mingw.android@gmail.com>
GH-27227) (GH-27400)

* [3.9] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227)

* bpo-44461: Fix bug with pdb's handling of import error due to a package which does not have a __main__ module

* 📜🤖 Added by blurb_it.

* remove "else"

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* If running as a module, first check that it can run as a module. Alternate fix for bpo-44461.

Co-authored-by: Irit Katriel
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>.
(cherry picked from commit ee03bad)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* Ensure os_helper is imported.

* Actually, os_helper doesn't exist yet. Just reference rmtree from support.
Commits on Jul 29, 2021
…H-25724) (GH-27440)

(cherry picked from commit 47fd472)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
…H-27292) (GH-27443)

(cherry picked from commit e5c8ddb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…27445)

* rlcompleter was calling these methods to identify whether to add
  parenthesis to the completion, based on if the attribute is callable.
* for property objects, completion with parenthesis are never desirable.
* property methods with print statements behaved very strangely, which
  was especially unfriendly to language newcomers. <tab> could suddenly
  produce output unexpectedly.
(cherry picked from commit 50de8f7)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
) (GH-27446)

(cherry picked from commit 6741794)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
(cherry picked from commit ccefa8a)

Co-authored-by: Pavel <69010336+pavel-lexyr@users.noreply.github.com>
…ltiprocess. (GH-27240) (GH-27453)

(cherry picked from commit 9101b39)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
Co-authored-by: HaeckelK <haeckelk.github@gmail.com>
(cherry picked from commit 6b61d74)
…alised (GH-27431) (GH-27465)

(cherry picked from commit 7e311e4)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Commits on Jul 30, 2021
(cherry picked from commit 851cca8)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
…H-27480)

(cherry picked from commit be42c06)

Co-authored-by: Noah Kantrowitz <noah@coderanger.net>
…H-27482)

(cherry picked from commit 7cad0be)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
… (GH-27489)

When sys.stdout.encoding is None compile_file will fall back to
sys.getdefaultencoding to encode/decode error messages.

Co-authored-by: Stefan Hoelzl <stefan.hoelzl@posteo.de>
Co-authored-by: Mickaël Schoentgen <contact@tiger-222.fr>
(cherry picked from commit 80f0707)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 4bd9caa)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
(cherry picked from commit e3f877c)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Commits on Jul 31, 2021
(cherry picked from commit 4b4227b)

Co-authored-by: Jesús Cea <jcea@jcea.es>

Co-authored-by: Jesús Cea <jcea@jcea.es>
Commits on Aug 02, 2021
… in the Python tokenizer (GH-27499) (GH-27501)

(cherry picked from commit b6bde9f)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
(cherry picked from commit 414dcb1)

Co-authored-by: partev <petrosyan@gmail.com>
(cherry picked from commit 1342248)

Co-authored-by: partev <petrosyan@gmail.com>
…7557)

(cherry picked from commit 36d952d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Non-protocol subclasses of protocol ignore now the __init__ method
inherited from protocol base classes.
(cherry picked from commit 043cd60)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit d382bde)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
…H-27564)

(cherry picked from commit aa0894b)

Co-authored-by: Jake Stockwin <jake.stockwin@optimorlabs.com>
Commits on Aug 03, 2021
…ion for gen.throw. (GH-17658) (GH-27573)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
(cherry picked from commit 83ca46b)

Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
(cherry picked from commit f7c23a9)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
(cherry picked from commit ac811f9)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Commits on Aug 04, 2021
(cherry picked from commit 3d2b4c6)

Co-authored-by: Harry <harry.lees@gmail.com>
…7597)

(cherry picked from commit 10faada)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 977d99d)

Co-authored-by: Rohit Nishad <47008599+rohitnishad613@users.noreply.github.com>
(cherry picked from commit cc77193)

Co-authored-by: Cristián Maureira-Fredes <cmaureir@users.noreply.github.com>
…arg (GH-26899) (GH-27606)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 7c5dab4)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
) (GH-27608)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Alexander Vandenbulcke <alexander.vandenbulcke95@gmail.com>
(cherry picked from commit a8dc489)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Commits on Aug 06, 2021
… warnings (GH-26783) (GH-27629)

* When trying to allocate very large regions on macOS, malloc does not   fail silently. It sends a noisy error out to STDERR
* This provides a helper function to warn the user, and provides the warning for test_decimal, which consistently generates these warnings on macOS.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>.
(cherry picked from commit 15d3c14)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
Fix the os.set_inheritable() function on FreeBSD 14 for file
descriptor opened with the O_PATH flag: ignore the EBADF error on
ioctl(), fallback on the fcntl() implementation.
(cherry picked from commit c24896c)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 938e84b)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
…ake html` (GH-27635) (GH-27636)

It turned out to be disruptive for downstream distributors.
(cherry picked from commit 55fa87b)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 0ffdced)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
…ned by `sqlite3` UDF callbacks (GH-27588). (GH-27639)

(cherry picked from commit 8f010dc)
Commits on Aug 07, 2021
…nd __build_class__ (GH-27647) (GH-27651)

(cherry picked from commit a40675c)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Commits on Aug 08, 2021
GH-27665)

(cherry picked from commit ebecffd)

Co-authored-by: Senthil Kumaran <senthil@python.org>

Co-authored-by: Senthil Kumaran <senthil@python.org>
Commits on Aug 09, 2021
…ile (GH-21470) (GH-27674)

Co-Authored-By: Bo Bayles <bbayles@gmail.com>
(cherry picked from commit eb2d4a6)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
…H-27682)

- Use "Low surrogate code units" instead of "Unicode Private Use Area"
(cherry picked from commit b05e9b6)

Co-authored-by: meowmeowmeowcat <meowmeowcat1211@gmail.com>
pip is now 21.2.3
setuptools is now 57.4.0.
(cherry picked from commit 738ac00)

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
…H-27684)

This was causing test___all__ to fail on platforms lacking a shared
memory implementation.

Co-Authored-By: Xavier de Gaye <xdegaye@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit d097876)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
) (GH-27687)

(cherry picked from commit b33186b)

Co-authored-by: Johannes Reiff <mail@jreiff.de>
Commits on Aug 10, 2021
…H-18272) (GH-27699)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit c5c5326)

Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
(cherry picked from commit 149addd)

Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
…-27705)

It has not been true for several years and likely never was.
(cherry picked from commit 6b37d0d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
… cycle in its context chain (GH-27626) (GH-27707)

Co-authored-by: Dennis Sweeney 36520290+sweeneyde@users.noreply.github.com
(cherry picked from commit d5c2174)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
…7694) (GH-27698)

(cherry picked from commit 8ed1833)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
…H-27638) (GH-27714)

(cherry picked from commit c0ab59f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Commits on Aug 11, 2021
…cts (GH-27678) (GH-27720)

(cherry picked from commit bfc2d5a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 1841c70)

Co-authored-by: 180909 <wjh180909@gmail.com>
Commits on Aug 12, 2021
[bpo-33930](): Fix typo in the test name. (GH-27733)
(cherry picked from commit f08e6d1)


Co-authored-by: Benjamin Peterson <benjamin@python.org>

Automerge-Triggered-By: GH:benjaminp
…pecs and repeated expressions (GH-27729) (GH-27744)

(cherry picked from commit 8e832fb)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Commits on Aug 13, 2021
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Commits on Aug 14, 2021
(cherry picked from commit ed524b4)

Co-authored-by: meowmeowmeowcat <meowmeowcat1211@gmail.com>
Commits on Aug 16, 2021
…ale in regrtest (GH-27634) (GH-27785)

(cherry picked from commit a0a6d39)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Commits on Aug 17, 2021
…H-27672) (GH-27788)

Co-authored-by: Micky Yun Chan <michan@redhat.com>.
(cherry picked from commit 1512bc2)

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
…GH-27790)

(cherry picked from commit 6a358bb)

Co-authored-by: Gautam Chaudhuri <gautam.chaudhuri.1803@gmail.com>
…GH-27772) (GH-27797)

(cherry picked from commit 4b9a2dc)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
(cherry picked from commit 599f5c8)

Co-authored-by: Jefferson Oliveira <jefferson.dev.insights@gmail.com>
…H-27688) (GH-27805)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 3240bc6)

Co-authored-by: meowmeowmeowcat <meowmeowcat1211@gmail.com>
Commits on Aug 18, 2021
…27793) (GH-27810)

Additional improvements:

- messages which were compiled regular expressions aren't unpacked back into
  strings for unmatched warnings;

- removed unnecessary "if tokens:" check (there's one before the for loop);

- took `endswith` calculation out of the for loop.
(cherry picked from commit 8cf07d3)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
…t statements (GH-27814) (GH-27817)

(cherry picked from commit b2f68b1)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Commits on Aug 19, 2021
…-27821)

(cherry picked from commit 942d1a4)

Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
…27827)

(cherry picked from commit 0fd66e4)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 6fb62b4)

Co-authored-by: Victor Stinner <vstinner@python.org>
Commits on Aug 20, 2021
…H-27855)

(cherry picked from commit 60b93d9)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
Commits on Aug 21, 2021
…-27870)

The code of the test was never executed because the test function
was unintentionally converted to a generator function.
(cherry picked from commit 585390f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Commits on Aug 22, 2021
…t objects (GH-27831) (GH-27882)

Method stopTestRun() is now always called in pair with method startTestRun()
for TestResult objects implicitly created in TestCase.run().
Previously it was not called for test methods and classes decorated with
a skipping decorator.
(cherry picked from commit a9640d7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…7880)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Vedran Čačić <vedgar+github@gmail.com>
(cherry picked from commit 64f9e7b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…te (GH-27835) (GH-27892)

(cherry picked from commit 141c7a4)

Co-authored-by: Mark Roseman <mark@markroseman.com>
) (GH-27895)

- move description of internal modules (_tkinter and tkinter.constants) from section intro to list of additional modules at end of section, as not most important info
- added missing ttk and tix here
- emphasized up front that most apps will need tkinter and ttk
(cherry picked from commit d5dbe8b)

Co-authored-by: Mark Roseman <mark@markroseman.com>
GH-27896)

- reorganized from two sections (tkinter vs. tcl/tk) into three (tkinter, tcl/tk, and books)
- main (recommended) tkinter docs have one tutorial (tkdocs) and one reference (shipman), added better descriptions
- dropped link to Tkinter page on wiki (suggestion by E. Paine; outdated, most material already linked to from python.org)
- replaced Tcl/Tk recent man pages and core dev home with single link to main Tcl/Tk page (which holds both of these)
- updated Modern Tkinter link to book page on TkDocs site (was Amazon link to old version), dropped description
- replaced Grayson book by Moore book (newer, covers ttk)
- changed Ousterhout ref to second edition, covers ttk
- dropped link to Welch book (old).
(cherry picked from commit d1049d1)

Co-authored-by: Mark Roseman <mark@markroseman.com>
…ypes (GH-27866) (GH-27900)

(cherry picked from commit eec340e)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Commits on Aug 23, 2021
intially -> initially
(cherry picked from commit 0e8695e)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
…H-27910)

Test also PyObject_Repr(NULL) and PyObject_Bytes(NULL)..
(cherry picked from commit 4d68917)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…7914)

(cherry picked from commit 27b761a)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
(cherry picked from commit 7b550df)

Co-authored-by: Mike Smith <mikesmith@screamingjoypad.com>
Co-authored-by: Tianqing Peng <pengtianqing@yimian.com.cn>
(cherry picked from commit dcbf7ff)

Co-authored-by: Sunny Bean <ptq008@gmail.com>
Commits on Aug 24, 2021
…igned int (GH-19708)

(cherry picked from commit bb21e28)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
Commits on Aug 25, 2021
…7922) (GH-27952)

(cherry picked from commit 7903a10)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Commits on Aug 26, 2021
…H-27951) (GH-27962)

(cherry picked from commit 806e25f)

Co-authored-by: Objectivitix <79152594+Objectivitix@users.noreply.github.com>
GH-27946) (GH-27973)

Various date parsing utilities in the email module, such as
email.utils.parsedate(), are supposed to gracefully handle invalid
input, typically by raising an appropriate exception or by returning
None.

The internal email._parseaddr._parsedate_tz() helper used by some of
these date parsing routines tries to be robust against malformed input,
but unfortunately it can still crash ungracefully when a non-empty but
whitespace-only input is passed. This manifests as an unexpected
IndexError.

In practice, this can happen when parsing an email with only a newline
inside a ‘Date:’ header, which unfortunately happens occasionally in the
real world.

Here's a minimal example:

    $ python
    Python 3.9.6 (default, Jun 30 2021, 10:22:16)
    [GCC 11.1.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import email.utils
    >>> email.utils.parsedate('foo')
    >>> email.utils.parsedate(' ')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.9/email/_parseaddr.py", line 176, in parsedate
        t = parsedate_tz(data)
      File "/usr/lib/python3.9/email/_parseaddr.py", line 50, in parsedate_tz
        res = _parsedate_tz(data)
      File "/usr/lib/python3.9/email/_parseaddr.py", line 72, in _parsedate_tz
        if data[0].endswith(',') or data[0].lower() in _daynames:
    IndexError: list index out of range

The fix is rather straight-forward: guard against empty lists, after
splitting on whitespace, but before accessing the first element.
(cherry picked from commit 989f6a3)

Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
GH-27970)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 7dc505b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit fdcb675)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Commits on Aug 27, 2021
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 94a3d2a)

Co-authored-by: chilaxan <chilaxan@gmail.com>
… (GH-27995)

Authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
(cherry picked from commit 2ec9428)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
…) (GH-27998)

(cherry picked from commit 28db1f6)

Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
…or upcoming update (GH-27982)

Also improve the build script for libffi, which is not used as part of the regular build.
(cherry picked from commit 969ae7f)

Co-authored-by: Steve Dower <steve.dower@python.org>
Commits on Aug 28, 2021
…two threads attempt to commit the last pending removal (GH-27921) (GH-28014)

Fixes:
Traceback (most recent call last):
  File "/home/graingert/projects/asyncio-demo/demo.py", line 36, in <module>
    sys.exit(main())
  File "/home/graingert/projects/asyncio-demo/demo.py", line 30, in main
    test_all_tasks_threading()
  File "/home/graingert/projects/asyncio-demo/demo.py", line 24, in test_all_tasks_threading
    results.append(f.result())
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 438, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.10/asyncio/runners.py", line 47, in run
    _cancel_all_tasks(loop)
  File "/usr/lib/python3.10/asyncio/runners.py", line 56, in _cancel_all_tasks
    to_cancel = tasks.all_tasks(loop)
  File "/usr/lib/python3.10/asyncio/tasks.py", line 53, in all_tasks
    tasks = list(_all_tasks)
  File "/usr/lib/python3.10/_weakrefset.py", line 60, in __iter__
    with _IterationGuard(self):
  File "/usr/lib/python3.10/_weakrefset.py", line 33, in __exit__
    w._commit_removals()
  File "/usr/lib/python3.10/_weakrefset.py", line 57, in _commit_removals
    discard(l.pop())
IndexError: pop from empty list

Also fixes:
Exception ignored in: weakref callback <function WeakKeyDictionary.__init__.<locals>.remove at 0x00007fe82245d2e0>
Traceback (most recent call last):
  File "/usr/lib/pypy3/lib-python/3/weakref.py", line 390, in remove
    del self.data[k]
KeyError: <weakref at 0x00007fe76e8d8180; dead>
Exception ignored in: weakref callback <function WeakKeyDictionary.__init__.<locals>.remove at 0x00007fe82245d2e0>
Traceback (most recent call last):
  File "/usr/lib/pypy3/lib-python/3/weakref.py", line 390, in remove
    del self.data[k]
KeyError: <weakref at 0x00007fe76e8d81a0; dead>
Exception ignored in: weakref callback <function WeakKeyDictionary.__init__.<locals>.remove at 0x00007fe82245d2e0>
Traceback (most recent call last):
  File "/usr/lib/pypy3/lib-python/3/weakref.py", line 390, in remove
    del self.data[k]
KeyError: <weakref at 0x000056548f1e24a0; dead>

See: https://github.com/agronholm/anyio/issues/362GH-issuecomment-904424310
See also: https://bugs.python.org/issue29519

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 206b21e)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
…of nested blocks cpython-only (GH-28002) (GH-28017)

PyPy and potentially other implementations have different or no
contraints on the number of blocks that can be statically nested. move
the test that checks for this behaviour into a unit test and mark it as
CPython-only..
(cherry picked from commit eb263f9)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
Commits on Aug 29, 2021
…p in pydoc (GH-23200) (GH-28025)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit c9227df)

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Update the vendored copy of libexpat to 2.4.1 (from 2.2.8) to get the
fix for the CVE-2013-0340 "Billion Laughs" vulnerability. This copy
is most used on Windows and macOS.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 3fc5d84)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 0897253)

Co-authored-by: Miguel Brito <5544985+miguendes@users.noreply.github.com>
…-28009) (GH-28040)

(cherry picked from commit d3bdbbf)

Co-authored-by: Steve Dower <steve.dower@python.org>
Commits on Aug 30, 2021
…8051)

(cherry picked from commit 94b2639)

Co-authored-by: Ned Deily <nad@python.org>
…aries when built on older macOS systems (GH-27251) (GH-28053)

Previously, when built on older macOS systems, `find_library` was not able to find macOS system libraries when running on Big Sur due to changes in how system libraries are stored.
(cherry picked from commit 71853a7)

Co-authored-by: Tobias Bergkvist <tobias@bergkv.ist>
…GH-28062)

This was missed while upgrading CI..
(cherry picked from commit d6cb5dd)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
…-28030) (GH-28065)

Previously it returned None if the test class or method was
decorated with a skipping decorator.

Co-authored-by: Iman Tabrizian <iman.tabrizian@gmail.com>
(cherry picked from commit 7e246a3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Fix a crash in the signal handler of the faulthandler module: no
longer modify the reference count of frame objects.
(cherry picked from commit fe997e1)

Co-authored-by: Victor Stinner <vstinner@python.org>
…est. (GH-28006) (GH-28071)

* Functions registered with addModuleCleanup() were not called unless
  the user defines tearDownModule() in their test module.
* Functions registered with addClassCleanup() were not called if
  tearDownClass is set to None.
* Buffering in TestResult did not work with functions registered
  with addClassCleanup() and addModuleCleanup().
* Errors in functions registered with addClassCleanup() and
  addModuleCleanup() were not handled correctly in buffered and
  debug modes.
* Errors in setUpModule() and functions registered with
  addModuleCleanup() were reported in wrong order.
* And several lesser bugs..
(cherry picked from commit 08d9e59)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Showing 309 changed files with 6,881 additions and 1,692 deletions.
@@ -1,14 +1,14 @@
variables:
coverage: false

trigger: ['master', '3.9', '3.8', '3.7']
trigger: ['main', '3.10', '3.9', '3.8', '3.7']

jobs:
- job: Prebuild
displayName: Pre-build checks

pool:
vmImage: ubuntu-18.04
vmImage: ubuntu-20.04

steps:
- template: ./prebuild-checks.yml
@@ -20,7 +20,7 @@ jobs:
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))

pool:
vmImage: ubuntu-18.04
vmImage: ubuntu-20.04

steps:
- template: ./docs-steps.yml
@@ -40,7 +40,7 @@ jobs:
testRunPlatform: macos

pool:
vmImage: macos-10.14
vmImage: macos-10.15

steps:
- template: ./macos-steps.yml
@@ -52,12 +52,12 @@ jobs:
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))

pool:
vmImage: ubuntu-18.04
vmImage: ubuntu-20.04

variables:
testRunTitle: '$(build.sourceBranchName)-linux'
testRunPlatform: linux
openssl_version: 1.1.1k
openssl_version: 1.1.1l

steps:
- template: ./posix-steps.yml
@@ -78,12 +78,12 @@ jobs:
)
pool:
vmImage: ubuntu-18.04
vmImage: ubuntu-20.04

variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1k
openssl_version: 1.1.1l

steps:
- template: ./posix-steps.yml
@@ -1,14 +1,14 @@
variables:
coverage: false

pr: ['master', '3.9', '3.8', '3.7']
pr: ['main', '3.10', '3.9', '3.8', '3.7']

jobs:
- job: Prebuild
displayName: Pre-build checks

pool:
vmImage: ubuntu-18.04
vmImage: ubuntu-20.04

steps:
- template: ./prebuild-checks.yml
@@ -20,7 +20,7 @@ jobs:
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))

pool:
vmImage: ubuntu-18.04
vmImage: ubuntu-20.04

steps:
- template: ./docs-steps.yml
@@ -38,7 +38,7 @@ jobs:
testRunPlatform: macos

pool:
vmImage: macos-10.14
vmImage: macos-10.15

steps:
- template: ./macos-steps.yml
@@ -52,12 +52,12 @@ jobs:
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))

pool:
vmImage: ubuntu-18.04
vmImage: ubuntu-20.04

variables:
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
testRunPlatform: linux
openssl_version: 1.1.1k
openssl_version: 1.1.1l

steps:
- template: ./posix-steps.yml
@@ -78,12 +78,12 @@ jobs:
)
pool:
vmImage: ubuntu-18.04
vmImage: ubuntu-20.04

variables:
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
testRunPlatform: linux-coverage
openssl_version: 1.1.1k
openssl_version: 1.1.1l

steps:
- template: ./posix-steps.yml
@@ -0,0 +1,12 @@
root = true

[*.{py,c,cpp,h,rst,md,yml}]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space

[*.{py,c,cpp,h}]
indent_size = 4

[*.yml]
indent_size = 2
@@ -111,7 +111,7 @@ Include/pytime.h @pganssle @abalkin

**/*idlelib* @terryjreedy

**/*typing* @gvanrossum @ilevkivskyi
**/*typing* @gvanrossum @Fidget-Spinner

**/*asyncore @giampaolo
**/*asynchat @giampaolo
@@ -93,7 +93,7 @@ jobs:
# Check for changes in regenerated files
if ! test -z "$changes"
then
echo "Generated files not up to date. Perhaps you forgot to run make regen-all ;)"
echo "Generated files not up to date. Perhaps you forgot to run make regen-all or build.bat --regen ;)"
echo "$changes"
exit 1
fi
@@ -133,6 +133,8 @@ jobs:
runs-on: macos-latest
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
PYTHONSTRICTEXTENSIONBUILD: 1
steps:
- uses: actions/checkout@v2
- name: Configure CPython
@@ -150,7 +152,8 @@ jobs:
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
OPENSSL_VER: 1.1.1k
OPENSSL_VER: 1.1.1l
PYTHONSTRICTEXTENSIONBUILD: 1
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
@@ -191,7 +194,7 @@ jobs:
strategy:
fail-fast: false
matrix:
openssl_ver: [1.0.2u, 1.1.0l, 1.1.1k, 3.0.0-alpha14]
openssl_ver: [1.0.2u, 1.1.0l, 1.1.1l, 3.0.0-beta1]
env:
OPENSSL_VER: ${{ matrix.openssl_ver }}
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -9,6 +9,7 @@ apt-get -yq install \
libbz2-dev \
libffi-dev \
libgdbm-dev \
libgdbm-compat-dev \
liblzma-dev \
libncurses5-dev \
libreadline6-dev \
@@ -35,6 +35,7 @@ gmon.out
.coverage
.mypy_cache/
.pytest_cache/
.DS_Store

*.exe
!Lib/distutils/command/*.exe
@@ -18,6 +18,7 @@ env:
# Set rpath with env var instead of -Wl,-rpath linker flag
# OpenSSL ignores LDFLAGS when linking bin/openssl
- LD_RUN_PATH="${OPENSSL_DIR}/lib"
- PYTHONSTRICTEXTENSIONBUILD=1

branches:
only:
@@ -137,14 +137,22 @@ pydoc-topics: build
htmlview: html
$(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"

clean:
-rm -rf build/* $(VENVDIR)/*
clean: clean-venv
-rm -rf build/*

clean-venv:
rm -rf $(VENVDIR)

venv:
$(PYTHON) -m venv $(VENVDIR)
$(VENVDIR)/bin/python3 -m pip install -U pip setuptools
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt
@echo "The venv has been created in the $(VENVDIR) directory"
@if [ -d $(VENVDIR) ] ; then \
echo "venv already exists."; \
echo "To recreate it, remove it first with \`make clean-venv'."; \
else \
$(PYTHON) -m venv $(VENVDIR); \
$(VENVDIR)/bin/python3 -m pip install -U pip setuptools; \
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt; \
echo "The venv has been created in the $(VENVDIR) directory"; \
fi

dist:
rm -rf dist
@@ -28,28 +28,31 @@ install the tools into there.
Using make
----------

To get started on UNIX, you can create a virtual environment with the command ::
To get started on UNIX, you can create a virtual environment and build
documentation with the commands::

make venv

That will install all the tools necessary to build the documentation. Assuming
the virtual environment was created in the ``venv`` directory (the default;
configurable with the VENVDIR variable), you can run the following command to
build the HTML output files::

make html

By default, if the virtual environment is not created, the Makefile will
look for instances of sphinxbuild and blurb installed on your process PATH
(configurable with the SPHINXBUILD and BLURB variables).
The virtual environment in the ``venv`` directory will contain all the tools
necessary to build the documentation downloaded and installed from PyPI.
If you'd like to create the virtual environment in a different location,
you can specify it using the ``VENVDIR`` variable.

You can also skip creating the virtual environment altogether, in which case
the Makefile will look for instances of ``sphinxbuild`` and ``blurb``
installed on your process ``PATH`` (configurable with the ``SPHINXBUILD`` and
``BLURB`` variables).

On Windows, we try to emulate the Makefile as closely as possible with a
``make.bat`` file. If you need to specify the Python interpreter to use,
set the PYTHON environment variable instead.
set the PYTHON environment variable.

Available make targets are:

* "clean", which removes all build files.
* "clean", which removes all build files and the virtual environment.

* "clean-venv", which removes the virtual environment directory.

* "venv", which creates a virtual environment with all necessary tools
installed.
@@ -80,7 +80,7 @@ taken on the bug.
Article which goes into some detail about how to create a useful bug report.
This describes what kind of information is useful and why it is useful.

`Bug Report Writing Guidelines <https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines>`_
`Bug Writing Guidelines <https://bugzilla.mozilla.org/page.cgi?id=bug-writing.html>`_
Information about writing a good bug report. Some of this is specific to the
Mozilla project, but describes general good practices.

@@ -100,7 +100,7 @@ For convenience, some of these functions will always return a
This is the most common way to set the error indicator. The first argument
specifies the exception type; it is normally one of the standard exceptions,
e.g. :c:data:`PyExc_RuntimeError`. You need not increment its reference count.
The second argument is an error message; it is decoded from ``'utf-8``'.
The second argument is an error message; it is decoded from ``'utf-8'``.
.. c:function:: void PyErr_SetObject(PyObject *type, PyObject *value)
@@ -221,6 +221,12 @@ or request "multi-phase initialization" by returning the definition struct itsel
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
is ``NULL``.
Like :c:member:`PyTypeObject.tp_clear`, this function is not *always*
called before a module is deallocated. For example, when reference
counting is enough to determine that an object is no longer used,
the cyclic garbage collector is not involved and
:c:member:`~PyModuleDef.m_free` is called directly.
.. versionchanged:: 3.9
No longer called before the module state is allocated.
@@ -436,6 +436,21 @@ Accessing attributes of extension types
{NULL} /* Sentinel */
};
.. c:function:: PyObject* PyMember_GetOne(const char *obj_addr, struct PyMemberDef *m)
Get an attribute belonging to the object at address *obj_addr*. The
attribute is described by ``PyMemberDef`` *m*. Returns ``NULL``
on error.
.. c:function:: int PyMember_SetOne(char *obj_addr, struct PyMemberDef *m, PyObject *o)
Set an attribute belonging to the object at address *obj_addr* to object *o*.
The attribute to set is described by ``PyMemberDef`` *m*. Returns ``0``
if successful and a negative value on failure.
.. c:type:: PyGetSetDef
Structure to define property-like access for a type. See also description of
@@ -13,7 +13,7 @@ Type Objects
The C structure of the objects used to describe built-in types.


.. c:var:: PyObject* PyType_Type
.. c:var:: PyTypeObject PyType_Type
This is the type object for type objects; it is the same object as
:class:`type` in the Python layer.
@@ -1294,6 +1294,12 @@ and :c:type:`PyType_Type` effectively act as defaults.)
so that *self* knows the contained object can no longer be used. The
:c:func:`Py_CLEAR` macro performs the operations in a safe order.

Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called
before an instance is deallocated. For example, when reference counting
is enough to determine that an object is no longer used, the cyclic garbage
collector is not involved and :c:member:`~PyTypeObject.tp_dealloc` is
called directly.

Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break reference cycles,
it's not necessary to clear contained objects like Python strings or Python
integers, which can't participate in reference cycles. On the other hand, it may
@@ -149,7 +149,7 @@ access internal read-only data of Unicode objects:
``PyUnicode_WCHAR_KIND`` is deprecated.
.. c:function:: int PyUnicode_KIND(PyObject *o)
.. c:function:: unsigned int PyUnicode_KIND(PyObject *o)
Return one of the PyUnicode kind constants (see above) that indicate how many
bytes per character this Unicode object uses to store its data. *o* has to
@@ -86,7 +86,7 @@

# Custom sidebar templates, filenames relative to this file.
html_sidebars = {
# Defaults taken from http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars
# Defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
# Removes the quick search block
'**': ['localtoc.html', 'relations.html', 'customsourcelink.html'],
'index': ['indexsidebar.html'],
@@ -131,11 +131,11 @@ involved in creating and publishing a project:
* `The .pypirc file`_

.. _Project structure: \
https://packaging.python.org/tutorials/distributing-packages/
https://packaging.python.org/tutorials/packaging-projects/#packaging-python-projects
.. _Building and packaging the project: \
https://packaging.python.org/tutorials/distributing-packages/#packaging-your-project
https://packaging.python.org/tutorials/packaging-projects/#creating-the-package-files
.. _Uploading the project to the Python Packaging Index: \
https://packaging.python.org/tutorials/distributing-packages/#uploading-your-project-to-pypi
https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives
.. _The .pypirc file: \
https://packaging.python.org/specifications/pypirc/

Showing you all comments on commits in this comparison.

@Rob801130

This comment has been minimized.

Copy link

@Rob801130 Rob801130 commented on 153365d Aug 4, 2021

Lib/http/client.py