Commit graph

12232 commits

Author SHA1 Message Date
Miss Islington (bot)
f7f1c26423
Update URLs in comments and metadata to use HTTPS (GH-27458) (GH-27478)
(cherry picked from commit be42c06bb0)

Co-authored-by: Noah Kantrowitz <noah@coderanger.net>
2021-07-30 16:25:28 +02:00
Erlend Egeberg Aasland
0cb470e622
[3.10] bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH-27431). (GH-27472)
(cherry picked from commit 7e311e496b)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-07-30 14:01:22 +02:00
Miss Islington (bot)
bccb7b9509
bpo-40263: Fixes an off-by-one error in _winapi_WaitForMultipleObjects_impl (GH-19501)
(cherry picked from commit 92b5dc780d)

Co-authored-by: Ray Donnelly <mingw.android@gmail.com>
2021-07-28 13:18:01 -07:00
Miss Islington (bot)
6fc1efa454
bpo-44740: Lowercase "internet" and "web" where appropriate. (GH-27378) (GH-27380)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 11749e2dc2)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-07-27 00:34:32 +02:00
Miss Islington (bot)
5ec275758d
bpo-42854: Correctly use size_t for _ssl._SSLSocket.read and _ssl._SSLSocket.write (GH-27271) (GH-27308)
(cherry picked from commit 83d1430ee5)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2021-07-23 16:25:54 +01:00
Miss Islington (bot)
632e8a6959
bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VERSION_TAG no-op (GH-27260) (GH-27306)
* Remove code that checks Py_TPFLAGS_HAVE_VERSION_TAG

    The field is always present in the type struct, as explained
    in the added comment.

* Remove Py_TPFLAGS_HAVE_AM_SEND

    The flag is not needed, and since it was added in 3.10 it can be removed now.
(cherry picked from commit a4760cc32d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-07-23 16:56:53 +02:00
Miss Islington (bot)
ff7af2203c
bpo-34932: Add socket.TCP_KEEPALIVE for macOS (GH-25079)
(cherry picked from commit d59d7374a3)

Co-authored-by: Shane Harvey <shnhrv@gmail.com>
2021-07-14 16:15:31 -07:00
Erlend Egeberg Aasland
02e4c0cad3
[3.10] Fix docstring typo in sqlite3.Connection.executescript/sqlite3.Cursor.executescript (GH-27147) (GH-27151)
Both `executescript` methods contain the same docstring typo:
_"Executes a multiple SQL statements at once."_ => _"Executes multiple SQL statements at once."_

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-07-15 00:02:01 +01:00
Miss Islington (bot)
7e1d6308a3
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
if it is called with a sequence or set, but not list or tuple.
(cherry picked from commit f572cbf1fa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-13 22:40:10 -07:00
Miss Islington (bot)
bb260c2a21
[3.10] bpo-44630: Fix assertion errors in csv module (GH-27127) (GH-27129)
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 0093876328)


Co-authored-by: T. Wouters <thomas@python.org>

Automerge-Triggered-By: GH:gpshead
2021-07-13 16:18:28 -07:00
Miss Islington (bot)
42da46ed52
bpo-29753: revert 0d7ad9f (GH-19850) (GH-27085)
This reverts commit 0d7ad9fb38 as it has a regression.

See https://github.com/python/cpython/pull/19850GH-issuecomment-869410686
(cherry picked from commit e14d5ae544)

Co-authored-by: Filipe Laíns <lains@archlinux.org>
2021-07-11 10:47:06 -07:00
Miss Islington (bot)
08697ac5d1
bpo-44582: Accelerate mimetypes.init on Windows with a native accelerator (GH-27059)
(cherry picked from commit bbf2fb6c7a)

Co-authored-by: Steve Dower <steve.dower@python.org>
2021-07-08 09:13:06 -07:00
Miss Islington (bot)
9f431dd0a5
bpo-44558: Match countOf is/== treatment to c (GH-27007)
(cherry picked from commit 6bd3ecfc27)

Co-authored-by: Rupert Tombs <rupert.tombs@gmail.com>
2021-07-07 06:50:41 -07:00
Miss Islington (bot)
645e527298
bpo-44563: Fix error handling in tee.fromiterable() (GH-27020) (GH-27041)
In debug build failed tee.fromiterable() corrupted the linked list of all GC objects.
(cherry picked from commit f64de53ff0)

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

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-07-05 23:34:53 +01:00
Miss Islington (bot)
22bcc0768e
bpo-41486: zlib uses an UINT32_MAX sliding window for the output buffer (GH-26143)
* zlib uses an UINT32_MAX sliding window for the output buffer

These funtions have an initial output buffer size parameter:
- zlib.decompress(data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)
- zlib.Decompress.flush([length])

If the initial size > UINT32_MAX, use an UINT32_MAX sliding window, instead of clamping to UINT32_MAX.
Speed up when (the initial size == the actual size).

This fixes a memory consumption and copying performance regression in earlier 3.10 beta releases if someone used an output buffer larger than 4GiB with zlib.decompress.

Reviewed-by: Gregory P. Smith
(cherry picked from commit a9a69bb3ea)

Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
2021-07-04 18:32:56 -07:00
Miss Islington (bot)
88970125e7
bpo-43977: Properly update the tp_flags of existing subclasses when their parents are registered (GH-26864)
(cherry picked from commit ca2009d72a)

Co-authored-by: Brandt Bucher <brandt@python.org>
2021-06-25 08:46:23 -07:00
Miss Islington (bot)
88a3342314
bpo-41621: Document defaultdict's default_factory parameter (GH-21945)
It defaults to None and is positional only.
(cherry picked from commit d1ae57027f)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2021-06-23 10:58:20 -04:00
Miss Islington (bot)
6614eac843
bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758) (GH-26824)
_thread.start_new_thread() no longer calls PyThread_exit_thread()
explicitly at the thread exit, the call was redundant.

On Linux with the glibc, pthread_cancel() loads dynamically the
libgcc_s.so.1 library. dlopen() can fail if there is no more
available file descriptor to open the file. In this case, the process
aborts with the error message:

"libgcc_s.so.1 must be installed for pthread_cancel to work"

pthread_cancel() unwinds back to the thread's wrapping function that
calls the thread entry point.

The unwind function is dynamically loaded from the libgcc_s library
since it is tightly coupled to the C compiler (GCC). The unwinder
depends on DWARF, the compiler generates DWARF, so the unwinder
belongs to the compiler.

Thanks Florian Weimer and Carlos O'Donell for their help on
investigating this issue.
(cherry picked from commit 45a78f906d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-06-21 14:29:17 +02:00
Erlend Egeberg Aasland
ccc95c7b47
[3.10] bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567) (GH-26816)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-20 22:07:31 +01:00
Miss Islington (bot)
28fe0159f5
bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992)
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit a317778fd5)

Co-authored-by: Georg Sauthoff <mail@georg.so>
2021-06-20 13:36:21 -07:00
Miss Islington (bot)
7297d74251
bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351) (GH-26766)
* Make functools types immutable

* Multibyte codec types are now immutable

* pyexpat.xmlparser is now immutable

* array.arrayiterator is now immutable

* _thread types are now immutable

* _csv types are now immutable

* _queue.SimpleQueue is now immutable

* mmap.mmap is now immutable

* unicodedata.UCD is now immutable

* sqlite3 types are now immutable

* _lsprof.Profiler is now immutable

* _overlapped.Overlapped is now immutable

* _operator types are now immutable

* winapi__overlapped.Overlapped is now immutable

* _lzma types are now immutable

* _bz2 types are now immutable

