Commit Graph

28431 Commits

Author SHA1 Message Date
Miss Islington (bot) 00f8fe9564
[3.11] gh-91162: Fix substitution of unpacked tuples in generic aliases (GH-92335) (#92484)
* gh-91162: Fix substitution of unpacked tuples in generic aliases (GH-92335)
(cherry picked from commit 9d25db9db1)

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

* Regenerate ABI file

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2022-06-01 03:13:27 +01:00
Miss Islington (bot) b425d887aa
gh-92597: Ensure that AST nodes without explicit end positions can be compiled (GH-93359)
(cherry picked from commit 705eaec28f)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-05-31 16:26:16 -07:00
Miss Islington (bot) 7f6e6abdc4
gh-93351: Ensure the position information in AST nodes created by the parser is always consistent (GH-93352)
(cherry picked from commit 5893b5db98)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-05-30 11:52:36 -07:00
Miss Islington (bot) 85cb7f08ed
gh-92839: fixed typo in _bisectmodule.c (line 131) (GH-92849)
(cherry picked from commit 7fa9b7daa5)

Co-authored-by: oda-gitso <105083118+oda-gitso@users.noreply.github.com>
2022-05-28 11:31:06 -07:00
Miss Islington (bot) 647426d4fa
gh-93250: [Enum] Change IntEnum boundary to KEEP for backwards compatibility (GH-93302) (GH-93304)
In previous versions of Python if an IntEnum member was combined with another integer type value using a bit-wise operation, the resulting value would still be the IntEnum type.  This change restores that behavior.
(cherry picked from commit 70cfe56caf)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-05-27 15:43:13 -07:00
Miss Islington (bot) 9303a5ac30
gh-92898: Enhance _testcppext test on cast to PyObject* (GH-93111)
* Add StrongRef class.
* Rename and reformat functions of the _Py_CAST() implementation.
(cherry picked from commit 20d30ba2cc)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-26 16:39:28 -07:00
Miss Islington (bot) 9555d77953
test.pythoninfo logs more build info (GH-93225)
Log also test.support.check_sanitizer() values.
(cherry picked from commit 06dd26f89f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-26 07:33:50 -07:00
Miss Islington (bot) 4d863453f8
gh-93005: Fix py.exe launcher test to search for intended tag (GH-93190)
(cherry picked from commit ca58e4a2c5)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-05-25 15:29:36 -07:00
Miss Islington (bot) 0fb70ce191
gh-90473: Misc test fixes for WASI (GH-93218)
* ``sys.executable`` is not set
* WASI does not support subprocess
* ``pwd`` module is not available
* WASI checks ``open`` syscall flags more strict, needs r, w, rw flag.
* ``umask`` is not available
* ``/dev/null`` may not be accessible
(cherry picked from commit 1f134e96ba)

Co-authored-by: Christian Heimes <christian@python.org>
2022-05-25 07:24:32 -07:00
Miss Islington (bot) 2ea3d3b847
test_threaded_import: Fix unittest.main spelling (GH-93114)
(cherry picked from commit 19710145b4)

Co-authored-by: Florian Bruhin <me@the-compiler.org>
2022-05-25 01:22:21 -07:00
Miss Islington (bot) e9d6ca4334
[3.11] gh-83245: Raise BadZipFile instead of ValueError when reading a corrupt ZIP file (GH-32291) (GH-93141)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 202ed2506c)


Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-25 00:57:36 -07:00
Miss Islington (bot) 74b205b3eb
gh-92728: Restore re.template, but deprecate it (GH-93161)
Revert "bpo-47211: Remove function re.template() and flag re.TEMPLATE (GH-32300)"

This reverts commit b09184bf05.
(cherry picked from commit 16a7e4a0b7)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2022-05-24 23:32:20 -07:00
Miss Islington (bot) 7a5f190c9f
test.pythoninfo no longer requires socket (GH-93191)
test.pythoninfo no longer fails if "import socket" fails: the socket
module is now optional.
(cherry picked from commit 4a31ed8a32)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-24 17:41:02 -07:00
Miss Islington (bot) a6ee7f99cc
GH-89369: test_contextlib_async finalizes event loop after each test (GH-93074)
Use asyncio.run().
(cherry picked from commit d2ef66a10b)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-05-24 07:07:59 -07:00
Miss Islington (bot) 719edfaf79
GH-93112: Fix missing ResourceDenied import in test_urllib2net (GH-93113)
The code was moved out of test.support in
311110abcd (GH-20812), thus making
ResourceDenied undefined.
(cherry picked from commit 37c9a351b1)

Co-authored-by: Florian Bruhin <me@the-compiler.org>
2022-05-24 05:37:06 -07:00
Miss Islington (bot) c771cbe8f9
gh-93065: Fix HAMT to iterate correctly over 7-level deep trees (GH-93066) (GH-93145)
Also while there, clarify a few things about why we reduce the hash to 32 bits.

Co-authored-by: Eli Libman <eli@hyro.ai>
Co-authored-by: Yury Selivanov <yury@edgedb.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>

(cherry picked from commit c1f5c903a7)
2022-05-24 10:52:06 +02:00
Miss Islington (bot) 97fe65a7be
gh-93099: Fix _pyio to use locale module properly (gh-93136)
(cherry picked from commit f7fabae75c)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-05-23 18:03:37 -07:00
Miss Islington (bot) f0950585a3
gh-93061: Mark as artificial: backwards jump after async for (GH-93062) (GH-93110)
(cherry picked from commit a458be3263)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2022-05-23 14:58:53 -04:00
Ethan Furman 96218f774e
[3.11] gh-93100: [Enum] fix missing variable in global_str (GH-93107) (GH-93134)
(cherry picked from commit 046df59658)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2022-05-23 10:11:18 -07:00
Miss Islington (bot) a509d2674a
gh-93010: InvalidHeaderError used but nonexistent (GH-93015)
* fix issue 93010

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 71abeb0895)

Co-authored-by: oda-gitso <105083118+oda-gitso@users.noreply.github.com>
2022-05-23 09:57:12 -07:00
Miss Islington (bot) 8c5739e425
gh-93005: Fixes launcher test when no Python install is available (GH-93007)
(cherry picked from commit 949dbf97ba)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-05-23 09:42:41 -07:00
Miss Islington (bot) acc998a831
GH-93115: Fix version check in sqlite3 module constants test (GH-93116)
(cherry picked from commit d5f0dd1600)

Co-authored-by: Florian Bruhin <me@the-compiler.org>
2022-05-23 09:35:13 -07:00
Miss Islington (bot) a29b1f8b4b
gh-90473: WASI: skip gethostname tests (GH-93092)
- WASI's ``gethostname()`` is a stub that always fails with OSError
  ``ENOTSUP``
- skip mailcap ``test`` if subprocess is not available
- WASI process_time clock does not work.
(cherry picked from commit 760ec8940a)

Co-authored-by: Christian Heimes <christian@python.org>
2022-05-23 08:21:45 -07:00
Miss Islington (bot) 748c83d96d
Clean up the sqlite3 tests (GH-93056)
Remove helper managed_connect(). Use memory_database() or
contextlib.closing() + addCleanup(unlink) instead.
(cherry picked from commit e5d8dbdd30)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-21 09:37:04 -07:00
Miss Islington (bot) 76b6ed17ea
Improve tests for opening Sqlite by URI (GH-93047)
* Test with with escaped non-ascii characters
* Test read-only open of existing DB.
(cherry picked from commit 4e2b664892)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-21 08:05:13 -07:00
Dong-hee Na dd923c5725
[3.11] GH-92898: Make _Py_Cast C++ version compatible with cast operator (gh-92951) (gh-93049) 2022-05-21 23:52:45 +09:00
Serhiy Storchaka d9a48d2b41
[3.11] gh-93044: No longer convert the database argument of sqlite3.connect() to bytes (GH-93046) (GH-93048)
Just pass it to the factory as is.
(cherry picked from commit 14c0d33016)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-21 16:53:58 +03:00
Miss Islington (bot) 6ec050f633
gh-91922: Fix sqlite connection on nonstardard locales and paths (GH-92926)
(cherry picked from commit d853758092)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-20 02:42:48 -07:00
Miss Islington (bot) a2ec09b7f5
gh-92817: Fix precedence of options to py.exe launcher (GH-92988)
(cherry picked from commit 73473fdeac)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-05-19 16:10:38 -07:00
Miss Islington (bot) 4eb2f40756
gh-92913: Clarify changes to PyInitConfig.module_search_paths[_set] fields (GH-92980)
(cherry picked from commit 403d16fa28)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-05-19 13:13:15 -07:00
Miss Islington (bot) 57d7ddd607
bpo-28249: fix `lineno` location for empty `DocTest` instances (GH-30498) (GH-92978)
(cherry picked from commit 8db2b3b687)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-05-19 20:03:06 +02:00
Miss Islington (bot) 71cdf6a38a
gh-92675: venv: Fix ensure_directories() to again accept a Path for env_dir (GH-92676)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 30deeac649)

