Commit graph

111537 commits

Author SHA1 Message Date
Miss Islington (bot)
c481cd6256
GH-94254: Make _struct module types immutable (GH-94269)
(cherry picked from commit 17ed560fcd)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-06-26 03:45:00 -07:00
Victor Stinner
4b1144ced1
Run Tools/scripts/reindent.py (#94225) (#94291)
Reindent files which were not properly formatted (PEP 8: 4 spaces).

Remove also some trailing spaces.

(cherry picked from commit e87ada48a9)
2022-06-26 12:39:16 +02:00
Miss Islington (bot)
3473a128d1
[doc] fix typo in reference to tp_descr_get and tp_descr_set (GH-94140)
(cherry picked from commit 32d595fdcd)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
2022-06-26 03:11:43 -07:00
Miss Islington (bot)
82f9041c0a
gh-83499: Fix closing file descriptors in tempfile (GH-93874)
(cherry picked from commit d4792ce916)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-26 01:17:19 -07:00
Miss Islington (bot)
1901d2a948
gh-94245: Test pickling and copying of typing.Tuple[()] (GH-94259) (GH-94268)
(cherry picked from commit 75cb3abc3b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-26 09:01:07 +03:00
Miss Islington (bot)
5f3b45a7f4
gh-70474: [doc] fix wording of GET_ANEXT doc (GH-94048)
(cherry picked from commit 9af6b75298)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-06-25 15:52:06 -07:00
Miss Islington (bot)
53e7bb6447
bpo-39971: Change examples to be runnable (GH-32172)
(cherry picked from commit c57a1c76d7)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-06-25 13:58:27 -07:00
Erlend Egeberg Aasland
deb4d0457f
[3.10] gh-90016: Reword sqlite3 adapter/converter docs (GH-93095) (#94273)
Also add adapters and converter recipes.

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com.
(cherry picked from commit bd3c1c187e)
2022-06-25 22:55:38 +02:00
Serhiy Storchaka
75dda3b12d
[3.10] gh-94245: Fix pickling and copying of typing.Tuple[()] (GH-94260) 2022-06-25 18:45:46 +03:00
Miss Islington (bot)
86e49a5026
[3.10] gh-94207: Fix struct module leak (GH-94239) (GH-94266)
* gh-94207: Fix struct module leak (GH-94239)

Make _struct.Struct a GC type

This fixes a memory leak in the _struct module, where as soon
as a Struct object is stored in the cache, there's a cycle from
the _struct module to the cache to Struct objects to the Struct
type back to the module. If _struct.Struct is not gc-tracked, that
cycle is never collected.

This PR makes _struct.Struct GC-tracked, and adds a regression test.
(cherry picked from commit 6b865349aa)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2022-06-25 16:05:06 +01:00
Miss Islington (bot)
14943829a8
IDLE: replace if statement with expression (GH-94228)
(cherry picked from commit 91f9947f23)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-06-24 10:30:55 -07:00
Miss Islington (bot)
64892c5e36
Docs: Remove Provides [...] from multiprocessing.shared_memory description (GH-92761)
(cherry picked from commit a91ffcf3fa)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-06-24 10:16:54 -07:00
Steve Dower
8d8ce130fd
gh-94205: Ensures all required DLLs are copied on Windows for underpth tests (GH-94206) 2022-06-24 12:39:22 +01:00
Miss Islington (bot)
92d32b9f72
gh-93692: remove "build finished successfully" message from setup.py (GH-93693)
The message was only emitted when the build succeeded _and_ there were
missing modules.
(cherry picked from commit ab077d1e17)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-24 04:03:35 -07:00
Miss Islington (bot)
036a2c1201
bpo-45816: Support building with VS 2022 (v143 toolset) on Windows (GH-29577)
(cherry picked from commit d9301703fb)

Co-authored-by: Crowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>
2022-06-23 12:50:36 -07:00
Pablo Galindo Salgado
05cae26572
[3.10] gh-92858: Improve error message for some suites with syntax error before ':' (GH-92894). (#94183)
(cherry picked from commit 2fc83ac3af)

Co-authored-by: wookie184 <wookie1840@gmail.com>

Co-authored-by: wookie184 <wookie1840@gmail.com>
2022-06-23 18:37:53 +01:00
Miss Islington (bot)
34be807139
gh-84623: Remove unused imports in idlelib (GH-94143) (#94148)
Remove commented code in test_debugger_r.py.

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

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-06-23 13:21:08 +02:00
Ken Jin
73b1d494a7
gh-92888: Fix memoryview bad __index__ use after free (GH-92946) (GH-93950)
(cherry picked from commit 11190c4ad0)

Co-authored-by: chilaxan <35645806+chilaxan@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com>
2022-06-23 18:10:14 +08:00
Miss Islington (bot)
ee5e1e4ee6
Closes gh-94152: Update pyvideo.org URL (GH-94075)
The URL is now https://pyvideo.org, which uses HTTPS and avoids a redirect.
(cherry picked from commit 7c439dca13)

Co-authored-by: partev <petrosyan@gmail.com>
2022-06-22 20:43:15 -07:00
Pablo Galindo Salgado
ee2ddc2d44
[3.10] Add an error message to the ABI-dump file check (#94131) 2022-06-22 22:22:24 +01:00
Miss Islington (bot)
64b02c6304
gh-94114: Remove obsolete reference to python.org mirrors (GH-94115)
* gh-94114
(cherry picked from commit 8661c5053f)

Co-authored-by: partev <petrosyan@gmail.com>
2022-06-22 10:03:37 -07:00
Miss Islington (bot)
4a28525614
gh-91172: Create a workflow for verifying bundled pip and setuptools (GH-31885) (GH-94122)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
(cherry picked from commit d36954b7ea)

Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
2022-06-22 16:04:06 +02:00
Miss Islington (bot)
798ace50f9
gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxiliary importers. (GH-93962) (GH-94119)
Co-authored-by: Brett Cannon <brett@python.org>
(cherry picked from commit c029b552f3)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2022-06-22 14:46:01 +02:00
Miss Islington (bot)
525ab8f310
Fix typo in _io.TextIOWrapper Clinic input (GH-94037) (GH-94117)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit ca308c13da)

Co-authored-by: fikotta <81991278+fikotta@users.noreply.github.com>
2022-06-22 14:22:46 +02:00
Miss Islington (bot)
2e8eac1c2d
gh-94101 Disallow instantiation of SSLSession objects (GH-94102)
Fixes GH-94101

Automerge-Triggered-By: GH:tiran
(cherry picked from commit dc8e1d0390)

Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
2022-06-22 03:50:03 -07:00
Miss Islington (bot)
e51a22b6f6
gh-74696: Do not change the current working directory in shutil.make_archive() if possible (GH-93160) (GH-94106)
It is no longer changed when create a zip or tar archive.

It is still changed for custom archivers registered with shutil.register_archive_format()
if root_dir is not None.

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit fda4b2f063)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-22 11:18:37 +02:00
Miss Islington (bot)
ddac87c1c1
DOC: correct bytesarray -> bytearray in comments (GH-92410) (GH-94090)
(cherry picked from commit 0709586744)

Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
2022-06-22 10:48:14 +02:00
Dennis Sweeney
08069bac3b
[3.10] GH-93964: Harden overflow checks before _PyBytes_Resize in compile.c (GH-94045) 2022-06-22 09:37:56 +01:00
Miss Islington (bot)
ad2e9f97c2
bpo-30535: [doc] state that sys.meta_path is not empty by default (GH-94098) (GH-94100)
Co-authored-by: Windson yang <wiwindson@outlook.com>
(cherry picked from commit 6575841266)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-06-21 23:05:08 +01:00
Miss Islington (bot)
5715382d3a
gh-87389: Fix an open redirection vulnerability in http.server. (GH-93879)
Fix an open redirection vulnerability in the `http.server` module when
an URI path starts with `//` that could produce a 301 Location header
with a misleading target.  Vulnerability discovered, and logic fix
proposed, by Hamza Avvan (@hamzaavvan).

Test and comments authored by Gregory P. Smith [Google].
(cherry picked from commit 4abab6b603)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-06-21 14:36:55 -07:00
Miss Islington (bot)
1b8aa7aafd
gh-93021: Fix __text_signature__ for __get__ (GH-93023) (GH-94086)
Because of the way wrap_descr_get is written, the second argument
to __get__ methods implemented through the wrapper is always
optional.
(cherry picked from commit 4e08fbcfdf)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-06-21 22:32:24 +02:00
Miss Islington (bot)
4b2d7f3f4e
Tutorial: specify match cases don't fall through (GH-93615) (GH-94084)
(cherry picked from commit dd5cf84f24)

Co-authored-by: max <36980911+pr2502@users.noreply.github.com>
2022-06-21 21:53:07 +02:00
Miss Islington (bot)
6432a8972b
gh-93240: clarify wording in IO tutorial (GH-93276) (GH-94081)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
(cherry picked from commit 51d673176a)

Co-authored-by: paulreece <96156234+paulreece@users.noreply.github.com>
2022-06-21 21:51:34 +02:00
Łukasz Langa
9ab245f8ca
[3.10] gh-93675: Fix typos in Doc/ (GH-93676) (GH-94080)
Closes GH-93675
(cherry picked from commit 830513754d)

Co-authored-by: luzpaz <luzpaz@users.noreply.github.com>
2022-06-21 21:39:08 +02:00
Łukasz Langa
38fdff9274
[3.10] gh-93851: Fix all broken links in Doc/ (GH-93853) (GH-94078)
(cherry picked from commit f62ff97f31)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-06-21 21:37:09 +02:00
Serhiy Storchaka
54250e7353
[3.10] gh-79512: Fixed names and __module__ value of weakref classes (GH-93719) (GH-94071)
Classes ReferenceType, ProxyType and CallableProxyType have now correct
atrtributes __module__, __name__ and __qualname__.
It makes them (types, not instances) pickleable.
(cherry picked from commit 8352e322e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-21 22:36:09 +03:00
Miss Islington (bot)
46d0e1c06e
gh-91387: Strip trailing slash from tarfile longname directories (GH-32423)
Co-authored-by: Brett Cannon <brett@python.org>
(cherry picked from commit c1e19421c2)

Co-authored-by: Chris Fernald <chrisf671@gmail.com>
2022-06-21 11:09:55 -07:00
Miss Islington (bot)
223fde359a
gh-86986: Drop compatibility support for Sphinx 2 (GH-93737)
* Revert "bpo-42843: Keep Sphinx 1.8 and Sphinx 2 compatibility (GH-24282)"

This reverts commit 5c1f15b4b1

* Revert "bpo-42579: Make workaround for various versions of Sphinx more robust (GH-23662)"

This reverts commit b63a620014.
(cherry picked from commit 0efe3a1636)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-06-21 10:51:23 -07:00
Miss Islington (bot)
2454dbe652
gh-90539: doc: Expand on what should not go into CFLAGS, LDFLAGS (GH-92754)
(cherry picked from commit 61f24e7885)

Co-authored-by: Matthias Köppe <mkoeppe@math.ucdavis.edu>
2022-06-20 07:14:51 -07:00
Victor Stinner
9d73adf7a4
gh-84461: Silence some compiler warnings on WASM (GH-93978) (#94025)
(cherry picked from commit 774ef28814)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-20 16:09:55 +02:00
Miss Islington (bot)
8a1bade510
[3.10] gh-79009: sqlite3.iterdump now correctly handles tables with autoincrement (GH-9621) (#94015)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
(cherry picked from commit affa9f22cf)

Co-authored-by: itssme <itssme3000@gmail.com>
2022-06-20 02:14:57 +02:00
Miss Islington (bot)
cdf3689aa5
gh-61162: Clarify sqlite3 connection context manager docs (GH-93890)
Explicitly note that transactions are only closed if there is an open
transation at `__exit__`, and that transactions are not implicitly
opened during `__enter__`.

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>

Automerge-Triggered-By: GH:erlend-aasland
(cherry picked from commit 8e08978141)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-19 13:25:55 -07:00
Erlend Egeberg Aasland
c4440e6bc0
[3.10] gh-93925: Improve clarity of sqlite3 commit/rollback, and close docs (GH-93926) (#94011)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>.
(cherry picked from commit 6446592c89)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2022-06-19 21:43:03 +02:00
Kumar Aditya
beba1020a9
GH-93990: fix refcounting bug in add_subclass in typeobject.c (GH-93989) (GH-93999)
(cherry picked from commit 726448ebe1)
2022-06-19 19:26:13 +08:00
Miss Islington (bot)
f21b071729
What's new in 3.10: fix link to issue (GH-93968)
* What's new in 3.10: fix link to issue

* What's new in 3.10: fix link to GH issue

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit 59c1b33805)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-06-19 02:14:21 -07:00
Miss Islington (bot)
2d33d217aa
GH-83658: make multiprocessing.Pool raise an exception if maxtasksperchild is not None or a positive int (GH-93364) (GH-93924)
Closes GH-83658.
(cherry picked from commit e37a158725)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-06-17 23:32:15 +01:00
Miss Islington (bot)
5e30ba1577
test_logging: Fix BytesWarning in SysLogHandlerTest (GH-93920)
(cherry picked from commit 538f28921f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-06-17 02:44:03 -07:00
Kumar Aditya
5163a25354
gh-91877: Fix WriteTransport.get_write_buffer_{limits,size} docs (#92338) (#93805)
- Amend docs for WriteTransport.get_write_buffer_limits
- Add docs for WriteTransport.get_write_buffer_size

Co-authored-by: Sanket Shanbhag <TechieBoy@users.noreply.github.com>
2022-06-16 18:19:17 +02:00
Miss Islington (bot)
a27f3ccea5
gh-91810: Fix regression with writing an XML declaration with encoding='unicode' (GH-93426) (GH-93790)
Suppress writing an XML declaration in open files in ElementTree.write()
with encoding='unicode' and xml_declaration=None.

If file patch is passed to ElementTree.write() with encoding='unicode',
always open a new file in UTF-8.
(cherry picked from commit d7db9dc3cc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-16 18:16:42 +02:00
Miss Islington (bot)
5c10c365fe
gh-91577: SharedMemory move imports out of methods (GH-91579)
SharedMemory.unlink() uses the unregister() function from resource_tracker. Previously it was imported in the method, but this can fail if the method is called during interpreter shutdown, for example when unlink is part of a __del__() method.

Moving the import to the top of the file, means that the unregister() method is available during interpreter shutdown.

The register call in SharedMemory.__init__() can also use this imported resource_tracker.
(cherry picked from commit 9a458befdd)

Co-authored-by: samtygier <samtygier@yahoo.co.uk>
2022-06-16 07:07:30 -07:00