Test suite expects _stat extension to be available · Issue #108638 · python/cpython (original) (raw)

Bug report

Checklist

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

No response

A clear and concise description of the bug:

The _stat extension is specific to CPython. For example, PyPy has no _stat module.

But the Python test suite expects the _stat module to be available: test_inspect, test_pydoc, and test_tarfile fail with it's missing.

Disable compilation of the _stat extension to reproduce the issue:

diff --git a/Modules/Setup.bootstrap.in b/Modules/Setup.bootstrap.in index 8ef0f203a8..a1f6b8cc85 100644 --- a/Modules/Setup.bootstrap.in +++ b/Modules/Setup.bootstrap.in @@ -29,7 +29,7 @@ _abc _abc.c _functools _functoolsmodule.c _locale _localemodule.c _operator _operator.c -_stat _stat.c +#_stat _stat.c _symtable symtablemodule.c

for systems without $HOME env, used by site._getuserbase()

Example:

$ ./python -c 'import _stat'
ModuleNotFoundError: No module named '_stat'

Linked PRs