Repository navigation
Fallback to md5sum when uname fails - #75
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #75 +/- ##
==========================================
+ Coverage 94.30% 97.89% +3.58%
==========================================
Files 13 13
Lines 738 1138 +400
==========================================
+ Hits 696 1114 +418
+ Misses 42 24 -18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a Linux md5sum fallback when remote system detection fails.
Changes:
- Handles
ChannelOpenErrorandProcessErrorfromuname. - Adds regression coverage for session failure fallback.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
sshfs/spec.py |
Implements checksum fallback logic. |
tests/test_sshfs.py |
Tests fallback to md5sum. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Hi! I wanted to follow up and ask whether this PR is still useful and whether the fallback behaviour matches the project’s expectations. I’m happy to address any requested changes or update the tests if needed. Thanks for taking a look. |
checksum on main now sends its command through _execute_with_paths, caches uname, and handles names that need escaping, so the conflicts are resolved by keeping main's checksum and wrapping only the _get_system call in the uname fallback. The tests called _checksum on a stand-in object, which no longer has what _checksum uses. They now run against the mock server with uname refused (ChannelOpenError) or failing (ProcessError), on a new instance that hasn't cached uname yet, and check the checksum of a name with a space and that a missing file still raises FileNotFoundError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for your patience, and sorry it took this long to get back to you. Yes, this is still useful.
The tests called A refused |
wrap_exceptions turns a ProcessError whose message ends in "No such file or directory" into FileNotFoundError, so that uname failure skipped the md5sum fallback. The fallback tests now cover it, and they skip when the machine that runs the mock server has no md5sum, as on older macOS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>


Refs #16.
checksum()currently callsunamebefore trying the checksum command. On servers where opening a shell session forunamefails, this preventsmd5sumfrom being attempted even when it is available.This falls back to the Linux
md5sumpath whenunamecannot be executed.Regression tests exercise the real
_get_systempath for bothChannelOpenErrorandProcessError, check quoting of paths containing spaces, and verify that a failure of the fallback command still propagates.Validation on Linux (WSL) / Python 3.11.17:
python -m pytest -q: 48 passed.black --check tests/test_sshfs.py: passed (26.1.0).isort --check-only tests/test_sshfs.py: passed (5.10.1).git diff --check: passed.The five focused fallback cases also pass on Windows. The full Windows run has seven failures, all reproduced on the previous PR head; the project CI targets Linux and macOS.