-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix checkm subprocess #105
Conversation
I believe that |
import subprocess
subprocess.run("ls /")
# Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
# File "/home/aroneys/m/users/aroneys/.conda/envs/aviary_dev/lib/python3.10/subprocess.py", line 503, in run
# with Popen(*popenargs, **kwargs) as process:
# File "/home/aroneys/m/users/aroneys/.conda/envs/aviary_dev/lib/python3.10/subprocess.py", line 971, in __init__
# self._execute_child(args, executable, preexec_fn, close_fds,
# File "/home/aroneys/m/users/aroneys/.conda/envs/aviary_dev/lib/python3.10/subprocess.py", line 1863, in _execute_child
# raise child_exception_type(errno_num, err_msg, err_filename)
# FileNotFoundError: [Errno 2] No such file or directory: 'ls /' So if the db is under an absolute path, it wont work. |
Could sanitise the input using |
Actually bad example since it doesn't have access to |
I might be misdisagnosing this. Original error was |
Yeah, okay I think this was a problem in the past looking through code. Might be some weird interaction with invoking sub processes from within a conda environment? Like the main python executable is not in the same conda environment as checkm2 so python can't find it until you invoke a shell command? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like aviary is riddled with shell=True
instances and we should probably clean them up using that function you listed previously, so maybe add it to this command as a test to make sure it still works after being cleaned
I think its the use of a string input that is the issue. Doing So not too hard. Do you want me to have a look at the other |
I'll sort out the other ones in a different pr, that code in general needs to be cleaned up. A lot of it is legacy stuff from the original slamM snakemake script so there might be some weird cases |
This method works in my environment. |
The command can fail with "No such file or directory" if the database path uses shell stuff.
Could open an injection vulnerability.