Commit Graph

48608 Commits

Author SHA1 Message Date
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) 83940c0766
gh-90817: Deprecate explicitly locale.resetlocale() (GH-93196)
The function was already deprecated in Python 3.11 since it calls
locale.getdefaultlocale() which was deprecated in Python 3.11.
(cherry picked from commit bf58cd01b3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-25 13:29:58 -07:00
Miss Islington (bot) 37a7f1b099
[3.11] gh-93035: [Enum] Fix IntFlag crash when no single-bit members (GH-93076) (GH-93197)
`EnumType` attempts to create a custom docstring for each enum/flag, but that was failing with pathological flags that had no members (only multi-bit aliases).
(cherry picked from commit 08cfc3dabf)

Co-authored-by: Tobin Yehle <tobinyehle@gmail.com>
2022-05-25 10:50:24 -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) b8c4cc6b76
gh-93118: [Enum] fix error message (GH-93138) (GH-93142)
Include member names in error message.
(cherry picked from commit a49721ea07)
2022-05-23 14:37:18 -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) 6a3a6ba7a2
gh-91860: documentation for typing.dataclass_transform (GH-92768)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit f20a6a54fb)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-05-20 08:01:44 -07: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) aa55985aa8
gh-87901: Remove the encoding argument from os.popen (GH-92836)
(cherry picked from commit 96f65835f8)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2022-05-18 20:12:47 -07:00
Miss Islington (bot) 36da1a77c6
gh-92841: Fix asyncio's RuntimeError: Event loop is closed (GH-92842)
(cherry picked from commit 33880b4b1c)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-05-17 15:59:29 -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
Miss Islington (bot) 38d95b5500
[3.11] gh-92530: Fix an issue that occurred after interrupting threading.Condition.notify (GH-92534) (GH-92829)
If Condition.notify() was interrupted just after it released the waiter lock,
but before removing it from the queue, the following calls of notify() failed
with RuntimeError: cannot release un-acquired lock.
(cherry picked from commit 70af994fee)


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

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-17 09:45:40 -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) 2bcae11302
gh-90473: Fail subprocess early on Emscripten/WASI (GH-92802)
(cherry picked from commit db0b455ff4)

Co-authored-by: Christian Heimes <christian@python.org>
2022-05-14 11:47:17 -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) 5a33643dce
bpo-42627: Fix incorrect parsing of Windows registry proxy settings (GH-26307)
(cherry picked from commit b69297ea23)

Co-authored-by: 狂男风 <CrazyBoyFeng@Live.com>
2022-05-11 11:41:53 -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