Co-authored-by: David Foster <david@dafoster.net>
2022-05-19 08:17:28 -07:00
Miss Islington (bot) 7afccd34a6
gh-90473: Decrease recursion limit and skip tests on WASI (GH-92803)
(cherry picked from commit 137fd3d88a)

Co-authored-by: Christian Heimes <christian@python.org>
2022-05-19 08:05:52 -07:00
Miss Islington (bot) ad2363d54c
gh-92670: Skip test_shutil.TestCopy.test_copyfile_nonexistent_dir on AIX (GH-92718)
(cherry picked from commit 654032ac5f)

Co-authored-by: Ayappan Perumal <ayappap2@in.ibm.com>
2022-05-19 02:50:39 -07:00
Miss Islington (bot) 58088a544c
gh-89898: Fix test_threading.test_args_argument() (GH-92885)
Join the thread to not leak threads running in the background to the
next test.

Fix the following warning on the "AMD64 FreeBSD Shared 3.11"
buildbot:

test_args_argument (test.test_threading.ThreadTests.test_args_argument) ...
Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)
Warning -- Dangling thread: <_MainThread(MainThread, started 35026161664)>
Warning -- Dangling thread: <Thread(Thread-134 (<lambda>), started 35314998016)>
ok
(cherry picked from commit 970efae274)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-17 15:45:56 -07:00
Miss Islington (bot) 1df455042d
gh-89653: PEP 670: Fix PyUnicode_READ() cast (GH-92872)
_Py_CAST() cannot be used with a constant type: use _Py_STATIC_CAST()
instead.
(cherry picked from commit e6fd7992a9)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-17 10:45:55 -07:00
Christian Heimes 8f937976bc
[3.11] gh-90473: Skip tests that don't apply to Emscripten and WASI (GH-92846) (GH-92851)
Co-authored-by: Christian Heimes <christian@python.org>
2022-05-16 20:15:56 +02:00
Miss Islington (bot) 52e6596fb5
gh-92671: Don't omit parentheses when unparsing empty tuples (GH-92673)
(cherry picked from commit f6fd8aac13)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2022-05-16 06:01:34 -07:00
Miss Islington (bot) 5f24acdca0
gh-90473: WASI: Mark tests that require os.pipe() (GH-92837)
(cherry picked from commit 730902c0ad)

Co-authored-by: Christian Heimes <christian@python.org>
2022-05-16 01:04:01 -07:00
Miss Islington (bot) dae3e2fea3
Check result of utc_to_seconds and skip fold probe in pure Python (GH-91582)
The `utc_to_seconds` call can fail, here's a minimal reproducer on
Linux:

