Commit graph

46728 commits

Author SHA1 Message Date
Gregory P. Smith
2a43afdba9
[3.9] [3.10] gh-91607: Fix several test_concurrent_futures tests to actually test what they claim (GH-91600) (GH-91612) (#91617)
* 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)
(cherry picked from commit 9a458934f7)
2022-04-16 22:47:41 -07:00
Miss Islington (bot)
f3f5d4be7a
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:23:15 -07:00
Miss Islington (bot)
0ab5e83ff7
gh-87497: Document that urllib.request sends headers in camel case (GH-24661)
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-13 19:45:56 -07:00
Miss Islington (bot)
a8d245a675
gh-88513: clarify shutil.copytree's dirs_exist_ok arg (GH-91434) (GH-91465)
* add a paragraph to document this kwarg in detail
* update docstring in the source accordingly
(cherry picked from commit f33e2c87a8)

Co-authored-by: Jack DeVries <jdevries3133@gmail.com>
2022-04-12 19:58:02 -07:00
Miss Islington (bot)
4cc4fe2789
[3.9] GH-89074: Fixed IsolatedAsyncioTestCase from throwing an exception on leaked tasks (GH-27765) (#91471)
(cherry picked from commit 2cb1a6806c)

Co-authored-by: Bar Harel <bar.harel@biocatch.com>
2022-04-11 23:14:43 -05:00
Steve Dower
80c115385c
bpo-47103: Copy pgort140.dll into output directory when building PGInstrument on Windows (GH-32083) 2022-04-08 01:02:58 +01:00
Ken Jin
1ab53511e9
Fix whitespace/indentation issues in test_sys (GH-32369) (GH-32373)
(cherry picked from commit da922409ac)
2022-04-07 01:11:07 +08:00
Miss Islington (bot)
5b4bc61d89
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:41:50 -07:00
Miss Islington (bot)
490ccbd6e0
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 08:30:39 -07:00
Jeremy Kloth
306a93b481
[3.9] bpo-47089: Avoid test_compileall failures on Windows (GH-32037). (GH-32240)
* [3.9] 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-02 03:40:27 +02:00
Miss Islington (bot)
d6d170fa80
Fix typo in the sqlite3 docs (GH-31915) (GH-32158)
Co-authored-by: Jonathan <89750679+AHypnotoad@users.noreply.github.com>
(cherry picked from commit 66584c890d)

Co-authored-by: Jonathan <jonathan.joyner94@gmail.com>
2022-03-28 19:40:38 -07:00
Miss Islington (bot)
f84fb55659
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:16:30 -07:00
Łukasz Langa
b28265d7e6
Python 3.9.12 2022-03-23 22:12:08 +01:00
Miss Islington (bot)
ec3589f59d
bpo-47101: list only activated algorithms in hashlib.algorithms_available (GH-32076)
(cherry picked from commit 48e2010d92)

Co-authored-by: Christian Heimes <christian@python.org>
2022-03-23 13:58:02 -07:00
Miss Islington (bot)
3c6019035f
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:27:26 -07:00
Jeremy Kloth
8db7610d1a
bpo-44336: Prevent tests hanging on child process handles on Windows (GH-26578)
Replace the child process `typeperf.exe` with a daemon thread that reads the performance counters directly.  This prevents the issues that arise from inherited handles in grandchild processes (see issue37531 for discussion).

We only use the load tracker when running tests in multiprocess mode. This prevents inadvertent interactions with tests expecting a single threaded environment.  Displaying load is really only helpful for buildbots running in multiprocess mode anyway..

Co-authored-by: Jeremy Kloth <jeremy.kloth@gmail.com>
2022-03-22 17:21:35 +00:00
Andrew Svetlov
f47984b560
[3.9] bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910) (GH-32049)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>.
(cherry picked from commit 32e77154dd)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-22 17:16:27 +02:00
Gregory P. Smith
58a7e13037
bpo-38256: Fix binascii.crc32 large input. (GH-32000) (GH-32013) (GH-32015)
Inputs >= 4GiB to `binascii.crc32(...)` when compiled to use the zlib
crc32 implementation (the norm on POSIX) no longer return the wrong
result.

