-
Notifications
You must be signed in to change notification settings - Fork 128
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
Make shell scripts work on Windows #437
Conversation
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.
Thanks for this Windows compat work, @Artoria2e5! I left a few comments inline below.
I would eventually like to remove all shell command string usages in augur and switch to only argv lists, because it's really easy to forget to apply shlex.quote
consistently to command strings. But in the meantime, this is still an improvement! :-)
Thanks @Artoria2e5, merged! |
The first commit changes
run_shell_command
to always launch the shell as if it is a program. Doing so removes the interoperability problem with Python's interpretation ofshell = True
on different platforms. After this commit,augur align
fails correctly with a 127 (command not found) exit value on Windows.I have also modified to print the stdout/err on error, since doing so makes debug a bit easier.
The second commit shell-quotes all user-specified filenames. This is to avoid strange errors and scary "command injection vulnerabilities" with weird-looking filenames.