For some reason, using subprocess.run() inside of a side_effect function doesn't seem to work. Take the following, which demonstrates the expected behavior:
When the same subprocess.run(["which", "free"]) call is made from inside a side_effect function, the free command is somehow executed instead of which free!
The output of thefuck --version (something like The Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release):
The Fuck 3.32 using Python 3.11.4 and Bash 5.2.15(1)-release
Your system (Debian 7, ArchLinux, Windows, etc.):
Ubuntu 23.04
How to reproduce the bug:
Create ~/.config/thefuck/rules/subprocess_test.py, which is a very simple rule which basically tries to run which free as a side effect:
For some reason, using
subprocess.run()
inside of aside_effect
function doesn't seem to work. Take the following, which demonstrates the expected behavior:When the same
subprocess.run(["which", "free"])
call is made from inside aside_effect
function, thefree
command is somehow executed instead ofwhich free
!The output of
thefuck --version
(something likeThe Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release
):Your system (Debian 7, ArchLinux, Windows, etc.):
How to reproduce the bug:
Create
~/.config/thefuck/rules/subprocess_test.py
, which is a very simple rule which basically tries to runwhich free
as a side effect:Reload
thefuck
(open a new shell) and runfuck
until the rule is tried and applied. You get the (erroneous) output seen below.The output of The Fuck with
THEFUCK_DEBUG=true
exported (typically executeexport THEFUCK_DEBUG=true
in your shell before The Fuck):If the bug only appears with a specific application, the output of that application and its version:
N/A
Anything else you think is relevant:
N/A