(cherry picked from commit 4c989e19c8)
2022-03-20 23:34:45 -07:00
Miss Islington (bot)
4aa8b80251
bpo-42369: Fix thread safety of zipfile._SharedFile.tell (GH-26974)
The `_SharedFile` tracks its own virtual position into the file as
`self._pos` and updates it after reading or seeking. `tell()` should
return this position instead of calling into the underlying file object,
since if multiple `_SharedFile` instances are being used concurrently on
the same file, another one may have moved the real file position.
Additionally, calling into the underlying `tell` may expose thread
safety issues in the underlying file object because it was called
without taking the lock.
(cherry picked from commit e730ae7eff)

Co-authored-by: Kevin Mehall <km@kevinmehall.net>
2022-03-20 07:54:19 -07:00
Miss Islington (bot)
e207d721fc
[3.9] bpo-40296: Fix supporting generic aliases in pydoc (GH-30253). (GH-31976) (GH-31981)
(cherry picked from commit cd44afc573)
(cherry picked from commit a5b7678a67)
2022-03-19 17:12:48 +02:00
Miss Islington (bot)
cbcd2e36d6
bpo-39394: Improve warning message in the re module (GH-31988)
A warning about inline flags not at the start of the regular
expression now contains the position of the flag.
(cherry picked from commit 4142961b9f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-03-19 07:09:59 -07:00
Serhiy Storchaka
4d2099f455
[3.9] bpo-14156: Make argparse.FileType work correctly for binary file modes when argument is '-' (GH-13165) (GH-31979)
Also made modes containing 'a' or 'x' act the same as a mode containing 'w' when argument is '-'
(so 'a'/'x' return sys.stdout like 'w', and 'ab'/'xb' return sys.stdout.buffer like 'wb').
(cherry picked from commit eafec26ae5)

Co-authored-by: MojoVampire <shadowranger+github@gmail.com>
2022-03-18 17:02:44 +02:00
Miss Islington (bot)
1cab44d865
[3.9] bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654) (GH-31970)
(cherry picked from commit a0db11b10f)

Co-authored-by: Bader Zaidan <bader@zaidan.pw>
2022-03-17 20:24:59 -07:00
Jelle Zijlstra
e808c9d5c7
[3.9] bpo-42782: fix broken shutil test (GH-31971)
We were using os_helper, which doesn't exist on 3.9. This wasn't
caught because the test is only run as root. I confirmed that when
run as root, the test previously failed and now passes.
2022-03-17 19:45:40 -07:00
Miss Islington (bot)
612019e60e
bpo-45979: Fix Tkinter tests with old Tk (>= 8.5.12) (GH-31938)
(cherry picked from commit dbbe4d2d00)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-03-17 00:29:37 -07:00
Miss Islington (bot)
4e9bb27eae
bpo-47038: Increase a test timeout for slow CI machines (GH-31951)
(cherry picked from commit a7c5414832)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-16 18:19:18 -07:00
Miss Islington (bot)
0412e3ae03
bpo-47038: Rewrite missed asyncio.wait_for test to use IsolatedAnsyncioTestCase (GH-31946)
(cherry picked from commit 3dd9bfac04)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-16 16:44:22 -07:00
Andrew Svetlov
3244659521
[3.9] bpo-47038: Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase (GH-31942). (GH-31944)
(cherry picked from commit dd0082c627)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-16 22:45:39 +02:00
Miss Islington (bot)
0b0609d0d1
[3.10] bpo-45382: test.pythoninfo logs more Windows versions (GH-30891) (GH-30894)
Add the following info to test.pythoninfo:

* windows.ver: output of the shell "ver" command
* windows.version and windows.version_caption: output of the
  "wmic os get Caption,Version /value" command.

(cherry picked from commit b0898f4aa9)

* bpo-45382: test.pythoninfo: set wmic.exe encoding to OEM (GH-30890)

(cherry picked from commit cef0a5458f)
(cherry picked from commit 4a57fa296b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-03-16 11:13:55 +01:00
Łukasz Langa
0f0c55c9f0
Python 3.9.11 2022-03-15 21:47:24 +01:00
Miss Islington (bot)
32ae9ab55f
bpo-20392: Fix inconsistency with uppercase file extensions in mimetypes.guess_type (GH-30229)
(cherry picked from commit 5dd7ec52b8)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-03-15 08:50:01 -07:00
Miss Islington (bot)
64a68c39cb
bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)
(cherry picked from commit 70155412f1)

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-03-15 08:23:47 -07:00
Ned Deily
1b1239205d
Revert "bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820)" (GH-31881)
This reverts commit bda64b3c0c
as it breaks test_bdb and test_distutils with installed Pythons.
2022-03-14 17:10:20 -04:00
Jason R. Coombs
177be52517
[3.9] bpo-47004: Sync with importlib_metadata 4.11.3. (GH-31854). (GH-31859)
(cherry picked from commit b1e2868607)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2022-03-13 17:30:07 -04:00
Ned Deily
bda64b3c0c
bpo-46986: Upgrade bundled setuptools to 60.9.3 (GH-31820) (GH-31855)
(cherry picked from commit c99ac3c364)

Co-authored-by: Pradyun Gedam <pgedam@bloomberg.net>
2022-03-13 16:02:10 -04:00
Miss Islington (bot)
4f340b0739
[3.9] bpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819) (GH-31850)
(cherry picked from commit d87f1b787e)


Co-authored-by: Pradyun Gedam <pgedam@bloomberg.net>

Automerge-Triggered-By: GH:ned-deily
2022-03-13 11:55:32 -07:00
Jelle Zijlstra
f7f7838b41
[3.9] bpo-46198: rename duplicate tests and remove unused code (GH-30297) (GH-31797)
(cherry picked from commit 6c83c8e6b5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-03-10 13:18:27 -08:00
Irit Katriel
f3ea249569
bpo-24959: fix unittest.assertRaises bug where traceback entries are dropped from chained exceptions (GH-23688) (GH-31776)
(cherry picked from commit 88b7d86a73)
2022-03-08 23:00:45 +00:00
Miss Islington (bot)
20e88f78a3
bpo-46955: Expose asyncio.base_events.Server as asyncio.Server (GH-31760)
This change aligns the documentation at https://docs.python.org/3/library/asyncio-eventloop.htmlGH-asyncio.Server
with the actual implementation

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit da80d6b2f3)

Co-authored-by: Stefan Zabka <zabkaste@informatik.hu-berlin.de>
2022-03-08 13:32:46 -08:00
Miss Islington (bot)
0663ca17f5
bpo-44439: _ZipWriteFile.write() handle buffer protocol correctly (GH-29468)
Co-authored-by: Marco Ribeiro <marcoffee@users.noreply.github.com>
(cherry picked from commit 36dd7396fc)

Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
2022-03-08 02:04:54 -08:00
Miss Islington (bot)
852d9b77ab
[3.9] bpo-43292: Fix file leak in ET.iterparse() when not exhausted (GH-31696) (GH-31720)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 496c428de3)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2022-03-07 13:48:53 +02:00
Miss Islington (bot)
7fba55f15a
Lib/typing.py copy edits originating from GH-31061 (GH-31684)
(cherry picked from commit 2031149b9a)

Co-authored-by: Matt Bogosian <eb3f73+github+com@yaymail.com>
2022-03-04 19:21:51 -08:00
Miss Islington (bot)
01df048831
bpo-25415: Remove confusing sentence from IOBase docstrings (PR-31631)
(cherry picked from commit cedd2473a9)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-03-04 10:34:14 -08:00
Victor Stinner
6a14330318
bpo-46913: Fix test_ctypes, test_hashlib, test_faulthandler on UBSan (GH-31675) (GH-31676)
* bpo-46913: Fix test_faulthandler.test_sigfpe() on UBSAN (GH-31662)

Disable undefined behavior sanitizer (UBSAN) on
faulthandler_sigfpe().

(cherry picked from commit 4173d677a1)

* bpo-46913: Fix test_faulthandler.test_read_null() on UBSan (GH31672)

Disable undefined behavior sanitizer (UBSan) on
faulthandler._read_null().

(cherry picked from commit 65b92ccdec)

* bpo-46913: test_hashlib skips _sha3 tests on UBSan (GH-31673)

If Python is built with UBSan, test_hashlib skips tests on the _sha3
extension which currently has undefined behaviors.

This change allows to run test_hashlib to check for new UBSan regression,
but the known _sha3 undefined behavior must be fixed.

(cherry picked from commit 6d0d7d2b8c)

* bpo-46913: Skip test_ctypes.test_shorts() on UBSan (GH-31674)

If Python is built with UBSan, test_ctypes now skips test_shorts().
This change allows to run test_ctypes to check for new UBSan regression,
but the known test_shorts() undefined behavior must be fixed.

(cherry picked from commit ad1b04451d)
(cherry picked from commit 7b5b429ada)
2022-03-04 01:31:54 +01:00
Victor Stinner
359bc392ba
[3.10] bpo-46633: Skip tests on ASAN and/or MSAN builds (GH-31632) (GH-31634) (GH-31644)
* Refactor sanitiser skip tests into test.support (GH-30889)

* Refactor sanitizer skip tests into test.support

(cherry picked from commit b1cb843050)

* Add skips to crashing tests under sanitizers instead of manually skipping them (GH-30897)

(cherry picked from commit a27505345e)

* bpo-46633: Skip tests on ASAN and/or MSAN builds (GH-31632)

Skip tests on ASAN and/or MSAN builds:

* multiprocessing tests
* test___all__
* test_concurrent_futures
* test_decimal
* test_peg_generator
* test_tools

(cherry picked from commit 9204bb72a2)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
(cherry picked from commit 93264452d9)
2022-03-02 18:12:26 +01:00
Erlend Egeberg Aasland
3ea2a8f425
[3.9] bpo-43853: Expand test suite for SQLite UDF's (GH-27642) (GH-31030) (GH-31586)
(cherry picked from commit 3eb3b4f270)
2022-03-01 20:46:16 -08:00
Miss Islington (bot)
4560c7e605
bpo-46756: Fix authorization check in urllib.request (GH-31353)
Fix a bug in urllib.request.HTTPPasswordMgr.find_user_password() and
urllib.request.HTTPPasswordMgrWithPriorAuth.is_authenticated() which
allowed to bypass authorization. For example, access to URI "example.org/foobar"
was allowed if the user was authorized for URI "example.org/foo".
(cherry picked from commit e2e72567a1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-02-25 03:56:16 -08:00
Miss Islington (bot)
f3bb8fe4e8
Inherit asyncio proactor datagram transport from asyncio.DatagramTransport (GH-31512)
(cherry picked from commit cff4d5c5d2)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-02-22 16:08:43 -08:00
Miss Islington (bot)
29e8c43b32
bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit 8fb94893e4)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-02-22 13:10:04 -08:00
Miss Islington (bot)
336a916f75
bpo-46811: Make test suite support Expat >=2.4.5 (GH-31453) (GH-31469)
Curly brackets were never allowed in namespace URIs
according to RFC 3986, and so-called namespace-validating
XML parsers have the right to reject them a invalid URIs.

libexpat >=2.4.5 has become strcter in that regard due to
related security issues; with ET.XML instantiating a
namespace-aware parser under the hood, this test has no
future in CPython.

References:
- https://datatracker.ietf.org/doc/html/rfc3968
- https://www.w3.org/TR/xml-names/

Also, test_minidom.py: Support Expat >=2.4.5
(cherry picked from commit 2cae93832f)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2022-02-21 17:16:23 +01:00