-
Notifications
You must be signed in to change notification settings - Fork 238
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: capture stderr
in utils.call
when capture_stdout
is True
#2076
Conversation
I don't understand why PyPy fails on Windows. Will try reverting the shell part. |
shell=False
for utils.call
on Windows & capture stderr
stderr
in utils.call
when capture_stdout
is True
So it works if we keep using shell on Windows which means there are other side effects that I don't understand. |
# workaround platform behaviour differences outlined | ||
# in https://github.com/python/cpython/issues/52803 | ||
path_env = env if env is not None else os.environ | ||
path = path_env.get("PATH", None) | ||
executable = shutil.which(args_[0], path=path) | ||
if executable is None: | ||
msg = f"Couldn't find {args_[0]!r} in PATH {path!r}" | ||
raise FatalError(msg) | ||
args_[0] = executable |
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.
Given shell is still used on Windows, this could just be removed.
The upside if keeping this is that when a CalledProcessError is raised, we get the full path to the executable rather than just the executable name.
Should we rename this to capture_output? Maybe not right now, but when we are refactoring the utils for 3.0? |
That's a good idea for the refactor in 3.0 |
Looks good. +1 on the rename. Any ideas why the change to |
fix #2074