* _dbm.dbm and _gdbm.gdbm are now immutable
(cherry picked from commit 00710e6346)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-17 11:19:44 +01:00
Miss Islington (bot)
08f2b9dede
bpo-44389: Fix typo in ssl deprecation warning message (GH-26754)
`ssl.SSL_NO_TLS` should be `ssl.OP_NO_TLS`.
(cherry picked from commit c544393b89)

Co-authored-by: Joe <nigelchiang@outlook.com>
2021-06-17 03:00:56 -07:00
Miss Islington (bot)
e30fe27dab
bpo-42972: _thread.RLock implements the GH protocol (GH-26734)
The _thread.RLock type now fully implement the GC protocol: add a
traverse function and the Py_TPFLAGS_HAVE_GC flag.
(cherry picked from commit 1cd3d859a4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-06-15 06:29:44 -07:00
Miss Islington (bot)
4becc569a6
[3.10] bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700) (GH-26705)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit bf527277d4)


Co-authored-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: GH:tiran
2021-06-13 05:07:00 -07:00
Miss Islington (bot)
f30f484e96
bpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680)
(cherry picked from commit cb7230c7a7)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-13 03:29:33 -07:00
Serhiy Storchaka
c43317d41e
[3.10] Add more const modifiers. (GH-26691). (GH-26692)
(cherry picked from commit be8b631b7a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-06-12 18:44:32 +01:00
Miss Islington (bot)
d7930fb720
bpo-44362: ssl: improve deprecation warnings and docs (GH-26646)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e26014f1c4)

Co-authored-by: Christian Heimes <christian@python.org>
2021-06-11 00:36:17 -07:00
Miss Islington (bot)
0895e62c9b
bpo-44363: Get test_capi passing with address sanitizer (GH-26639)
(cherry picked from commit 31aa0dbff4)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2021-06-10 05:02:22 -07:00
Miss Islington (bot)
b5cedd0980
bpo-44227: Update bisect docstrings (GH-26548) (GH-26563) 2021-06-06 12:52:42 -07:00
Miss Islington (bot)
317e9ed436
bpo-44304: Ensure the sqlite3 destructor callback is always called with the GIL held (GH-26551) (GH_26552)
(cherry picked from commit 6e3b7cf3af)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-06 00:13:27 +01:00
Miss Islington (bot)
ad2f3b74b5
bpo-44304: Fix crash in the sqlite3 module when the GC clears Statement objects (GH-26545)
(cherry picked from commit fa106a685c)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-04 20:09:40 -07:00
Miss Islington (bot)
067d6d4657
bpo-43853: Handle sqlite3_value_text() errors (GH-25422)
(cherry picked from commit 006fd869e4)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-04 11:54:39 -07:00
Erlend Egeberg Aasland
84d80f5f30
[3.10] bpo-42972: Track sqlite3 statement objects (GH-26475) (GH-26515)
Allocate and track statement objects in pysqlite_statement_create.

By allocating and tracking creation of statement object in
pysqlite_statement_create(), the caller does not need to worry about GC
syncronization, and eliminates the possibility of getting a badly
created object. All related fault handling is moved to
pysqlite_statement_create().

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

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-06-03 18:38:09 +02:00
Miss Islington (bot)
0e9af8cae3
bpo-44285: getpath.c: Assert that env_file is NULL during an error check (GH-26486)
This was flagged by a static analyzer, but the logic of why this is NULL on error is hard to follow for humans as well.
(cherry picked from commit bdb56902a3)

Co-authored-by: stratakis <cstratak@redhat.com>
2021-06-02 16:50:38 -07:00
Miss Islington (bot)
7fe9cad606
bpo-44263: Fix _decimal and _testcapi GC protocol (GH-26464) (GH-26465)
* _testcapi.heapgctype: implement a traverse function since the type
  is defined with Py_TPFLAGS_HAVE_GC.
* _decimal: PyDecSignalDictMixin_Type is no longer defined with
  Py_TPFLAGS_HAVE_GC since it has no traverse function.
