Skip to content

fix: avoid socket client bare excepts#955

Merged
cybermaggedon merged 1 commit into
trustgraph-ai:release/v2.5from
jmolz:fix-socket-client-bare-excepts
May 27, 2026
Merged

fix: avoid socket client bare excepts#955
cybermaggedon merged 1 commit into
trustgraph-ai:release/v2.5from
jmolz:fix-socket-client-bare-excepts

Conversation

@jmolz

@jmolz jmolz commented May 26, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:
Refs #783

Description of changes:

  • Replace the remaining bare except: handlers in trustgraph-base/trustgraph/api/socket_client.py with except Exception:.
  • Import ConnectionClosed directly so the reader's connection-close handler is stable when handling reader errors.
  • Add unit coverage to ensure socket-client cleanup paths no longer suppress process-level interrupts.

Testing:

  • PYTHONPATH=trustgraph-base pytest tests/unit/test_python_api_client.py::TestSocketClient -q
  • PYTHONPATH=trustgraph-base pytest tests/unit/test_python_api_client.py -q
  • git diff --check
  • rg -n "except\\s*:" trustgraph-base/trustgraph/api/socket_client.py
  • python3 -m py_compile trustgraph-base/trustgraph/api/socket_client.py tests/unit/test_python_api_client.py

@github-actions

Copy link
Copy Markdown

Contributor License Agreement ✅

All contributors have signed the CLA. Thank you!

@cybermaggedon

Copy link
Copy Markdown
Contributor

Thanks for the PR, nice test too!

@cybermaggedon cybermaggedon merged commit eb24d0c into trustgraph-ai:release/v2.5 May 27, 2026
3 checks passed
@jmolz jmolz deleted the fix-socket-client-bare-excepts branch May 27, 2026 13:40
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

Successfully merging this pull request may close these issues.

2 participants