You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test suite expects _stat extension to be available #108638
Some time ago I opened the exact same issue, but about _functools extension.
Tests is written in a way that expect _functools to always be there. However, other iterpreters may not have it.
Some time ago I opened the exact same issue, but about _functools extension.
pypy3 (PyPy 3.9.16 v7.3.12) doesn't have the _functools module, but pypy2 (PyPy 2.7.18 v7.3.12) has the _functools module. It may help to make test_functools compatible with PyPy to support the case when _functools is missing. I didn't look if your proposed change make functools and/or test_functools maintenance too complicated or not.
$ pypy3
Python 3.9.17 (a61d7152b989, Aug 13 2023, 10:27:46)
[PyPy 7.3.12 with GCC 13.2.1 20230728 (Red Hat 13.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import _stat
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named '_stat'
Activity
pythongh-108638: Fix tests when _stat extension is missing
pythongh-108638: Fix stat.filemode() when _stat is missing
pythongh-108638: Fix stat.filemode() when _stat is missing
pythongh-108638: Fix stat.filemode() when _stat is missing
pythongh-108638: Fix stat.filemode() when _stat is missing
sobolevn commentedon Aug 29, 2023
Some time ago I opened the exact same issue, but about
_functoolsextension.Tests is written in a way that expect
_functoolsto always be there. However, other iterpreters may not have it.My PR was rejected :(
https://bugs.python.org/issue46647
vstinner commentedon Aug 29, 2023
pypy3 (PyPy 3.9.16 v7.3.12) doesn't have the
_functoolsmodule, but pypy2 (PyPy 2.7.18 v7.3.12) has the_functoolsmodule. It may help to make test_functools compatible with PyPy to support the case when_functoolsis missing. I didn't look if your proposed change make functools and/or test_functools maintenance too complicated or not.sunmy2019 commentedon Aug 29, 2023
Do you mean "PyPy doesn't have
_statmodule"?vstinner commentedon Aug 29, 2023
Oops, right:
gh-108638: Fix stat.filemode() when _stat is missing (#108639)
gvanrossum commentedon Aug 29, 2023
Seems fixed now.
vstinner commentedon Aug 29, 2023
test_inspect and test_pydoc still fail. I reopen the issue.
I'm not sure if it's better to change _stat and/or stat functions signature, or skip the affected tests when _stat is not available.
gvanrossum commentedon Aug 29, 2023
Whichever is the simplest fix, I'd say.
pythongh-108638: Fix tests when _stat extension is missing
pythongh-108638: Fix tests when _stat extension is missing
gh-108638: Fix tests when _stat extension is missing (#108689)
vstinner commentedon Aug 31, 2023
The whole test suite now pass when the
_statextension is missing. I close the issue.