Skip to content

Fix inline comments not stripped from SSH config values#1574

Open
wowi42 wants to merge 2 commits intopyinfra-dev:3.xfrom
KalvadTech:fix/ssh-config-inline-comments
Open

Fix inline comments not stripped from SSH config values#1574
wowi42 wants to merge 2 commits intopyinfra-dev:3.xfrom
KalvadTech:fix/ssh-config-inline-comments

Conversation

@wowi42
Copy link
Contributor

@wowi42 wowi42 commented Mar 2, 2026

SSH config lines with inline comments (e.g. "IdentityFile ~/.ssh/key # comment") were passed through to paramiko with the comment included, causing issues like "No such file or directory: '/home/user/.ssh/key # comment'".

Fixes #1568

  • Pull request is based on the default branch (3.x at this time)
  • Pull request includes tests for any new/updated operations/facts
  • Pull request includes documentation for any new/updated operations/facts
  • Tests pass (see scripts/dev-test.sh)
  • Type checking & code style passes (see scripts/dev-lint.sh)

wowi42 added 2 commits March 2, 2026 09:33
SSH config lines with inline comments (e.g. "IdentityFile ~/.ssh/key # comment")
were passed through to paramiko with the comment included, causing issues like
"No such file or directory: '/home/user/.ssh/key # comment'".

Fixes pyinfra-dev#1568
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.

pyinfra not robust for comments at the end of lines in ssh config

1 participant