Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests crash on teardown using Python 3.13b2 #261

Open
jaraco opened this issue Jun 26, 2024 · 1 comment
Open

Tests crash on teardown using Python 3.13b2 #261

jaraco opened this issue Jun 26, 2024 · 1 comment

Comments

@jaraco
Copy link
Member

jaraco commented Jun 26, 2024

 @ py -3.13 -VV
Python 3.13.0b2 experimental free-threading build (tags/v3.13.0b2:3a83b172af, Jun 16 2024, 16:15:00) [Clang 15.0.0 (clang-1500.3.9.4)]
 distutils main @ tox -e py313
.pkg-cpython313: _optional_hooks> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.12/site-packages/pyproject_api/_backend.py' True setuptools.build_meta
.pkg-cpython313: get_requires_for_build_editable> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.12/site-packages/pyproject_api/_backend.py' True setuptools.build_meta
.pkg-cpython313: build_editable> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.12/site-packages/pyproject_api/_backend.py' True setuptools.build_meta
py313: install_package> python -I -m pip install --force-reinstall --no-deps /Users/jaraco/code/pypa/distutils/.tox/.tmp/package/24/distutils-0.1.dev4068+g0de29d3-0.editable-py3-none-any.whl
py313: commands[0]> pytest
============================================================== test session starts ===============================================================
platform darwin -- Python 3.13.0b2, pytest-8.2.2, pluggy-1.5.0
cachedir: .tox/py313/.pytest_cache
rootdir: /Users/jaraco/code/pypa/distutils
configfile: pytest.ini
plugins: cov-5.0.0, pyfakefs-5.5.0, mypy-0.10.3, checkdocs-2.13.0, ruff-0.3.2, typeguard-4.3.0, enabler-3.1.1
collected 478 items                                                                                                                              

