Skip to content

Fallback to md5sum when uname fails - #75

Open
AleksZyro wants to merge 2 commits into
fsspec:mainfrom
AleksZyro:fallback-md5sum-checksum
Open

Fallback to md5sum when uname fails#75
AleksZyro wants to merge 2 commits into
fsspec:mainfrom
AleksZyro:fallback-md5sum-checksum

Conversation

@AleksZyro

Copy link
Copy Markdown
Contributor

Refs #16.

checksum() currently calls uname before trying the checksum command. On servers where opening a shell session for uname fails, this prevents md5sum from being attempted even when it is available.

This falls back to the Linux md5sum path when uname cannot be executed, and adds a regression test for that case.

Tested with:

python -m pytest tests/test_sshfs.py::test_checksum_falls_back_to_md5sum_when_uname_session_fails -q

@codecov-commenter

codecov-commenter commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.21%. Comparing base (15aac74) to head (2cab253).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #75      +/-   ##
==========================================
- Coverage   94.30%   94.21%   -0.10%     
==========================================
  Files          13       13              
  Lines         738      882     +144     
==========================================
+ Hits          696      831     +135     
- Misses         42       51       +9     

☔ 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Linux md5sum fallback when remote system detection fails.

Changes:

  • Handles ChannelOpenError and ProcessError from uname.
  • 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.

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.

3 participants