Skip to content

Use binary file for devnull - #271

Merged
nir0s merged 3 commits into
python-distro:masterfrom
methane:patch-1
Jul 2, 2021
Merged

Use binary file for devnull#271
nir0s merged 3 commits into
python-distro:masterfrom
methane:patch-1

Conversation

@methane

Copy link
Copy Markdown
Contributor

This is not a bug. But binary file is more efficient because TextIOWrapper is not used.

This is not a bug. But binary file is more efficient because TextIOWrapper is not used.

@hartworkhartwork left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work. I have tried:

importosimportsubprocesswithopen(os.devnull, 'wb') asdevnull:
argv= ['sh', '-c', 'echo stdout; echo stderr >&2']
subprocess.check_output(argv, stderr=devnull)

@methane

Copy link
Copy Markdown
ContributorAuthor

We can use stderr=subprocess.DEVNULL isntead of opening it manually if we can drop Python 2 and 3.2 support.

@jdufresne

Copy link
Copy Markdown
Member

We can use stderr=subprocess.DEVNULL isntead of opening it manually if we can drop Python 2 and 3.2 support.

I opened #281 to remove EOL Pythons, allowing for using DEVULL

jdufresne
jdufresne previously approved these changes Jul 1, 2021
@nir0s
nir0s merged commit 53a031d into python-distro:masterJul 2, 2021
@hartworkhartwork added this to the 1.6.0 milestone Jul 10, 2021
@methane
methane deleted the patch-1 branch September 18, 2021 02:08
Sign up for freeto 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.

4 participants

@methane@jdufresne@hartwork@nir0s