You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ETA: I've been able to pass an environment variable with a & in it in Invoke and paramiko, so it does seem like a Fabric issue.
Describe the bug
run() on a connection fails if you pass an environment variable (with the env= argument) whose value contains an ampersand (&).
To Reproduce
Steps to reproduce the behaviour (please attach a minimal example):
Run this. Change the hostname, username (if necessary) and key or password:
#!/usr/bin/env python3importfabric# TODO - edit this to match your systemconn=fabric.Connection('my.host.name', user="root", connect_kwargs={"key_filename": "ssh_key"})
env= {"FOO": "has an ampersand & iamnotacommand blah"}
try:
conn.run("hostname", env=env)
exceptExceptionase:
print(e)
Prints out this:
bash: iamnotacommand: command not found
Encountered a bad command exit code!
Command: 'hostname'
Exit code: 127
Stdout: already printed
Stderr: already printed
Remove the & and it works fine.
Expected behaviour
It should print out the hostname.
Environment
What version of the Python interpreter are you using? Are you using an
alternative interpreter such as PyPy?
Python 3.12.0 (main, Nov 21 2023, 17:38:35) [GCC 12.2.0] on linux
What operating system are you using both client & server-side?
Which version or versions of the software are you using?
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?
I have not
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.)
see above
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.
see above
The text was updated successfully, but these errors were encountered:
ETA: I've been able to pass an environment variable with a
&
in it in Invoke and paramiko, so it does seem like a Fabric issue.Describe the bug
run()
on a connection fails if you pass an environment variable (with theenv=
argument) whose value contains an ampersand (&
).To Reproduce
Steps to reproduce the behaviour (please attach a minimal example):
Run this. Change the hostname, username (if necessary) and key or password:
Prints out this:
Remove the
&
and it works fine.Expected behaviour
It should print out the hostname.
Environment
alternative interpreter such as PyPy?
Client:
Server:
yes
3.2.2
yes
appeared?
I have not
copy of your code, the command you used to invoke it, and the full output of
your run (if applicable.)
see above
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.
see above
The text was updated successfully, but these errors were encountered: