fabric.Connection did not ignore comments when reading user name from ssh config
fabric.Connection did not ignore comments when reading user name from ssh config
fabric.Connection("host")
with ssh config file below
-- Host host HostName 10.10.100.23 User ec2-user # comments
--
fabric will read user name name ec2-user # comments instead of ec2-user when using c.put
To Reproduce
<Connection host=10.100.8.4 user=ec2-user # hello gw=proxyjump> user name is ec2-user # hello instead of ec2-user
Expected behaviour A clear and concise description of what you expected to happen. user name should be ec2-user
Environment Make sure your report gets the attention it deserves: bug reports with missing information may be ignored or punted back to you, delaying a fix. The below constitutes a bare minimum; more info is almost always better:
- What version of the Python interpreter are you using? Are you using an alternative interpreter such as PyPy?
Python 3.13.2 (main, Feb 12 2025, 14:59:08) [Clang 19.1.6 ] on darwin
- What operating system are you using both client & server-side?
Mac OS for local Ubuntu for server side
- Are you using OpenSSH server or something else?
OpenSSH server
- Which version or versions of the software are you using?
Name: fabric Version: 3.2.2
- Have you already tried the latest release? yes
- Have you, or can you, try some older releases to pin down where the bug appeared?
No
- How can the developers recreate the bug on their end? If possible, include a copy of your code, the command you used to invoke it, and the full output of your run (if applicable.)
Should related to ssh config parsing
- A common tactic is to pare down your code until a simple (but still bug-causing) “base case” remains. Not only can this help you identify problems which aren’t real bugs, but it means the developer can get to fixing the bug faster.
NA
Additional context Add any other context about the problem here.
Source: fabric/fabric