We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
subprocess-tee errors when the subprocess prints a non- utf-8 character. This is a difference between subprocess and subprocess-tee.
subprocess-tee
subprocess
Reproduction
# my_script.sh echo -e "\xC0\x80"
# reproducer.py import subprocess import subprocess_tee print("Subprocess:") subprocess.run(args=["bash", "my_script.sh"]) print("Subprocess tee:") subprocess_tee.run(args=["bash", "my_script.sh"])
subprocess will replace invalid bytes with a placeholder character, while subprocess-tee errors with:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte
Fix
I suggest using errors="replace" on line.decode().
errors="replace"
line.decode()
The text was updated successfully, but these errors were encountered:
Hmm... not sure but okey. I will accept a patch.
Sorry, something went wrong.
No branches or pull requests
subprocess-tee
errors when the subprocess prints a non- utf-8 character.This is a difference between
subprocess
andsubprocess-tee
.Reproduction
subprocess
will replace invalid bytes with a placeholder character, whilesubprocess-tee
errors with:Fix
I suggest using
errors="replace"
online.decode()
.The text was updated successfully, but these errors were encountered: