Skip to content

Improve exception string formatting#423

Merged
pkittenis merged 1 commit into
ParallelSSH:masterfrom
lovewave02:enhance/friendly-exception-strings
Jul 23, 2026
Merged

Improve exception string formatting#423
pkittenis merged 1 commit into
ParallelSSH:masterfrom
lovewave02:enhance/friendly-exception-strings

Conversation

@lovewave02

Copy link
Copy Markdown
Contributor

What changed

Exceptions such as AuthenticationError keep a printf-style message and its
values in args, so their default string output currently looks like a tuple.

This adds a shared string representation that formats those values while
leaving args unchanged. Single-argument exceptions keep their existing
output, and invalid formats fall back to Python's normal exception formatting.

The behavior is covered by regression tests and documented in the exceptions
reference.

Verification

  • pytest (21 passed)
  • focused exception tests on Python 3.12 and 3.14
  • flake8 pssh
  • flake8 tests ci/integration_tests
  • python setup.py check --restructuredtext
  • python setup.py sdist bdist_wheel
  • Sphinx HTML build (four existing local libssh import warnings; identical on
    origin/master)

Resolves #404

@lovewave02

Copy link
Copy Markdown
Contributor Author

Python 3.12 is timing out in the existing integration suite, while 3.8, 3.11,
and 3.13 are green. The 3.12 unit-test step passed; the integration step reached
test_scp_recv_larger_files, then hit CircleCI's 10-minute no-output timeout on
all retries.

I also compared that test on the PR head and the pre-change commit in the same
cimg/python:3.12 container. Both failed in the existing SSH test setup, so I
couldn't reproduce a failure specific to this exception-formatting change.

Could you rerun the Python 3.12 job when convenient? I haven't pushed a
retry-only commit.

@pkittenis

Copy link
Copy Markdown
Member

Thanks for the interest and PR.

Changes look good, will retry the test on CircleCI.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.52%. Comparing base (fa95905) to head (d31b2d2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #423      +/-   ##
==========================================
+ Coverage   99.46%   99.52%   +0.06%     
==========================================
  Files          18       18              
  Lines        1694     1702       +8     
==========================================
+ Hits         1685     1694       +9     
+ Misses          9        8       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pkittenis
pkittenis merged commit 2a52a44 into ParallelSSH:master Jul 23, 2026
7 checks passed
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.

Provide a more user friendly string representation of common errors

2 participants