summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* gh-103109: Document ignore_warnings() test support helper (GH-103110)Miss Islington (bot)2023-04-021-1/+1
| | | | | | (cherry picked from commit 32937d6aa414ec7db5c63ef277f21db1880b3af4) Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* [3.10] GH-87235: Make sure "python /dev/fd/9 9</path/to/script.py" works on ↵Miss Islington (bot)2023-03-281-0/+14
| | | | | | | | | | | | | | | | | | | | | | | macOS (GH-99768) (#99817) On macOS all file descriptors for a particular file in /dev/fd share the same file offset, that is ``open("/dev/fd/9", "r")`` behaves more like ``dup(9)`` than a regular open. This causes problems when a user tries to run "/dev/fd/9" as a script because zipimport changes the file offset to try to read a zipfile directory. Therefore change zipimport to reset the file offset after trying to read the zipfile directory. (cherry picked from commit d08fb257698e3475d6f69bb808211d39e344e5b2) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com> * Regen zipimport --------- Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.10] gh-88233: zipfile: handle extras after a zip64 extra (GH-96161) (#102087)Miss Islington (bot)2023-03-281-0/+62
| | | | | | | | | | Previously, any data _after_ the zip64 extra would be removed. With many new tests. Fixes GH-88233 (cherry picked from commit 59e86caca812fc993c5eb7dc8ccd1508ffccba86) Co-authored-by: Tim Hatch <tim@timhatch.com>
* [3.10] GH-95494: Fix transport EOF handling in OpenSSL 3.0 (GH-95495) (#103007)Miss Islington (bot)2023-03-271-3/+15
| | | | | | | | | | | | | | | | | | | | | | | GH-25309 enabled SSL_OP_IGNORE_UNEXPECTED_EOF by default, with a comment that it restores OpenSSL 1.1.1 behavior, but this wasn't quite right. That option causes OpenSSL to treat transport EOF as the same as close_notify (i.e. SSL_ERROR_ZERO_RETURN), whereas Python actually has distinct SSLEOFError and SSLZeroReturnError exceptions. (The latter is usually mapped to a zero return from read.) In OpenSSL 1.1.1, the ssl module would raise them for transport EOF and close_notify, respectively. In OpenSSL 3.0, both act like close_notify. Fix this by, instead, just detecting SSL_R_UNEXPECTED_EOF_WHILE_READING and mapping that to the other exception type. There doesn't seem to have been any unit test of this error, so fill in the missing one. This had to be done with the BIO path because it's actually slightly tricky to simulate a transport EOF with Python's fd based APIs. (If you instruct the server to close the socket, it gets confused, probably because the server's SSL object is still referencing the now dead fd?) (cherry picked from commit 420bbb783b43216cc897dc8914851899db37a31d) Co-authored-by: David Benjamin <davidben@google.com>
* gh-102980: Add tests for pdf's display, alias and where commands (GH-102981)Miss Islington (bot)2023-03-241-0/+150
| | | | | (cherry picked from commit ded9a7fc194a1d5c0e38f475a45f8f77dbe9c6bc) Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
* [3.10] gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers ↵Miss Islington (bot)2023-03-241-3/+3
| | | | | | | | (GH-96932) (#102919) gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (GH-96932) (cherry picked from commit af9c34f6ef8dceb21871206eb3e4d350f6e3d3dc) Co-authored-by: Benjamin Fogle <benfogle@gmail.com>
* [3.10] gh-102947: Improve traceback when calling `fields()` on a ↵Alex Waygood2023-03-231-0/+12
| | | | non-dataclass (#102948) (#102954)
* [3.10] gh-102721: Improve coverage of ↵Nikita Sobolev2023-03-171-7/+30
| | | | | | | `_collections_abc._CallableGenericAlias` (GH-102790) This is a manual backport of https://github.com/python/cpython/pull/102722 but without `typing.py` changes and without `TypeVarTuple` case, because it was added in 3.11 Automerge-Triggered-By: GH:AlexWaygood
* gh-94440: Fix issue of ProcessPoolExecutor shutdown hanging (GH-94468)Miss Islington (bot)2023-03-161-0/+28
| | | | | | | | Fix an issue of concurrent.futures ProcessPoolExecutor shutdown hanging. (cherry picked from commit 2dc94634b50f0e5e207787e5ac1d56c68b22c3ae) Co-authored-by: yonatanp <yonatan.perry@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-101377: improving test_locale_calendar_formatweekday of calendar (GH-101378)Miss Islington (bot)2023-03-151-2/+6
| | | | | | | | | --------- (cherry picked from commit 5e0865f22eed9f3f3f0e912c4ada196effbd8ce0) Co-authored-by: Andre Hora <andrehora@users.noreply.github.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* [3.10] GH-101673: Fix pdb bug where local variable changes are lost after ↵Irit Katriel2023-03-131-0/+29
| | | | | | | | | longlist (#101674) (#102633) GH-101673: Fix pdb bug where local variable changes are lost after longlist (#101674) (cherry picked from commit 5d677c556f03a34d1c2d86e4cc96025870c20c12) Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
* Fix broken link to MSDN (GH-102355)Miss Islington (bot)2023-03-131-1/+1
| | | | | (cherry picked from commit 9a8b66b58c74236959a01d579e2c156d9c2e7cb3) Co-authored-by: 谭九鼎 <109224573@qq.com>
* GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test (GH-102538)Miss Islington (bot)2023-03-131-1/+8
| | | | | | | | It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action. Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway. (cherry picked from commit 64bde502cf89963bc7382b03ea9e1c0967d22e35) Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
* gh-102433: Add tests for how classes with properties interact with ↵Miss Islington (bot)2023-03-111-0/+88
| | | | | | | | `isinstance()` checks on `typing.runtime_checkable` protocols (GH-102449) (cherry picked from commit 5ffdaf748d98da6065158534720f1996a45a0072) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Carl Meyer <carl@oddbird.net>
* [3.10] GH-102397: Fix segfault from race condition in signal handling ↵Miss Islington (bot)2023-03-081-0/+15
| | | | | | | | | (GH-102399) (#102527) GH-102397: Fix segfault from race condition in signal handling (GH-102399) (cherry picked from commit 1a84cc007e207f2dd61f86a7fc3d86632fdce72f) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.10] gh-102444: Fix minor bugs in `test_typing` highlighted by pyflakes ↵Alex Waygood2023-03-051-11/+1
| | | | | (#102445) (#102452) (cherry picked from commit 96e1022)
* GH-102341: Improve the test function for pow (GH-102342)Miss Islington (bot)2023-03-051-6/+5
| | | | | | (cherry picked from commit 32220543e2db36c6146ff2704ed1714a6adecc1b) Co-authored-by: Partha P. Mukherjee <ppm.floss@gmail.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* Fix unused classes in a typing test (GH-102437)Miss Islington (bot)2023-03-051-2/+2
| | | | | | | As part of investigation issue https://github.com/python/cpython/issues/102433, I discovered what I believe to be an error where two classes `CI` and `DI` are not being used. The assertions beneath them act on `C` and `D`, duplicating existing assertions in this test. (cherry picked from commit 7894bbe94ba319eb650f383cb5196424c77b2cfd) Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com> Automerge-Triggered-By: GH:AlexWaygood
* gh-101979: argparse: fix a bug where parentheses in metavar argument of ↵Miss Islington (bot)2023-03-051-0/+22
| | | | | | | add_argument() were dropped (GH-102318) (cherry picked from commit 9a478be1a4314734c697dda7a7b0e633a6fb0751) Co-authored-by: Yeojin Kim <yeojin.dev@gmail.com>
* gh-102356: Add thrashcan macros to filter object dealloc (GH-102426)Miss Islington (bot)2023-03-051-0/+10
| | | | | | Add thrashcan macros to the deallocator of the filter objects to protect against deeply nested destruction of chains of nested filters. (cherry picked from commit 66aa78cbe604a7c5731f074b869f92174a8e3b64) Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
* [3.10] gh-102179: Fix `os.dup2` error reporting for negative fds (GH-102180) ↵Miss Islington (bot)2023-03-041-0/+16
| | | | | | | | | (#102419) * gh-102179: Fix `os.dup2` error reporting for negative fds (GH-102180) (cherry picked from commit c2bd55d26f8eb2850eb9f9026b5d7f0ed1420b65) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.10] gh-101892: Fix `SystemError` when a callable iterator call exhausts ↵Oleg Iarygin2023-03-041-0/+25
| | | | | | | | | | the iterator (GH-101896) (#102422) gh-101892: Fix `SystemError` when a callable iterator call exhausts the iterator (#101896) Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> (cherry picked from commit 705487c6557c3d8866622b4d32528bf7fc2e4204) Co-authored-by: Raj <51259329+workingpayload@users.noreply.github.com>
* gh-102252: Improve coverage of test_bool.py (GH-102253)Miss Islington (bot)2023-02-251-0/+6
| | | | | | Add tests for conversion from bool to complex. (cherry picked from commit 41970436373f4be813fe8f5a07b6da04d5f4c80e) Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
* [3.10] gh-101765: Fix SystemError / segmentation fault in iter `__reduce__` ↵Ionite2023-02-251-0/+80
| | | | | | when internal access of `builtins.__dict__` exhausts the iterator (GH-101769) (#102229) (cherry picked from commit 54dfa14c5a94b893b67a4d9e9e403ff538ce9023)
* [3.10] gh-95675: fix uid and gid at test_add_dir_getmember (gh-102207) ↵Miss Islington (bot)2023-02-251-6/+7
| | | | | | | | (gh-102230) gh-95675: fix uid and gid at test_add_dir_getmember (gh-102207) (cherry picked from commit 56e93c8020e89e1712aa238574bca2076a225028) Co-authored-by: Seonkyo Ok <seonkyo.ok@linecorp.com>
* gh-102158: Add tests for `softkwlist` (GH-102159)Miss Islington (bot)2023-02-241-0/+18
| | | | | | | | --------- (cherry picked from commit 9f3ecd1aa3566947648a053bd9716ed67dd9a718) Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* [3.10] gh-101936: Update the default value of fp from io.StringIO to ↵Miss Islington (bot)2023-02-221-0/+1
| | | | | | | | io.BytesIO (gh-102100) (#102118) gh-101936: Update the default value of fp from io.StringIO to io.BytesIO (gh-102100) (cherry picked from commit 0d4c7fcd4f078708a5ac6499af378ce5ee8eb211) Co-authored-by: Long Vo <long.vo@linecorp.com>
* [3.10] gh-95672 fix typo SkitTest to SkipTest (gh-102119) (gh-102122)Miss Islington (bot)2023-02-222-2/+2
| | | | | | gh-95672 fix typo SkitTest to SkipTest (gh-102119) (cherry picked from commit d5c7954d0c3ff874d2d27d33dcc207bb7356f328) Co-authored-by: HyunKyun Moon <hyunkyun.moon@linecorp.com>
* [3.10] gh-101961 fileinput.hookcompressed should not set the encoding value ↵Miss Islington (bot)2023-02-211-11/+28
| | | | | | | | for the binary mode (gh-102068) (#102099) gh-101961 fileinput.hookcompressed should not set the encoding value for the binary mode (gh-102068) (cherry picked from commit 6f25657b83d7a680a97849490f6e973b3a695e1a) Co-authored-by: Gihwan Kim <gihwan.kim@linecorp.com>
* [3.10] gh-101566: Sync with zipp 3.14. (GH-102018). (GH-102091)Jason R. Coombs2023-02-201-0/+11
| | | | | | | (cherry picked from commit 36854bbb240e417c0df6f0014924fcc899388186) Includes the bugfix only. Automerge-Triggered-By: GH:jaraco
* gh-101517: make bdb avoid looking up in linecache with lineno=None (GH-101787)Miss Islington (bot)2023-02-101-0/+6
| | | | | (cherry picked from commit 366b94905869d680b3f1d4801fb497e78811e511) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.10] gh-100933: Improve `check_element` helper in `test_xml_etree` ↵Miss Islington (bot)2023-02-081-23/+4
| | | | | | | | (GH-100934) (#101687) Items checked by this test are always `str` and `dict` instances. (cherry picked from commit eb49d32b9af0b3b01a5588626179187f11d145c9) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-101334: Don't force USTAR format in test_tarfile. (GH-101572)Miss Islington (bot)2023-02-051-0/+5
| | | | | | | | That causes the test to fail when run using a high UID as that ancient format cannot represent it. The current default (PAX) and the old default (GNU) both support high UIDs. (cherry picked from commit ffcb8220d7a8c8ca169b467d9e4a752874f68af2) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.10] gh-101400: Fix incorrect lineno in exception message on contin… ↵Dong-hee Na2023-01-311-13/+17
| | | | (gh-101448)
* gh-101229: Add tests for aliases of imported names (GH-101230)Miss Islington (bot)2023-01-301-0/+18
| | | | | (cherry picked from commit 28db978d7f134edf6c86f21c42e15003511e7e9b) Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
* [3.10] gh-96192: fix os.ismount() to use a path that is str or bytes ↵Miss Islington (bot)2023-01-221-0/+2
| | | | | | | | | | | (GH-96194) (#99456) gh-96192: fix os.ismount() to use a path that is str or bytes (GH-96194) (cherry picked from commit 367f552129341796d75fc4cc40edb49405235a2b) Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name> Co-authored-by: Christoph Anton Mitterer <calestyo@scientia.org> Co-authored-by: Eryk Sun <eryksun@gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.10] gh-101144: Allow zipfile.Path .open & .read_text encoding to be ↵Miss Islington (bot)2023-01-201-1/+65
| | | | | | | | | | | | | | positional (GH-101179) (GH-101182) The zipfile.Path open() and read_text() encoding parameter can be supplied as a positional argument without causing a TypeError again. 3.10.0b1 included a regression that made it keyword only. Documentation update included as users writing code to be compatible with a wide range of versions will need to consider this for some time.. (cherry picked from commit 5927013e47a8c63b70e104152351f3447baa819c) (cherry picked from commit efe3a389cabd7295e6e0938767cdc4055c871e3c) Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google] Automerge-Triggered-By: GH:gpshead
* [3.10] GH-100942: Fix incorrect cast in property_copy(). (GH-100965). (#101009)Nikita Sobolev2023-01-151-0/+17
| | | | | (cherry picked from commit 94fc7706b7bc3d57cdd6d15bf8e8c4499ae53a69) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* [3.10] GH-100573: Fix server hang caused by os.stat() on named pipe ↵Miss Islington (bot)2023-01-131-0/+40
| | | | | | (Windows) (GH-100959) (#101020) (cherry picked from commit 1bc7a736837272b15ad3a7aa472977bc720d1033)
* [3.10] gh-100160: Remove any deprecation warnings in ↵Serhiy Storchaka2023-01-132-9/+14
| | | | | | | | | asyncio.get_event_loop() (GH-100412) (GH-100970) Some deprecation warnings will reappear (in a slightly different form) in 3.12. Co-authored-by: Guido van Rossum <guido@python.org>. (cherry picked from commit 1b2459dc64b1c3eea89312ea9bf422f8d7c75bb2)
* [3.10] gh-100931: Test all `pickle` protocols in `test_slice` (GH-100932). ↵Nikita Sobolev2023-01-121-1/+3
| | | | | | | | | (GH-100978) (cherry picked from commit 8795ad1bd0d6ee031543fcaf5a86a60b37950714) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Automerge-Triggered-By: GH:AlexWaygood
* [3.10] gh-100871: Improve `copy` module tests (GH-100872) (#100975)Nikita Sobolev2023-01-122-2/+44
| | | | | (cherry picked from commit 729ab9b622957fef0e9b494af9a71ab02986c741) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.10] GH-100892: Fix race in clearing `threading.local` (GH-100922). (#100938)Kumar Aditya2023-01-111-0/+13
| | | | | (cherry picked from commit 762745a124cbc297cf2fe6f3ec9ca1840bb2e873) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.10] gh-90104: avoid RecursionError on recursive dataclass field repr ↵Carl Meyer2023-01-061-0/+18
| | | | | | | | | (gh-100756) (GH-100785) Avoid RecursionError on recursive dataclass field repr (cherry picked from commit 0a7936a38f0bab1619ee9fe257880a51c9d839d5) Automerge-Triggered-By: GH:ericvsmith
* GH-86508: skip binding to local addresses of different family in ↵Miss Islington (bot)2023-01-041-0/+41
| | | | | | | `asyncio.open_connection` (GH-100615) (cherry picked from commit ba8dcdbcab5fd9989be6c9a51002394e782c463c) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.10] gh-95882: Add tests for traceback from contextlib context managers ↵Irit Katriel2023-01-032-0/+108
| | | | (GH-95883) (#100715)
* [3.10] gh-99535: Add test for inheritance of annotations and update ↵Jelle Zijlstra2022-12-271-0/+22
| | | | | | | documentation (GH-99990) (#100509) (cherry picked from commit f5b7b19bf10724d831285fb04e00f763838bd555) Co-authored-by: MonadChains <monadchains@gmail.com>
* [3.10] gh-100474: Fix handling of dirs named index.html in http.server ↵Miss Islington (bot)2022-12-241-0/+3
| | | | | (GH-100504) Co-authored-by: James Frost <git@frost.cx>
* gh-94808: improve test coverage of number formatting (GH-99472)Miss Islington (bot)2022-12-241-5/+39
| | | | | (cherry picked from commit 7ca45e5ddd493411e61706d07679ea54b954e41b) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* bpo-40447: accept all path-like objects in compileall.compile_file (GH-19883)Miss Islington (bot)2022-12-231-0/+28
| | | | | | | | | (cherry picked from commit 1ecfd1ebf1f53ef6ac82085b25ed09952b470d4e) Co-authored-by: Filipe Laíns <lains@riseup.net> Signed-off-by: Filipe Laíns <lains@archlinux.org> Signed-off-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>