summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [3.12] gh-118671: Updated dead ActiveState links (GH-118730) (#118754)Miss Islington (bot)2024-05-081-1/+1
| | | | | | Co-authored-by: trag1c <trag1cdev@yahoo.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* [3.12] gh-118314: Fix padding edge case in binascii.a2b_base64 strict mode ↵Miss Islington (bot)2024-05-071-0/+15
| | | | | | | | | | | | | | (GH-118320) (GH-118691) gh-118314: Fix padding edge case in binascii.a2b_base64 strict mode (GH-118320) Fix an edge case in `binascii.a2b_base64` strict mode, where excessive padding was not detected when no padding is necessary. (cherry picked from commit fe47d9bee319528ffeb5fd60a615d7f02c7b5585) Co-authored-by: Youfu Zhang <1315097+zhangyoufu@users.noreply.github.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
* [3.12] gh-118164: Break a loop between _pydecimal and _pylong and optimize ↵Miss Islington (bot)2024-05-061-10/+21
| | | | | | | | | | | | | | | | | | | | | | | int to str conversion (GH-118483) (GH-118590) For converting large ints to strings, CPython invokes a function in _pylong.py, which uses the decimal module to implement an asymptotically waaaaay sub-quadratic algorithm. But if the C decimal module isn't available, CPython uses _pydecimal.py instead. Which in turn frequently does str(int). If the int is very large, _pylong ends up doing the work, which in turn asks decimal to do "big" arithmetic, which in turn calls str(big_int), which in turn ... it can become infinite mutual recursion. This change introduces a different int->str function that doesn't use decimal. It's asymptotically worse, "Karatsuba time" instead of quadratic time, so still a huge improvement. _pylong switches to that when the C decimal isn't available. It is also used for not too large integers (less than 450_000 bits), where it is faster (up to 2 times for 30_000 bits) than the asymptotically better implementation that uses the C decimal. (cherry picked from commit 711c80bfca5dd17cb7c6ec26f0e44848b33aec04) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Tim Peters <tim.peters@gmail.com>
* [3.12] gh-117389: Fix `test_compileall.EncodingTest` (GH-117390) (#118603)Miss Islington (bot)2024-05-051-8/+14
| | | | | | gh-117389: Fix `test_compileall.EncodingTest` (GH-117390) (cherry picked from commit 44f67916dafd3583f482e6d001766581a1a734fc) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-118164: str(10**10000) hangs if the C _decimal module is missing ↵Miss Islington (bot)2024-05-051-1/+24
| | | | | | | | | | | | | (GH-118503) (GH-118584) Serhiy and I independently concluded that exact powers of 10 aren't possible in these contexts, so just checking the string length is sufficient. (cherry picked from commit 999f0c512281995fb61a0d9eda075fd846e8c505) Co-authored-by: Tim Peters <tim.peters@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-118569: Add a test for dynamic PEP695 classes (GH-118570) (#118574)Miss Islington (bot)2024-05-041-0/+25
| | | | | | gh-118569: Add a test for dynamic PEP695 classes (GH-118570) (cherry picked from commit 5f547585fa56c94c5d836b5313a7200f4937ebc4) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-118513: Fix sibling comprehensions with a name bound in one and ↵Miss Islington (bot)2024-05-031-0/+14
| | | | | | | | | | global in the other (GH-118526) (#118548) gh-118513: Fix sibling comprehensions with a name bound in one and global in the other (GH-118526) (cherry picked from commit c8deb1e4b495bf97ab00c710dfd63f227e1fb645) Co-authored-by: Carl Meyer <carl@oddbird.net> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* [3.12] gh-90848: Fixed create_autospec ignoring configure_mock style kwargs ↵Miss Islington (bot)2024-05-021-0/+13
| | | | | | | | (GH-118163) (#118517) gh-90848: Fixed create_autospec ignoring configure_mock style kwargs (GH-118163) (cherry picked from commit b28a3339e4c63ea3a801dba9bbbc6af5af42c3a0) Co-authored-by: infohash <46137868+infohash@users.noreply.github.com>
* [3.12] gh-118272: Clear generator frame's locals when the generator is ↵Irit Katriel2024-05-021-0/+20
| | | | closed (#118451)
* [3.12] GH-117881: fix athrow().throw()/asend().throw() concurrent access ↵Thomas Grainger2024-05-021-0/+148
| | | | | | | (GH-117882) (#118458) GH-117881: fix athrow().throw()/asend().throw() concurrent access (GH-117882) (cherry picked from commit fc7e1aa3c001bbce25973261fba457035719a559)
* [3.12] Uncomment one grammar test (GH-118361) (#118385)Miss Islington (bot)2024-05-021-1/+1
| | | | | | Uncomment one grammar test (GH-118361) (cherry picked from commit 23d0371bb99b1df183c36883e256f82fdf6a4bea) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-116767: fix crash on 'async with' with many context managers ↵Irit Katriel2024-05-011-4/+32
| | | | | | | | | | | | (GH-118348) (#118477) gh-116767: fix crash on 'async with' with many context managers (GH-118348) Account for `add_stopiteration_handler` pushing a block for `async with`. To allow generator functions that previously almost hit the `CO_MAXBLOCKS` limit by nesting non-async blocks, the limit is increased by 1. This increase allows one more block in non-generator functions. (cherry picked from commit c1bf4874c1e9db2beda1d62c8c241229783c789b)
* [3.12] gh-117860: Add tests for resolving names when import rebind names ↵Miss Islington (bot)2024-04-307-0/+147
| | | | | | | | | | (GH-118176) (GH-118432) Add tests for "import", pkgutil.resolve_name() and unittest.mock.path() for cases when "import a.b as x" and "from a import b as x" give different results. (cherry picked from commit c0eaa232f63a62e0e0408911ab5f118dca2af607) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-118404: Fix inspect.signature() for non-comparable callables ↵Miss Islington (bot)2024-04-301-0/+10
| | | | | | | (GH-118405) (GH-118424) (cherry picked from commit 11f8348d78c22f85694d7a424541b34d6054a8ee) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-117566: fix IPv6Address.is_loopback for IPv4-mapped loopbacks ↵Miss Islington (bot)2024-04-291-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | (GH-117567) (GH-118391) gh-117566: fix IPv6Address.is_loopback for IPv4-mapped loopbacks (GH-117567) While properties like IPv6Address.is_private account for IPv4-mapped IPv6 addresses, such as for example: >>> ipaddress.ip_address("192.168.0.1").is_private True >>> ipaddress.ip_address("::ffff:192.168.0.1").is_private True ...the same doesn't currently apply to the is_loopback property: >>> ipaddress.ip_address("127.0.0.1").is_loopback True >>> ipaddress.ip_address("::ffff:127.0.0.1").is_loopback False At minimum, this inconsistency between different properties is counter-intuitive. Moreover, ::ffff:127.0.0.0/104 is for all intents and purposes a loopback address, and should be treated as such. (cherry picked from commit fb7f79b4da35b75cdc82ff3cf20816d2bf93d416) Co-authored-by: Faidon Liambotis <paravoid@debian.org>
* [3.12] gh-118221: Always use the default row factory in sqlite3.iterdump() ↵Erlend E. Aasland2024-04-251-0/+15
| | | | | | | | | | | | | | (#118223) (#118270) sqlite3.iterdump() depends on the row factory returning resulting rows as tuples; it will fail with custom row factories like for example a dict factory. With this commit, we explicitly reset the row factory of the cursor used by iterdump(), so we always get predictable results. This does not affect the row factory of the parent connection. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] GH-117894: prevent aclose()/athrow() being re-used after ↵Thomas Grainger2024-04-251-1/+61
| | | | | | StopIteration (GH-117851) (GH-118226) (cherry picked from commit 7d369d471cf2b067c4d795d70b75201c48b46f5b)
* [3.12] gh-118013: Use weakrefs for the cache key in `inspect._shadowed_dict` ↵Miss Islington (bot)2024-04-242-1/+25
| | | | | | (GH-118202) (#118232) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-113171: gh-65056: Fix "private" (non-global) IP address ranges ↵Petr Viktorin2024-04-241-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-113179) (GH-113186) (GH-118177) * GH-113171: Fix "private" (non-global) IP address ranges (GH-113179) The _private_networks variables, used by various is_private implementations, were missing some ranges and at the same time had overly strict ranges (where there are more specific ranges considered globally reachable by the IANA registries). This patch updates the ranges with what was missing or otherwise incorrect. 100.64.0.0/10 is left alone, for now, as it's been made special in [1]. The _address_exclude_many() call returns 8 networks for IPv4, 121 networks for IPv6. [1] https://github.com/python/cpython/issues/61602 * GH-65056: Improve the IP address' is_global/is_private documentation (GH-113186) It wasn't clear what the semantics of is_global/is_private are and, when one gets to the bottom of it, it's not quite so simple (hence the exceptions listed). (cherry picked from commit 2a4cbf17af19a01d942f9579342f77c39fbd23c4) (cherry picked from commit 40d75c2b7f5c67e254d0a025e0f2e2c7ada7f69f) --------- Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
* [3.12] bpo-40944: Fix IndexError when parse emails with truncated ↵Miss Islington (bot)2024-04-231-0/+40
| | | | | | | | Message-ID, address, routes, etc (GH-20790) (GH-117974) (cherry picked from commit 1aa8bbe62f27b564cf15e2aad591c62744354a4e) Co-authored-by: Ivan Savin <acccko@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-118168: Fix Unpack interaction with builtin aliases (GH-118169) ↵Miss Islington (bot)2024-04-231-0/+32
| | | | | | | (#118178) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-59215: unittest: restore _top_level_dir at end of discovery ↵Miss Islington (bot)2024-04-231-1/+25
| | | | | | | | | | (GH-15242) (GH-117508) * gh-59215: unittest: restore _top_level_dir at end of discovery (GH-15242) (cherry picked from commit fc5f68e58ecfbc8c452e1c2f33a2a53d3f2d7ea2) Co-authored-by: Zackery Spytz <zspytz@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.12] gh-117968: Add tests for the part of the PyRun family of the C API ↵Serhiy Storchaka2024-04-221-0/+106
| | | | | | | | (GH-117982) (GH-118011) (cherry picked from commit 6078f2033ea15a16cf52fe8d644a95a3be72d2e3) Co-authored-by: NGRsoftlab <78017794+NGRsoftlab@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-118148: Improve tests for shutil.make_archive() (GH-118149) ↵Miss Islington (bot)2024-04-221-71/+176
| | | | | | | (GH-118151) (cherry picked from commit 287d939ed4445089e8312ab44110cbb6b6306a5c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-117995: Don't raise DeprecationWarnings for indexed nameless ↵Miss Islington (bot)2024-04-221-0/+14
| | | | | | | | | | params (GH-118001) (#118142) Filter out '?NNN' placeholders when looking for named params. (cherry picked from commit 550483b7e6c54b2a25d4db0c4ca41bd9c1132f93) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: AN Long <aisk@users.noreply.github.com>
* [3.12] gh-118121: Fix `test_doctest.test_look_in_unwrapped` (#118122) (#118129)Nikita Sobolev2024-04-211-1/+16
|
* [3.12] gh-114053: Fix bad interaction of PEP-695, PEP-563 and ↵Alex Waygood2024-04-192-1/+47
| | | | | | ``get_type_hints`` (#118009) (#118104) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.12] gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with ↵Miss Islington (bot)2024-04-181-0/+1
| | | | | | | / (GH-118056) (GH-118058) (cherry picked from commit ccdcd1d95a9d6eda4df86811c4539f204beef817) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-117613: Argument Clinic: ensure that defining class params are ↵neonene2024-04-171-0/+22
| | | | positional-only (#117939)
* [3.12] gh-80361: Fix TypeError in email.Message.get_payload() (GH-117994) ↵Miss Islington (bot)2024-04-171-0/+15
| | | | | | | | | | (GH-117998) It was raised when the charset is rfc2231 encoded, e.g.: Content-Type: text/plain; charset*=ansi-x3.4-1968''utf-8 (cherry picked from commit deaecb88fa5da68cbffca413c63af95fd99578dd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-117975: Ensure flush level is checked when configuring a logging ↵Miss Islington (bot)2024-04-171-0/+29
| | | | | MemoryHandler. (GH-117976) (GH-117986) (cherry picked from commit 6d0bb43232dd6ebc5245daa4fe29f07f815f0bad)
* [3.12] gh-117313: Fix re-folding email messages containing non-standard line ↵Miss Islington (bot)2024-04-171-0/+49
| | | | | | | | | | separators (GH-117369) (GH-117971) Only treat '\n', '\r' and '\r\n' as line separators in re-folding the email messages. Preserve control characters '\v', '\f', '\x1c', '\x1d' and '\x1e' and Unicode line separators '\x85', '\u2028' and '\u2029' as is. (cherry picked from commit aec1dac4efe36a7db51f08385ddcce978814dbe3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-117503: Fix support of non-ASCII user names in ↵Serhiy Storchaka2024-04-171-0/+11
| | | | | | posixpath.expanduser() (GH-117504) (GH-117970) They are now supported in bytes paths as well as in string paths. (cherry picked from commit 51132da0c4dac13500d9bb86b2fdad42091d3fd9)
* [3.12] gh-117879: Fix test_httpservers for the build with profiling ↵Miss Islington (bot)2024-04-171-0/+3
| | | | | | | (GH-117932) (GH-117969) (cherry picked from commit 8429b4565deaef7a86bffc0ce58bc0eab1d7ae48) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-86650: Fix IndexError when parse emails with invalid Message-ID ↵Miss Islington (bot)2024-04-171-0/+25
| | | | | | | | | | | (GH-117934) (GH-117965) In particularly, one-off addresses generated by Microsoft Outlook: https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/one-off-addresses (cherry picked from commit f74e51229c83e3265f905dc15283bfe0ec1a659e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: fsc-eriker <72394365+fsc-eriker@users.noreply.github.com>
* [3.12] gh-75171: Fix parsing invalid email address headers starting or ↵Miss Islington (bot)2024-04-172-0/+46
| | | | | | | | | ending with a dot (GH-15600) (GH-117964) (cherry picked from commit 8cc9adbfddc8e37cf7d621b12754eecb0584f5da) Co-authored-by: tsufeki <tsufeki@ymail.com> Co-authored-by: Tim Bell <timothybell@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-117691: Add an appropriate stacklevel for PEP-706 tarfile ↵Miss Islington (bot)2024-04-161-0/+25
| | | | | | | | deprecation warnings (GH-117872) (GH-117930) gh-117691: Add an appropriate stacklevel for PEP-706 tarfile deprecation warnings (GH-117872) (cherry picked from commit cff0a2db00b6379f60fe273a9782f71773d0a4cb) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-117797: Improve `test_descr.test_not_implemented` (GH-117798) ↵Miss Islington (bot)2024-04-161-8/+17
| | | | | | | | (#117921) gh-117797: Improve `test_descr.test_not_implemented` (GH-117798) (cherry picked from commit 1a1e013a4a526546c373afd887f2e25eecc984ad) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-90329: Add _winapi.GetLongPathName and GetShortPathName and use in venv ↵Steve Dower2024-04-152-1/+72
| | | | to reduce warnings (GH-117817)
* gh-112278: Improve error handling in wmi module and tests (GH-117818)Steve Dower2024-04-151-7/+21
|
* [3.12] gh-117889: Fix PGO test in test_peg_generator (GH-117893) (#117895)Miss Islington (bot)2024-04-152-3/+2
| | | | | | | | | Reuse support.check_cflags_pgo() in test_peg_generator to check for PGO build. Log PGO_PROF_USE_FLAG in test.pythoninfo. (cherry picked from commit 64cd6fc9a6a3c3c19091a1c81cbbe8994583017d) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-91565: Replace bugs.python.org links with Devguide/GitHub ones ↵Miss Islington (bot)2024-04-151-2/+3
| | | | | | | | | | | | | (GH-91568) (GH-117890) gh-91565: Replace bugs.python.org links with Devguide/GitHub ones (GH-91568) (cherry picked from commit 3de09cadde788065a4f2d45117e789c9353bbd12) Co-authored-by: Steve (Gadget) Barnes <gadgetsteve@hotmail.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* [3.12] gh-117694: Improve tests for PyEval_EvalCodeEx() (GH-117695) (GH-117884)Miss Islington (bot)2024-04-151-11/+81
| | | | | (cherry picked from commit 57bdb75975ff90f95248c59fda34345f3bfff3c4) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-115692: Add tests to increase `json` coverage (GH-115693) (#117867)Miss Islington (bot)2024-04-144-10/+35
| | | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.12] gh-115142: Skip `test_capi.test_dict.py` if `_testcapi` is not ↵Kirill Podoprigora2024-04-111-1/+3
| | | | | | available (GH-117588) (GH-117718) (cherry picked from commit dfcae4379f2cc4d352a180f9fef2381570aa9bcb)
* [3.12] gh-117711: Only check for 'test/wheeldata' when it's actually used ↵Miss Islington (bot)2024-04-111-0/+4
| | | | | | | | | | | | | | (GH-117712) (#117749) gh-117711: Only check for 'test/wheeldata' when it's actually used (GH-117712) It's possible to build Python with option `--with-wheel-pkg-dir` pointing to a custom wheel directory. Don't include the directory in the test set if the wheels are used from a different location. (cherry picked from commit d4963871b03cc76fe7d9648d022d12007585beae) Co-authored-by: Karolina Surma <33810531+befeleme@users.noreply.github.com> Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* [3.12] gh-117606: Truncate extremely long error message in `test_exceptions` ↵Miss Islington (bot)2024-04-111-1/+2
| | | | | | | | | (GH-117670) (#117745) gh-117606: Truncate extremely long error message in `test_exceptions` (GH-117670) (cherry picked from commit 02f1385f8ad6bf45376377c41f106b386d3a7eb0) Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-117692: Fix `AttributeError` in `DocTestFinder` on wrapped ↵Miss Islington (bot)2024-04-101-0/+14
| | | | | | | | | `builtin_or_method` (GH-117699) (#117708) * gh-117692: Fix `AttributeError` in `DocTestFinder` on wrapped `builtin_or_method` (GH-117699) (cherry picked from commit 4bb7d121bc0a3fd00a3c72cd915b5dd8fac5616e) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-117534: Add checking for input parameter in iso_to_ymd (GH-117543) ↵Miss Islington (bot)2024-04-091-0/+4
| | | | | | | | | | | | | | (#117689) gh-117534: Add checking for input parameter in iso_to_ymd (GH-117543) Moves the validation for invalid years in the C implementation of the `datetime` module into a common location between `fromisoformat` and `fromisocalendar`, which improves the error message and fixes a failed assertion when parsing invalid ISO 8601 years using one of the "ISO weeks" formats. --------- (cherry picked from commit d5f1139c79525b4e7e4e8ad8c3e5fb831bbc3f28) Co-authored-by: Vlad4896 <166005126+Vlad4896@users.noreply.github.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* [3.12] gh-117594: Require cpu resource to test_search_anchor_at_beginning ↵Donghee Na2024-04-081-1/+4
| | | | | | | (g… (gh-117616) gh-117594: Require cpu resource to test_search_anchor_at_beginning (gh-117595) (cherry picked from commit 784623c63c45a4d13dfb04318c39fdb1ab790218)