conftest.py ..                                                                                                                             [  0%]
distutils/__init__.py ..                                                                                                                   [  0%]
distutils/_collections.py ....                                                                                                             [  1%]
distutils/_functools.py ....                                                                                                               [  2%]
distutils/_itertools.py ...                                                                                                                [  3%]
distutils/_log.py ..                                                                                                                       [  3%]
distutils/_macos_compat.py ..                                                                                                              [  3%]
distutils/_modified.py ..                                                                                                                  [  4%]
distutils/_msvccompiler.py ..                                                                                                              [  4%]
distutils/archive_util.py ..                                                                                                               [  5%]
distutils/bcppcompiler.py ..                                                                                                               [  5%]
distutils/ccompiler.py ..                                                                                                                  [  6%]
distutils/cmd.py ..                                                                                                                        [  6%]
distutils/command/__init__.py ..                                                                                                           [  6%]
distutils/command/_framework_compat.py ..                                                                                                  [  7%]
distutils/command/bdist.py ..                                                                                                              [  7%]
distutils/command/bdist_dumb.py ..                                                                                                         [  8%]
distutils/command/bdist_rpm.py ..                                                                                                          [  8%]
distutils/command/build.py ..                                                                                                              [  8%]
distutils/command/build_clib.py ..                                                                                                         [  9%]
distutils/command/build_ext.py ..                                                                                                          [  9%]
distutils/command/build_py.py ..                                                                                                           [ 10%]
distutils/command/build_scripts.py ..                                                                                                      [ 10%]
distutils/command/check.py ..                                                                                                              [ 11%]
distutils/command/clean.py ..                                                                                                              [ 11%]
distutils/command/config.py ..                                                                                                             [ 11%]
distutils/command/install.py ..                                                                                                            [ 12%]
distutils/command/install_data.py ..                                                                                                       [ 12%]
distutils/command/install_egg_info.py ..                                                                                                   [ 13%]
distutils/command/install_headers.py ..                                                                                                    [ 13%]
distutils/command/install_lib.py ..                                                                                                        [ 14%]
distutils/command/install_scripts.py ..                                                                                                    [ 14%]
distutils/command/register.py ..                                                                                                           [ 14%]
distutils/command/sdist.py ...                                                                                                             [ 15%]
distutils/command/upload.py ..                                                                                                             [ 15%]
distutils/compat/__init__.py ..                                                                                                            [ 16%]
distutils/compat/py38.py ..                                                                                                                [ 16%]
distutils/compat/py39.py ..                                                                                                                [ 17%]
distutils/config.py ...                                                                                                                    [ 17%]
distutils/core.py ..                                                                                                                       [ 18%]
distutils/cygwinccompiler.py ..                                                                                                            [ 18%]
distutils/debug.py ..                                                                                                                      [ 19%]
distutils/dep_util.py ..                                                                                                                   [ 19%]
distutils/dir_util.py ..                                                                                                                   [ 19%]
distutils/dist.py ..                                                                                                                       [ 20%]
distutils/errors.py ..                                                                                                                     [ 20%]
distutils/extension.py ..                                                                                                                  [ 21%]
distutils/fancy_getopt.py ..                                                                                                               [ 21%]
distutils/file_util.py ..                                                                                                                  [ 21%]
distutils/filelist.py ..                                                                                                                   [ 22%]
distutils/log.py ..                                                                                                                        [ 22%]
distutils/msvccompiler.py ..                                                                                                               [ 23%]
distutils/spawn.py ..                                                                                                                      [ 23%]
distutils/sysconfig.py ...                                                                                                                 [ 24%]
distutils/tests/__init__.py ..                                                                                                             [ 24%]
distutils/tests/compat/__init__.py ..                                                                                                      [ 25%]
distutils/tests/compat/py38.py ..                                                                                                          [ 25%]
distutils/tests/support.py ..                                                                                                              [ 25%]
distutils/tests/test_archive_util.py ..                                                                                                    [ 26%]
distutils/tests/test_bdist.py ....                                                                                                         [ 27%]
distutils/tests/test_bdist_dumb.py ...                                                                                                     [ 27%]
distutils/tests/test_bdist_rpm.py ..ss                                                                                                     [ 28%]
distutils/tests/test_build.py ...                                                                                                          [ 29%]
distutils/tests/test_build_clib.py .......                                                                                                 [ 30%]
distutils/tests/test_build_ext.py ..............................                                                                           [ 37%]
distutils/tests/test_build_py.py .........                                                                                                 [ 38%]
distutils/tests/test_build_scripts.py .....                                                                                                [ 39%]
distutils/tests/test_ccompiler.py .....                                                                                                    [ 41%]
distutils/tests/test_check.py ........                                                                                                     [ 42%]
distutils/tests/test_clean.py ...                                                                                                          [ 43%]
distutils/tests/test_cmd.py .........                                                                                                      [ 45%]
distutils/tests/test_config.py ..                                                                                                          [ 45%]
distutils/tests/test_config_cmd.py ......                                                                                                  [ 46%]
distutils/tests/test_core.py .........                                                                                                     [ 48%]
distutils/tests/test_cygwinccompiler.py ..ss..                                                                                             [ 50%]
distutils/tests/test_dir_util.py .........                                                                                                 [ 51%]
distutils/tests/test_dist.py ....s......E/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/_pytest/main.py:339: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: _cov, Hook: pytest_runtestloop
FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: '/Users/jaraco/code/pypa/distutils'
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
E
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 1678, in get_object_from_normpath
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_file.py", line 562, in get_entry
INTERNALERROR> KeyError: 'Users'
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/_pytest/main.py", line 285, in wrap_session
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/_pytest/main.py", line 339, in _main
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_callers.py", line 156, in _multicall
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pytest_cov/plugin.py", line 339, in pytest_runtestloop
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pytest_cov/engine.py", line 44, in ensure_topdir_wrapper
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_os.py", line 1426, in wrapped
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_os.py", line 456, in chdir
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 2940, in confirmdir
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 1760, in resolve
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 1689, in get_object_from_normpath
INTERNALERROR>   File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 430, in raise_os_error
INTERNALERROR> FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: '/Users/jaraco/code/pypa/distutils'
Traceback (most recent call last):
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 1678, in get_object_from_normpath
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_file.py", line 562, in get_entry
KeyError: 'Users'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/_pytest/config/__init__.py", line 178, in main
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_callers.py", line 139, in _multicall
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/_pytest/main.py", line 332, in pytest_cmdline_main
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/_pytest/main.py", line 317, in wrap_session
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_os.py", line 1426, in wrapped
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_os.py", line 456, in chdir
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 2940, in confirmdir
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 1760, in resolve
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 1689, in get_object_from_normpath
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 430, in raise_os_error
FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: '/Users/jaraco/code/pypa/distutils'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/bin/pytest", line 8, in <module>
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/_pytest/config/__init__.py", line 206, in console_main
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/_pytest/config/__init__.py", line 186, in main
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/_pytest/config/__init__.py", line 1135, in _ensure_unconfigure
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_callers.py", line 139, in _multicall
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/_pytest/faulthandler.py", line 45, in pytest_unconfigure
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_os.py", line 1426, in wrapped
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_os.py", line 326, in close
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 885, in get_open_file
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 907, in get_open_files
  File "/Users/jaraco/code/pypa/distutils/.tox/py313/lib/python3.13/site-packages/pyfakefs/fake_filesystem.py", line 430, in raise_os_error
OSError: [Errno 9] Bad file descriptor in the fake filesystem: '9'
py313: exit 1 (4.14 seconds) /Users/jaraco/code/pypa/distutils> pytest pid=78049
  py313: FAIL code 1 (5.47=setup[1.34]+cmd[4.14] seconds)
  evaluation failed :( (5.51 seconds)

The issue seems to be in pyfakefs.

@jaraco
Copy link
Member Author

jaraco commented Jun 26, 2024

The issue appears to be unrelated to free threading and instead to changes in 3.13 in general (pytest-dev/pyfakefs#1017).

@jaraco jaraco changed the title Tests crash on teardown using Python 3.13b2 free-threading Tests crash on teardown using Python 3.13b2 Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant