Commit graph

47633 commits

Author SHA1 Message Date
Jelle Zijlstra
4674b315e5
[3.10] gh-92112: Fix crash triggered by an evil custom mro() (GH-92113) (#92370)
(cherry picked from commit 85354ed78c)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2022-05-06 21:01:23 -07:00
Miss Islington (bot)
b5f5993dfe
Add source for character mappings (GH-92014) (#92389)
(cherry picked from commit d707d073be)

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

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-05-06 12:58:16 +02:00
Erlend Egeberg Aasland
2a2421e538
[3.10] gh-80254: Disallow recursive usage of cursors in sqlite3 converters (#92274)
* [3.10] gh-80254: Disallow recursive usage of cursors in `sqlite3` converters (#29054)

(cherry picked from commit f629dcfe83)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

* Fix ref leak in pysqlite_cursor_iternext
2022-05-05 12:46:21 -07:00
Miss Islington (bot)
9b47252d54
[3.10] gh-92118: Add test for traceback when exception is modified by (Async)ExitStack.__exit__ (GH-92339) (GH-92343) 2022-05-05 18:47:59 +01:00
Miss Islington (bot)
28eea73e7c
bpo-47029: Fix BrokenPipeError in multiprocessing.Queue at garbage collection and explicit close (GH-31913)
(cherry picked from commit dfb1b9da8a)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2022-05-03 17:16:21 -07:00
Miss Islington (bot)
30681d6655
bpo-29890: Test IPv*Interface construction with tuple argument (GH-30862)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit b295a92c50)

Co-authored-by: Humbled Drugman <humbled.drugman@gmail.com>
2022-05-03 11:18:31 -07:00
Miss Islington (bot)
58f2d2d10a
bpo-46604: fix function name in ssl module docstring (GH-31064)
The function fetch_server_certificate is replaced by get_server_certificate in the module. I reflected the change in the module docstrings.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit feca9bbd1f)

Co-authored-by: Kossi GLOKPOR <83467320+glk0@users.noreply.github.com>
2022-05-03 09:24:39 -07:00
Miss Islington (bot)
5f709bdb86
bpo-46415: Use f-string for ValueError in ipaddress.ip_{address,network,interface} helper functions (GH-30642)
`IPv*Network` and `IPv*Interface` constructors accept a 2-tuple of
(address description, netmask) as the address parameter.
When the tuple-based address is used errors are not propagated
correctly through the `ipaddress.ip_*` helper because of the %-formatting now expecting several arguments:

	In [7]: ipaddress.ip_network(("192.168.100.0", "fooo"))
        ...
	TypeError: not all arguments converted during string formatting

Compared to:

	In [8]: ipaddress.IPv4Network(("192.168.100.0", "foo"))
        ...
	NetmaskValueError: 'foo' is not a valid netmask

Use an f-string to make sure the error is always properly formatted.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 52dc9c3066)

Co-authored-by: Thomas Cellerier <thomascellerier@gmail.com>
2022-05-03 05:37:17 -07:00
Miss Islington (bot)
adc06cd2d7
gh-92106: Add test that subscription works on arbitrary TypedDicts (GH-92176)
(cherry picked from commit 81fb3548be)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-02 17:39:07 -07:00
Miss Islington (bot)
c467812bc0
bpo-46787: Fix ProcessPoolExecutor exception memory leak (GH-31408) (GH-31408)
Do not store `ProcessPoolExecutor` work item exception traceback that prevents
exception frame locals from being garbage collected.
(cherry picked from commit 9c204b148f)

Co-authored-by: themylogin <themylogin@gmail.com>
2022-05-02 15:45:22 -07:00
Thaddeus1499
c8ab1633fc
[3.10] bpo-43504: Remove effbot urls (GH-26308) (#92161)
* [3.10] Remove effbot urls (GH-26308).
(cherry picked from commit e9f66aedf4)

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
2022-05-02 12:21:51 -06:00
Erlend Egeberg Aasland
178d79ae67
[3.10] gh-89301: Fix regression with bound values in traced SQLite statements (#92147)
(cherry picked from commit 721aa96540)
2022-05-02 10:21:13 -06:00
Miss Islington (bot)
ac508276dc
concurrent.futures: Fix typo in docstring (GH-92121)
(cherry picked from commit b11243e85e)

Co-authored-by: Yiannis Hadjicharalambous <hadjicharalambous.yiannis@gmail.com>
2022-05-02 09:06:43 -07:00
Miss Islington (bot)
d985c8e2e0
bpo-36819: Fix crashes in built-in encoders with weird error handlers (GH-28593)
If the error handler returns position less or equal than the starting
position of non-encodable characters, most of built-in encoders didn't
properly re-size the output buffer. This led to out-of-bounds writes,
and segfaults.
(cherry picked from commit 18b07d773e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-02 02:58:41 -07:00
Gregory P. Smith
ea1eba03e7
[3.10] gh-91401: Conservative backport of subprocess._USE_VFORK (#91932)
This does not alter the `_posixsubprocess.fork_exec()` private API to
avoid issues for anyone relying on that (bad idea) or for anyone who's
`subprocess.py` and `_posixsubprocess.so` upgrades may not become
visible to existing Python 3.10 processes at the same time.

Backports the concept of cd5726fe67.

Provides a fail-safe way to disable vfork for #91401.

I didn't backport the documentation as I don't actually expect this to be used and `.. versionadded: 3.10.5` always looks weird in docs. It's being done more to have a fail-safe in place for people just in case.
2022-05-01 16:09:50 -07:00
Serhiy Storchaka
e8ff3c92f6
[3.10] gh-92049: Forbid pickling constants re._constants.SUCCESS etc (GH-92070) (GH-92073)
Previously, pickling did not fail, but the result could not be unpickled.
(cherry picked from commit 6d0d547033)
2022-04-30 15:33:39 +03:00
Miss Islington (bot)
19a079690c
bpo-43323: Fix UnicodeEncodeError in the email module (GH-32137)
It was raised if the charset itself contains characters not encodable
in UTF-8 (in particular \udcxx characters representing non-decodable
bytes in the source).
(cherry picked from commit e91dee87ed)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-30 05:31:28 -07:00
Miss Islington (bot)
7bd4411b90
bpo-26792: Improve docstrings of runpy module run_functions (GH-30729)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit 117836f123)

Co-authored-by: Humbled Drugman <humbled.drugman@gmail.com>
2022-04-29 11:45:43 -07:00
Miss Islington (bot)
11652ceccf
gh-91832: Add 'required' attr to argparse.Action repr (GH-91841)
GH- Adding 'required' to names in Lib.argparse.Action

gh-91832:
Added 'required' to the list `names` in `Lib.argparse.Action`.
Changed constant strings that test the Action object.

Automerge-Triggered-By: GH:merwok
(cherry picked from commit 4ed3900041)

Co-authored-by: Abhigyan Bose <abhigyandeepbose@gmail.com>
2022-04-28 08:27:17 -07:00
Miss Islington (bot)
e2514cb77f
Correct method name typo (GH-91970)
(cherry picked from commit c6b84a727c)

Co-authored-by: Simon de Vlieger <cmdr@supakeen.com>
2022-04-27 15:19:43 -07:00
Miss Islington (bot)
777d478d12
gh-91810: Expand ElementTree.write() tests to use non-ASCII data (GH-91989)
(cherry picked from commit f60b4c3d74)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-27 09:50:25 -07:00
Miss Islington (bot)
280749a8fd
Fix missing f prefix on f-strings (GH-91910)
(cherry picked from commit f882d33778)

Co-authored-by: Alexander Shadchin <alexandr.shadchin@gmail.com>
2022-04-27 00:08:05 -07:00
Serhiy Storchaka
dbe666d398
[3.10] gh-91915: Fix test_netrc on non-UTF-8 locale (GH-91918). (GH-91946)
(cherry picked from commit 36306cf786)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-26 10:50:22 +03:00
Miss Islington (bot)
3e219d3123
gh-91914: Fix test_curses on non-UTF-8 locale (GH-91919)
(cherry picked from commit f41c16bf51)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-25 22:57:57 -07:00
Miss Islington (bot)
79712c9d2e
gh-91916: Fix test_runpy on non-UTF-8 locale (GH-91920)
If use a non-builtin codec, partially implemented in Python
(e.g. ISO-8859-15), a new RecursionError (with empty error message)
can be raised while handle a RecursionError.

Testing for error message was needed to distinguish
a recursion error from arbitrary RuntimeError. After introducing
RecursionError, it became unnecessary.
(cherry picked from commit a568585069)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-25 22:26:47 -07:00
Miss Islington (bot)
971343eb56
gh-91904: Fix setting envvar PYTHONREGRTEST_UNICODE_GUARD (GH-91905)
It always failed on non-UTF-8 locale and prevented running regrtests.
(cherry picked from commit 54d068adfb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-25 08:03:47 -07:00
Miss Islington (bot)
c7e6bfd150
RE: Add more tests for inline flag "x" and re.VERBOSE (GH-91854)
(cherry picked from commit 6b45076bd6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-23 03:16:36 -07:00
Serhiy Storchaka
1748816e80
[3.10] gh-91575: Update case-insensitive matching in re to the latest Unicode version (GH-91580). (GH-91661)
(cherry picked from commit 1c2fcebf3c)
2022-04-22 21:44:05 +03:00
Serhiy Storchaka
080781cd49
[3.10] gh-91700: Validate the group number in conditional expression in RE (GH-91702) (GH-91831)
In expression (?(group)...) an appropriate re.error is now
raised if the group number refers to not defined group.

Previously it raised RuntimeError: invalid SRE code.
(cherry picked from commit 48ec61a89a)
2022-04-22 21:09:30 +03:00
Serhiy Storchaka
9c18d783c3
[3.10] gh-90568: Fix exception type for \N with a named sequence in RE (GH-91665) (GH-91830)
re.error is now raised instead of TypeError.
(cherry picked from commit 6ccfa31421)
2022-04-22 21:08:49 +03:00
Ken Jin
942ea19cf9
Fix whitespace/indentation issues in test_sys (GH-32369) (GH-32372) 2022-04-20 13:57:30 +08:00
Miss Islington (bot)
e08d32381d
gh-87497: Document that urllib.request sends headers in camel case (GH-24661) (#91517)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 325d6f5035)

Co-authored-by: Alix Lourme <alix.lourme@gmail.com>
2022-04-19 18:20:03 -07:00
Victor Stinner
a885f10325
gh-91231: multiprocessing BaseManager waits 1.0 second (#91701)
Shutting down a multiprocessing BaseManager now waits for 1 second until
the process completes, rather than 0.1 second, after the process is
terminated.
2022-04-19 17:06:00 +02:00
Miss Islington (bot)
c213cccc9b
Add more tests for group names and refs in RE (GH-91695)
(cherry picked from commit 74070085da)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-19 07:33:09 -07:00
Gregory P. Smith
61570ae0bc
[3.10] gh-91676 gh-91260 unittest.IsolatedAsyncioTestCase no longer leaks its executor (GH-91680)
For things like test_asyncio.test_thread this was causing frequent
"environment modified by test" errors as the executor threads had not
always stopped running after the test was over.
2022-04-19 10:31:50 +01:00
Gregory P. Smith
9a458934f7
[3.10] gh-91607: Fix several test_concurrent_futures tests to actually test what they claim (GH-91600) (#91612)
* Fix test_concurrent_futures to actually test what it says.

Many ProcessPoolExecutor based tests were ignoring the mp_context
and using the default instead.  This meant we lacked proper test
coverage of all of them.

Also removes the old _prime_executor() worker delay seeding code
as it appears to have no point and causes 20-30 seconds extra
latency on this already long test.  It also interfered with some
of the refactoring to fix the above to not needlessly create their
own executor when setUp has already created an appropriate one.

* Don't import the name from multiprocessing directly to avoid confusion.

(cherry picked from commit 7fa3a5a219)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-04-16 13:48:11 -07:00
Miss Islington (bot)
289f27d06b
gh-88513: clarify shutil.copytree's dirs_exist_ok arg (GH-91434) (GH-91464)
* add a paragraph to document this kwarg in detail
* update docstring in the source accordingly
(cherry picked from commit f33e2c87a8)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-15 15:55:13 +02:00
Miss Islington (bot)
52ce75fc1e
gh-90879: Fix missing parameter for put_nowait() (GH-91514)
(cherry picked from commit 0fc3517cf4)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-14 02:18:31 -07:00
Steve Dower
b0ec17b6d9
bpo-47103: Copy pgort140.dll into output directory when building PGInstrument on Windows (GH-32083) 2022-04-07 23:21:03 +01:00
Matthieu Dartiailh
94609e3192
[3.10] Backport bpo-47212 (GH-32302) to Python 3.10 (GH-32334)
(cherry picked from commit aa0f056a00)

# Conflicts:
#	Grammar/python.gram
#	Parser/action_helpers.c

Automerge-Triggered-By: GH:pablogsal
2022-04-05 09:21:49 -07:00
Miss Islington (bot)
6b4b892e09
bpo-46484:Add test for Calendar.iterweekdays (GH-30825)
(cherry picked from commit 48269ea9fd)

Co-authored-by: 180909 <734461790@qq.com>
2022-04-04 10:43:38 -07:00
Miss Islington (bot)
470dfe20cb
bpo-47205: Skip error check of sched_get/setaffinity on FreeBSD (GH-32285)
(cherry picked from commit b82cdd1dac)

Co-authored-by: Christian Heimes <christian@python.org>
2022-04-03 12:27:32 -07:00
Miss Islington (bot)
1069d52959
bpo-47089: Avoid test_compileall failures on Windows (GH-32037)
(cherry picked from commit 76b8a075b8)

Co-authored-by: Jeremy Kloth <jeremy.kloth@gmail.com>
2022-04-01 13:38:35 -07:00
Miss Islington (bot)
370900d7d8
Fix typo in the sqlite3 docs (GH-31915) (GH-32157)
Co-authored-by: Jonathan <89750679+AHypnotoad@users.noreply.github.com>
(cherry picked from commit 66584c890d)

Co-authored-by: Jonathan <jonathan.joyner94@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-03-28 21:21:27 -07:00
Miss Islington (bot)
2bcbc3113d
bpo-27929: resolve names only for AF_INET/AF_INET6 with asyncio (GH-32131)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit 5c30388f3c)

Co-authored-by: Vincent Bernat <vincent@bernat.ch>
2022-03-28 15:15:05 -07:00
Pablo Galindo
9006b4471c
Merge remote-tracking branch 'upstream/3.10' into 3.10 2022-03-24 10:30:54 +00:00
Miss Islington (bot)
9e1bfd8ce7
bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086)
(cherry picked from commit ff619c7dfe)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-23 14:43:32 -07:00
Christian Heimes
1b6acaad9a
[3.10] bpo-47101: list only activated algorithms in hashlib.algorithms_available (GH-32076) (GH-32085)
Co-authored-by: Christian Heimes <christian@python.org>
2022-03-23 22:15:25 +01:00
Pablo Galindo
9d38120e33
Python 3.10.4 2022-03-23 20:12:04 +00:00
Miss Islington (bot)
f163ad22d3
bpo-2604: Make doctest.DocTestCase reset globs in teardown (GH-31932)
Co-authored-by: Piet Delport
Co-authored-by: Hugo Lopes Tavares
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 7ba7eae508)

Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
2022-03-22 14:31:44 -07:00