feat(sftp): migrate from paramiko to asyncssh (PPK v3, non-blocking IO) - #44
Merged
Conversation
Adds native PPK v2 support for SFTP site authentication, matching WinSCP behaviour. Users can now select a .ppk file directly when configuring a site — no manual conversion required. Implementation: - New ppk_utils.py: is_ppk_file() detects .ppk extension; load_ppk_key() converts PPK → OpenSSH in-memory via puttykeys + paramiko, nothing written to disk - protocols.py: when key_path ends in .ppk, route through load_ppk_key() and pass pkey= to paramiko instead of key_filename= - Passphrase-protected PPK files use the existing password field - puttykeys added as a dependency (uses cryptography, already installed) Supports RSA and Ed25519 key types (PPK v2). PPK v3 users can convert with PuTTYgen. Closes #43
Replace paramiko with asyncssh for all SFTP operations. asyncssh handles PPK v2/v3 keys natively (no puttykeys conversion needed) and provides non-blocking IO via a dedicated event loop on a background thread, eliminating the UI freeze workarounds (daemon threads, _sftp_lock, _listdir_attr_safe) that were needed with paramiko. Changes: - Rewrite SFTPClient in protocols.py to use asyncssh with a dedicated asyncio event loop on a daemon thread - Remove ppk_utils.py (asyncssh handles PPK natively) - Remove puttykeys dependency, add asyncssh>=2.14 - Simplify host_key_policy.py and ssh_utils.py (remove paramiko code) - Update all tests to use asyncssh mocks - Update PyInstaller spec for asyncssh Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What changed
pyproject.tomlasyncssh>=2.14protocols.pySFTPClientwith asyncssh + background event loopppk_utils.pyhost_key_policy.pyknown_hostsparamssh_utils.pyportkeydrop.spectest_*.py(6 files)Architecture
All asyncssh operations run on a persistent background event loop. The
_run()helper submits coroutines and blocks until completion, keeping the wx UI thread responsive.Preserved behavior
Test plan
🤖 Generated with Claude Code