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

Running the tests on Python 3.13 fails with debug logging enables #605

Open
jelly opened this issue Dec 4, 2024 · 0 comments
Open

Running the tests on Python 3.13 fails with debug logging enables #605

jelly opened this issue Dec 4, 2024 · 0 comments

Comments

@jelly
Copy link

jelly commented Dec 4, 2024

When running the tests on Python 3.13 the test run fails due to logging exceptions. This did not happen under Python 3.12:

Traceback (most recent call last):
  File "/usr/lib/python3.13/logging/__init__.py", line 1153, in emit
    stream.write(msg + self.terminator)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
ValueError: I/O operation on closed file.
Call stack:
  File "/usr/lib/python3.13/threading.py", line 1012, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.13/threading.py", line 1342, in run
    self.function(*self.args, **self.kwargs)
  File "/build/python-lsp-server/src/python-lsp-server-1.12.0/pylsp/_utils.py", line 43, in run
    return func(*args, **kwargs)
  File "/build/python-lsp-server/src/python-lsp-server-1.12.0/pylsp/python_lsp.py", line 445, in lint
    self._lint_text_document(
  File "/build/python-lsp-server/src/python-lsp-server-1.12.0/pylsp/python_lsp.py", line 456, in _lint_text_document
    flatten(self._hook("pylsp_lint", doc_uri, is_saved=is_saved)),
  File "/build/python-lsp-server/src/python-lsp-server-1.12.0/pylsp/python_lsp.py", line 260, in _hook
    return hook_handlers(
  File "/usr/lib/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/build/python-lsp-server/src/python-lsp-server-1.12.0/pylsp/config/config.py", line 39, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/lib/python3.13/site-packages/pluggy/_manager.py", line 476, in traced_hookexec
    outcome = Result.from_call(
  File "/usr/lib/python3.13/site-packages/pluggy/_result.py", line 62, in from_call
    result = func()
  File "/usr/lib/python3.13/site-packages/pluggy/_manager.py", line 477, in <lambda>
    lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
  File "/usr/lib/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "/build/python-lsp-server/src/python-lsp-server-1.12.0/pylsp/plugins/mccabe_lint.py", line 23, in pylsp_lint
    log.debug("Running mccabe lint with threshold: %s", threshold)
Message: 'Running mccabe lint with threshold: %s'
Arguments: (15,)
--- Logging error ---

I've worked around the issue by disabling the DEBUG loglevel in conftest.py and replaced it with INFO and then all the tests pass.

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