Skip to content

Python 3: Fix use of subprocess - #9716

Merged
michaelDCurran merged 2 commits into
nvaccess:threshold_py3_stagingfrom
BabbageCom:subprocess
Jun 11, 2019
Merged

Python 3: Fix use of subprocess#9716
michaelDCurran merged 2 commits into
nvaccess:threshold_py3_stagingfrom
BabbageCom:subprocess

Conversation

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Link to issue number:

None

Summary of the issue:

By default, the subprocess module outputs stdout in a bytes object. However, in several cases, we want to fetch strings from this output.

Description of how this pull request fixes the issue:

Provide the new text keyword argument to subprocess function calls. In the case of appx/sconscript, switch to subprocess.run(check=True) instead of subprocess.check.
Also, several uses of subprocess.list2cmdline where related to the use of shellapi.ShellExecute. I also looked at shellapi.ShellExecute as part of this and removed all unnecessary and broken calls of decode on unicode strings.

Testing performed:

T.b.d. I don't know of a good way to test the appx code locally.

Known issues with pull request:

None known

@michaelDCurran
michaelDCurran merged commit 031532d into nvaccess:threshold_py3_staging Jun 11, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Jun 11, 2019
@LeonarddeR
LeonarddeR deleted the subprocess branch June 20, 2019 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants