-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CliRunner causes subprocess.run(..., stdout=sys.stderr) to raise UnsupportedOperation #2412
Comments
@davidism, any thoughts? |
Nope, haven't had a chance to look into this and likely won't any time soon. You're welcome to submit a PR for review though. |
Here's a simplified repro
From the
This is the part that getting us into trouble (emphasis added):
Notably, the
So, I guess this is technically a bug in the program (i.e. it assumes that One option for a workaround is to pipe the output and write it out manually: sys.stderr.write(
subprocess.run(["date"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding="utf-8").stdout
) |
Pipfile(.lock)
tl;dr:
click==8.1.3
on Ubuntu 20.04.5 LTS# pipenv isn't needed unless you want the exact deps I used. pipenv install --deploy pipenv run pytest test_sscce.py
The script works fine when invoked directly:
The text was updated successfully, but these errors were encountered: