[system-health] Make run_command()
Python 3-compliant
#6371
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- Why I did it
universal_newlines=True
parameter tosubprocess.Popen()
; no longer use.encode('utf-8')
on resulting stdout.This was missed in #5886
Note: I would prefer to use
text=True
instead ofuniversal_newlines=True
, as the former is an alias only available in Python 3 and is more understandable than the latter. However, Even though the setup.py file for this package only specifies Python 3, the LGTM tool finds other Python 2 code in the repo and validates the code as Python 2 code and alerts thattext=True
is an invalid parameter. Will stick withuniversal_newlines=True
for now. Once all Python code in the repo has been converted to Python 3, I will change alluniversal_newlines=True
totext=True
.- How I did it
- How to verify it
- Which release branch to backport (provide reason below if selected)