TZ=UTC python -c "from datetime import *; datetime.fromtimestamp(253402300799 + 1)"

The old behavior still raised an error in a similar way, but only
because subsequent calculations happened to fail as well. Better to fail
fast.

This also refactors the tests to split out the `fromtimestamp` and
`utcfromtimestamp` tests, and to get us closer to the actual desired
limits of the functions. As part of this, we also changed the way we
detect platforms where the same limits don't necessarily apply (e.g.
Windows).

As part of refactoring the tests to hit this condition explicitly (even
though the user-facing behvior doesn't change in any way we plan to
guarantee), I noticed that there was a difference in the places that
`datetime.utcfromtimestamp` fails in the C and pure Python versions, which
was fixed by skipping the "probe for fold" logic for UTC specifically —
since UTC doesn't have any folds or gaps, we were never going to find a
fold value anyway. This should prevent some failures in the pure python
`utcfromtimestamp` method on timestamps close to 0001-01-01.

There are two separate news entries for this because one is a
potentially user-facing change, the other is an internal code
correctness change that, if anything, changes some error messages. The
two happen to be coupled because of the test refactoring, but they are
probably best thought of as independent changes.

Fixes GH-91581
(cherry picked from commit 83c0247d47)

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2022-05-14 07:59:52 -07:00
Miss Islington (bot) 9640676356
gh-92311: Add tests for frame_setlineno jumping over listcomps (GH-92741)
(cherry picked from commit 8cf2906828)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2022-05-13 23:19:00 -07:00
Miss Islington (bot) 2e8b2d0ee2
GH-92236: Remove spurious "line" event when starting coroutine or generator. (GH-92722) (GH-92772)
(cherry picked from commit 22a1db378c)
2022-05-13 11:52:54 +01:00
Miss Islington (bot) c41667e71b
gh-90473: Increase stack size, disable obmalloc on WASI (GH-92732)
(cherry picked from commit d81d57e959)

Co-authored-by: Christian Heimes <christian@python.org>
2022-05-13 00:00:33 -07:00
Miss Islington (bot) c7b9da5204
gh-92031, test_embed: Improve test for unquickening static code (GH-92440)
(cherry picked from commit 27185f98ff)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2022-05-11 16:22:45 -07:00
Miss Islington (bot) 64593f2fed
gh-90978: asyncio TestSSL uses SHORT_TIMEOUT (GH-92642)
TestSSL of asyncio now uses support.SHORT_TIMEOUT rather than
hardcoded timeouts like 5, 10 or 40 seconds.
(cherry picked from commit 1d1929fcb5)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-11 14:56:07 -07:00
Miss Islington (bot) 20fec2c265
[3.11] gh-91810: ElementTree: Use text file's encoding by default in XML declaration (GH-91903) (GH-92663)
ElementTree method write() and function tostring() now use the text file's
encoding ("UTF-8" if not available) instead of locale encoding in XML
declaration when encoding="unicode" is specified.
(cherry picked from commit 707839b0fe)


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

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-11 10:36:52 -07:00
Miss Islington (bot) 5135b6ed73
gh-92550: Fix pathlib.Path.rglob() for empty pattern (GH-92604)
(cherry picked from commit 87f849c775)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-10 22:13:11 -07:00
Miss Islington (bot) 951cfc8e54
Fix inconsistent return type for statistics median_grouped() gh-92531 (GH-92533) (#92656) 2022-05-10 23:45:17 -05:00
Serhiy Storchaka 5197134c1c
Revert "gh-92550 - Fix regression in `pathlib.Path.rglob()` (GH-92583)" (GH-92599)
This reverts commit a51baec9ce.
2022-05-11 07:14:40 +03:00
Miss Islington (bot) 6a17cdebe9
gh-92619: Fix bug where the compiler duplicates exit blocks unnecessarily (GH-92620) (GH-92621)
(cherry picked from commit 7c6b7ade8d)

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

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-05-10 22:01:17 +01:00