(cherry picked from commit 142e5c5445)

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

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-05-31 12:25:47 +01:00
Miss Islington (bot)
f097d2302b
bpo-42972: Fully implement GC protocol for xxlimited (GH-26451) (GH-26460)
(cherry picked from commit 4b20f2574d)

Co-authored-by: Hai Shi <shihai1992@gmail.com>

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2021-05-31 12:23:13 +01:00
Miss Islington (bot)
ff359d735f
bpo-42972: Fix sqlite3 traverse/clear functions (GH-26452) (GH-26461)
(cherry picked from commit d1124b09e8)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-31 11:12:27 +02:00
Miss Islington (bot)
a7aa105702
bpo-44252: Correctly implement gc support for SSLError objects (GH-26439) (GH-26441)
(cherry picked from commit 8b4312b909)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-29 00:47:36 +01:00
Ken Jin
0d39951632
[3.10] bpo-42972: Fully support GC for _winapi.Overlapped (GH-26381) (#26430)
* bpo-42972: Fully support GC for _winapi.Overlapped (GH-26381)

* untrack earlier
2021-05-28 18:47:15 +01:00
Miss Islington (bot)
1c0106ca8c
bpo-42972: Fully implement GC protocol for functools LRU cache (GH-26423)
(cherry picked from commit 3f8d332527)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-28 07:26:07 -07:00
Miss Islington (bot)
eb8ab04dd7
bpo-42972: Fully implement GC protocol for functools keywrapper and partial types (GH-26363) (GH-26424)
(cherry picked from commit 8994e9c2cd)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-28 11:08:01 +02:00
Miss Islington (bot)
35be1f3602
bpo-44256: Do not expose _functools._list_elem_type (GH-26416)
It is internal use only type.
(cherry picked from commit 28be3191a9)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-05-28 16:10:45 +09:00
Miss Islington (bot)
da9e0cb4de
bpo-42972: Fully implement GC protocol for re types (GH-26368) (GH-26414)
(cherry picked from commit fba42d1188)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-28 02:23:37 +02:00
Miss Islington (bot)
d1c732912e
bpo-42972: Fully support GC protocol for _operator heap types (GH-26371) (GH-26413)
(cherry picked from commit f4b70c22c8)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-27 23:49:43 +02:00
Miss Islington (bot)
da8097aaf5
bpo-42972: Fully support GC for mmap heap types (GH-26373)
(cherry picked from commit 318adeba78)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-27 09:43:56 -07:00
Miss Islington (bot)
e73b3b1cd4
bpo-42972: Fully support GC protocol for _queue.SimpleQueue (GH-26372) (GH-26406)
(cherry picked from commit 4d7f8f9f7f)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-27 18:25:50 +02:00
Miss Islington (bot)
ea47a8a71a
bpo-42972: Fully implement GC protocol for ssl heap types (GH-26370) (GH-26399)
(cherry picked from commit dcb8786a98)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-27 18:25:22 +02:00
Miss Islington (bot)
0bf0500baa
bpo-42972: Fully support GC for pyexpat, unicodedata, and dbm/gdbm heap types (GH-26376)
* bpo-42972: pyexpat
* bpo-42972: unicodedata
* bpo-42972: dbm/gdbm
(cherry picked from commit 59af59c2df)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-27 08:26:15 -07:00
Miss Islington (bot)
4431922f92
[3.10] bpo-42972: Fully support GC for hashlib heap types (GH-26374) (GH-26398)
(cherry picked from commit 6ef5ba391d)


Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Automerge-Triggered-By: GH:tiran
2021-05-27 01:10:39 -07:00
Miss Islington (bot)
4115996342
bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant (GH-26391) (GH-26393)
Move _PyLong_GetZero() and _PyLong_GetOne() loop invariants outside
loops in functions:

* math.comb()
* math.gcd()
* math.lcm()
* math.perm()
(cherry picked from commit 3e7ee02327)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-05-27 01:13:17 +02:00