Commit graph

47681 commits

Author SHA1 Message Date
Pablo Galindo Salgado e2d65630f3
bpo-45716: Improve the error message when using True/False/None as keywords in a call (GH-29413) 2021-11-05 13:54:55 +00:00
Alex Waygood 32f55d1a5d
bpo-45678: Add more `singledispatchmethod` tests (GH-29412)
In order to fix a bug in the 3.9 branch in #29394, more tests were added to
``test_functools.py`` to ensure that ``singledispatchmethod`` still correctly
wrapped a target method, even if the target method had already been wrapped by
 multiple other decorators. This PR brings the new tests into the 3.11 and 3.10
branches as well.
2021-11-05 11:06:18 +01:00
Irit Katriel 3509b26c91
bpo-45292: [PEP 654] Update traceback display code to work with exception groups (GH-29207) 2021-11-05 09:39:18 +00:00
Łukasz Langa e52f9bee80
bpo-27313: Fix ttk_guionly tests failing on Framework builds on macOS (GH-29411) 2021-11-05 09:53:13 +01:00
Łukasz Langa 54d1e3f72e
bpo-45160: Fix refleak in test_ttk_guionly introduced in GH-28291 (GH-29416) 2021-11-05 09:51:31 +01:00
Erlend Egeberg Aasland c273986711
bpo-45613: Set sqlite3.threadsafety dynamically (GH-29227)
Use the compile-time selected default SQLite threaded mode to set the
DB-API 2.0 attribute 'threadsafety'

Mappings:
  - SQLITE_THREADSAFE=0 => threadsafety=0
  - SQLITE_THREADSAFE=1 => threadsafety=3
  - SQLITE_THREADSAFE=2 => threadsafety=1
2021-11-03 21:01:37 +00:00
Eric Snow 7b438282d3
bpo-45506: Stop skipping test_embed. (gh-29300)
In gh-29063 I ended up disabling test_embed on non-Windows by accident. This gets it running again.

https://bugs.python.org/issue45506
2021-11-03 11:47:16 -06:00
Alex Waygood 5a14929a6e
bpo-45678: Add `functools.singledispatchmethod` tests (GH-29328) 2021-11-03 17:12:02 +01:00
Nikita Sobolev e346f19681
bpo-45578: add tests for dis.distb (GH-29332) 2021-11-03 14:55:42 +01:00
Erlend Egeberg Aasland 0dfb8c4afe
bpo-24139: Fix test_sqlite3 test_extended_error_code_on_exception() on s390x RHEL buildbots (GH-29382) 2021-11-03 17:35:42 +08:00
Erlend Egeberg Aasland 456e27ac0a
bpo-24139: Add support for SQLite extended result codes (GH-28076) 2021-11-02 23:49:38 +00:00
Irit Katriel a459a81530
bpo-45406: make inspect.getmodule() return None when getabsfile() raises FileNotFoundError (GH-28824) 2021-11-02 22:55:51 +01:00
Erlend Egeberg Aasland b6b38a8226
bpo-45243: Add support for setting/getting sqlite3 connection limits (GH-28463) 2021-11-01 22:50:53 +00:00
Christian Heimes e73283a20f
bpo-45668: Fix PGO tests without test extensions (GH-29315) 2021-11-01 11:14:53 +01:00
Erlend Egeberg Aasland 762a4dc936
bpo-10572: Fixup Lib/test/libregrtest/pgo.py (GH-29327) 2021-11-01 09:57:28 +00:00
Serhiy Storchaka 634984d7db
bpo-45679: Fix caching of multi-value typing.Literal (GH-29334)
Literal[True, 2] is no longer equal to Literal[1, 2].
2021-10-31 10:22:16 +02:00
Erlend Egeberg Aasland 62bf263a77
bpo-10572: Move sqlite3 tests to Lib/test (GH-29304)
Automerge-Triggered-By: GH:brettcannon
2021-10-29 15:08:19 -07:00
Vinay Sajip 8a77f59de5
bpo-45628: Check all parts of the suffix for an extension match. (GH-29310) 2021-10-29 14:40:37 +01:00
Tim Golden 7bddd96982
bpo-45621: Small changes to mmap (GH-29247)
* Small tidy-ups / comments
* Use randomized names when testing tagged mmaps to avoid any risk of parallel tests treading on each others' toes
2021-10-29 09:20:21 +01:00
Eric Snow 074fa57506
bpo-45395: Make custom frozen modules additions instead of replacements. (gh-28778)
Currently custom modules (the array set on PyImport_FrozenModules) replace all the frozen stdlib modules. That can be problematic and is unlikely to be what the user wants. This change treats the custom frozen modules as additions instead. They take precedence over all other frozen modules except for those needed to bootstrap the import system. If the "code" field of an entry in the custom array is NULL then that frozen module is treated as disabled, which allows a custom entry to disable a frozen stdlib module.

This change allows us to get rid of is_essential_frozen_module() and simplifies the logic for which frozen modules should be ignored.

https://bugs.python.org/issue45395
2021-10-28 15:04:33 -06:00
Nikita Sobolev 66e6b3dcd3
bpo-45577: test all pickle protocols in test_zoneinfo (GH-29167) 2021-10-28 22:22:24 +02:00
Carl Friedrich Bolz-Tereick 7401694807
bpo-45624: make test_graphlib not depend on the iteration order of sets (GH-29233)
the current test depended on integer sets being iterated on in a certain
fixed order. That order is different on PyPy (insertion based) and could
change in CPython in the future in theory. Make the test robust against
a different iteration order by sorting.
2021-10-28 22:01:35 +02:00
Erlend Egeberg Aasland 4dd1e84789
bpo-45612: Add sqlite3 module docstring (GH-29224) 2021-10-28 21:55:27 +02:00
Eric Snow 13d9205f40
bpo-45629: Add a test for the "freeze" tool. (gh-29222)
The "freeze" tool has been part of the repo for a long time. However, it hasn't had any tests in the test suite to guard against regressions. We add such a test here. This is especially important as there has been a lot of change recently related to frozen modules, with more to come.

Note that as part of the test we build Python out-of-tree and install it in a temp dir.

https://bugs.python.org/issue45629
2021-10-28 10:14:37 -06:00
Dennis Sweeney d56375a0dd
bpo-30570: Fix segfault on buildbots caused by stack overflow from recursion in tests (GH-29258)
* Don't stackoveflow on debug builds

* Also catch the pickletester case
2021-10-28 11:11:18 +01:00
Alex Waygood b1302abcc8
bpo-44904: Fix classmethod property bug in doctest module (GH-28838)
The doctest module raised an error if a docstring contained an example that
attempted to access a classmethod property. (Stacking '@classmethod' on top of
`@property` has been supported since Python 3.9; see
https://docs.python.org/3/howto/descriptor.html#class-methods.)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-10-28 10:48:02 +03:00
Martin Rueckl d02ffd1b5c
bpo-45438: format of inspect.Signature with generic builtins (#29212)
Use types.GenericAlias in inspect.formatannotation to correctly add
type arguments of builtin types to the string representation of
Signatures.

Co-authored-by: Martin Rückl <martin.rueckl@codecentric.de>
2021-10-27 14:36:41 -07:00
Brandt Bucher 82a662e521
bpo-44511: Improve the bytecode for class and mapping patterns (GH-26922)
* Refactor mapping patterns and speed up class patterns.

* Simplify MATCH_KEYS and MATCH_CLASS.

* Add COPY opcode.
2021-10-27 10:45:35 +01:00
Tim Golden aea5ecc458
bpo-40915: Fix mmap resize bugs on Windows (GH-29213)
(original patch by eryksun)

Correctly hand various failure modes when resizing an mmap on Windows:

* Resizing a pagefile-backed mmap now creates a new mmap and copies data
* Attempting to resize when another mapping is held on the same file raises an OSError
* Attempting to resize a nametagged mmap raises an OSError if another mapping is held with the same nametag
2021-10-26 22:56:43 +01:00
Eric Snow 6afb285ff0
bpo-45020: Add tests for the -X "frozen_modules" option. (gh-28997)
We hadn't explicitly added any tests for this, so here they are.

https://bugs.python.org/issue45020
2021-10-25 15:26:41 -06:00
Nikita Sobolev 07236d562e
bpo-45566: test_frozen_pickle checks all pickle protocols (GH-29150)
Refs https://github.com/python/cpython/pull/29147

Automerge-Triggered-By: GH:ericvsmith
2021-10-24 06:06:32 -07:00
Eric Snow 17c61045c5
bpo-45506: Normalize _PyPathConfig.stdlib_dir when calculated. (#29040)
The recently added PyConfig.stdlib_dir was being set with ".." entries. When __file__ was added for from modules this caused a problem on out-of-tree builds. This PR fixes that by normalizing "stdlib_dir" when it is calculated in getpath.c.

https://bugs.python.org/issue45506
2021-10-22 17:20:03 -06:00
Irit Katriel f30ad65dbf
bpo-45292: [PEP 654] add the ExceptionGroup and BaseExceptionGroup classes (GH-28569) 2021-10-23 00:13:46 +01:00
Dennis Sweeney 423fa1c181
bpo-30570: Use Py_EnterRecursiveCall() in issubclass() (GH-29048)
* Use Py_EnterRecursiveCall() in issubclass()

Reviewed-by: Gregory P. Smith <greg@krypto.org> [Google]
2021-10-22 14:24:08 -07:00
Serhiy Storchaka b781cc3bfc
bpo-45502: Fix test_shelve (GH-29003)
Run test_shelve with all underlying dbm implementations and pickle protocols.
Also make test_shelve discoverable.
2021-10-22 16:14:58 +02:00
Petr Viktorin 276468dddb
bpo-43795: Add a test for Stable ABI symbol availability using ctypes (GH-26354)
This is a cross-platform check that the symbols are actually
exported in the ABI, not e.g. hidden in a macro.

Caveat: PyModule_Create2 & PyModule_FromDefAndSpec2 are skipped.

These aren't exported on some of our buildbots. This is a bug
(bpo-44133). This test now makes sure all the others don't regress.
2021-10-22 10:12:06 +02:00
Gregory P. Smith 843b890334
bpo-43592: Raise RLIMIT_NOFILE in test.libregrtest (GH-29127)
Raise RLIMIT_NOFILE in test.libregrtest.

On macOS the default is often too low for our testsuite to succeed.

Co-authored by reviewer: Victor Stinner
2021-10-21 18:22:25 -07:00
Dong-hee Na 37fad7d3b7
bpo-44019: Add test_all_exported_names for operator module (GH-29124) 2021-10-22 07:58:04 +09:00
Mark Dickinson d1b24775b4
bpo-44547: Make Fractions objects instances of typing.SupportsInt (GH-27851)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-22 00:09:47 +02:00
Eric V. Smith 087f089e5e
bpo-45557: Fix underscore_numbers in pprint.pprint(). (GH-29129) 2021-10-21 16:42:55 -04:00
E-Paine add46f8476
bpo-45160: Ttk optionmenu only set variable once (GH-28291) 2021-10-21 22:25:52 +02:00
Nikita Sobolev 0c4c2e6213
Move several typing tests to a proper class, refs GH-28563 (GH-29126) 2021-10-21 22:16:50 +02:00
Christian Heimes 9942f42a93
bpo-45522: Allow to disable freelists on build time (GH-29056)
Freelists for object structs can now be disabled. A new ``configure``
option ``--without-freelists`` can be used to disable all freelists
except empty tuple singleton. Internal Py*_MAXFREELIST macros can now
be defined as 0 without causing compiler warnings and segfaults.

Signed-off-by: Christian Heimes <christian@python.org>
2021-10-21 06:12:20 -07:00
Kreus Amredes a53456e587
bpo-44019: Add operator.call() to __all__ for the operator module (GH-29110) 2021-10-21 19:05:36 +09:00
Petr Viktorin 8a310dd5f4
bpo-45315: PyType_FromSpec: Copy spec->name and have the type own the memory for its name (GH-29103) 2021-10-21 11:46:20 +02:00
Barry Warsaw 876fc7fcec
bpo-35673: Add a public alias for namespace package __loader__ attribute (#29049)
Rename namespace package __loader__ class to be public.

Make the old name, i.e. _NamespaceLoader, an alias for the public name, for backward compatibility.
2021-10-20 14:05:29 -07:00
Kyungmin Lee 6270d3eeaf
bpo-45192: Fix a bug that infers the type of an os.PathLike[bytes] object as str (GH-28323)
An object implementing the os.PathLike protocol can represent a file
system path as a str or bytes object.
Therefore, _infer_return_type function should infer os.PathLike[str]
object as str type and os.PathLike[bytes] object as bytes type.
2021-10-20 21:54:41 +02:00
Hugo van Kemenade d89fb9a5a6
bpo-45320: Remove long-deprecated inspect methods (GH-28618) 2021-10-20 20:48:55 +02:00
Gregory P. Smith 1dfac27dff
Cleanup a couple of comments left on PR 28775 post-merge. (GH-29079) 2021-10-20 09:17:52 -07:00
Barry Warsaw 6ef4507c74
Add a comment about how to fix bogus test_host_resolution_bad_address failures (#29085) 2021-10-20 08:08:57 -07:00