-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Open
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
I was doing some testing to check that Python without optional C extensions remains functional, and I've noticed that the following test fails if _zoneinfo is not built:
======================================================================
FAIL: test_cache_location (test.test_zoneinfo.test_zoneinfo.ExtensionBuiltTest.test_cache_location)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mgorny/git/cpython/Lib/test/test_zoneinfo/test_zoneinfo.py", line 1931, in test_cache_location
self.assertFalse(hasattr(c_zoneinfo.ZoneInfo, "_weak_cache"))
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: True is not falseFWICS the zoneinfo module tests unconditionally assume that zoneinfoimported with no "blocked" modules. While most of the time, this shouldn't matter, I suppose it would be cleaner to haveget_modules()returnNoneasc_moduleif_zoneinfo` is not importable.
I can try making a PR for this if you agree with this approach (and skipping the duplicate-then C extension tests).
CC @pganssle
CPython versions tested on:
3.13, CPython main branch
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
No status