messense / nh3

Python binding to Ammonia HTML sanitizer Rust crate
https://nh3.readthedocs.io
MIT License
260 stars 8 forks source link

Aborted tests with Python 3.13.0b2 #45

Open arkamar opened 5 months ago

arkamar commented 5 months ago

I tried to test nh3-0.2.17 with Python 3.13.0b2 and the test suit is aborted with following output:

python3.13 -m pytest -vv -ra -l -Wdefault -Werror::pytest.PytestUnhandledCoroutineWarning --color=yes -o console_output_style=count -o tmp_path_retention_count=0 -o tmp_path_retention_policy=failed -p no:cov -p no:flake8 -p no:flakes -p no
:pylint -p no:markdown -p no:sugar -p no:xvfb -p no:pytest-describe -p no:plus -p no:tavern -p no:salt-factories
================================================= test session starts =================================================
platform linux -- Python 3.13.0b2, pytest-8.2.2, pluggy-1.5.0 -- /var/tmp/portage/dev-python/nh3-0.2.17/work/nh3-0.2.17-python3_13/install/usr/bin/python3.13
cachedir: .pytest_cache
rootdir: /var/tmp/portage/dev-python/nh3-0.2.17/work/nh3-0.2.17
configfile: pyproject.toml
collecting ... collected 4 items

tests/test_nh3.py::test_clean PASSED                                                                             [1/4]
tests/test_nh3.py::test_clean_with_attribute_filter Fatal Python error: Aborted

Current thread 0x00007f7623806e80 (most recent call first):
  File "/var/tmp/portage/dev-python/nh3-0.2.17/work/nh3-0.2.17/tests/test_nh3.py", line 67 in test_clean_with_attribute_filter
  File "/usr/lib/python3.13/site-packages/_pytest/python.py", line 162 in pytest_pyfunc_call
  File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/usr/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/usr/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/usr/lib/python3.13/site-packages/_pytest/python.py", line 1632 in runtest
  File "/usr/lib/python3.13/site-packages/_pytest/runner.py", line 173 in pytest_runtest_call
  File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/usr/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/usr/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/usr/lib/python3.13/site-packages/_pytest/runner.py", line 241 in <lambda>
  File "/usr/lib/python3.13/site-packages/_pytest/runner.py", line 341 in from_call
  File "/usr/lib/python3.13/site-packages/_pytest/runner.py", line 240 in call_and_report
  File "/usr/lib/python3.13/site-packages/_pytest/runner.py", line 135 in runtestprotocol
  File "/usr/lib/python3.13/site-packages/_pytest/runner.py", line 116 in pytest_runtest_protocol
  File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/usr/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/usr/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/usr/lib/python3.13/site-packages/_pytest/main.py", line 364 in pytest_runtestloop
  File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/usr/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/usr/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/usr/lib/python3.13/site-packages/_pytest/main.py", line 339 in _main
  File "/usr/lib/python3.13/site-packages/_pytest/main.py", line 285 in wrap_session
  File "/usr/lib/python3.13/site-packages/_pytest/main.py", line 332 in pytest_cmdline_main
  File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/usr/lib/python3.13/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/usr/lib/python3.13/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/usr/lib/python3.13/site-packages/_pytest/config/__init__.py", line 178 in main
  File "/usr/lib/python3.13/site-packages/_pytest/config/__init__.py", line 206 in console_main
  File "/usr/lib/python3.13/site-packages/pytest/__main__.py", line 7 in <module>
  File "<frozen runpy>", line 88 in _run_code
  File "<frozen runpy>", line 198 in _run_module_as_main
/var/tmp/portage/dev-python/nh3-0.2.17/temp/environment: line 2730:   291 Aborted                 "${@}"
mgorny commented 4 months ago

The actual error is:

python: ./Include/internal/pycore_object.h:284: _PyObject_Init: Assertion `_PyType_HasFeature(typeobj, Py_TPFLAGS_HEAPTYPE) || _Py_IsImmortal(typeobj)' failed.

and typeobj is:

$1 = (PyTypeObject *) 0x55e97638b580 <_PyExc_TypeError>

So this is probably https://github.com/PyO3/pyo3/issues/4311.