Skip to content

fix(cmd): checking process.DEVNUL were needlessly opening os.devnull #582

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

Merged
merged 1 commit into from
Feb 25, 2017

Conversation

ankostis
Copy link
Contributor

Also this fixes resource-leak warning on Windows Python-3.5.3+:

D:\python-3.5.2.amd64\lib\site-packages\git\cmd.py:583: ResourceWarning:
unclosed file <_io.BufferedWriter name='nul'>
  else getattr(subprocess, 'DEVNULL', open(os.devnull, 'wb')))

Fixes resource-leak warning on Windows Puython-3.5.3+:

D:\python-3.5.2.amd64\lib\site-packages\git\cmd.py:583: ResourceWarning:
unclosed file <_io.BufferedWriter name='nul'>
  else getattr(subprocess, 'DEVNULL', open(os.devnull, 'wb')))
@Byron Byron added this to the v2.1.2 - Bugfixes milestone Feb 25, 2017
@Byron
Copy link
Member

Byron commented Feb 25, 2017

Thanks a lot for this one!
I do hope that the subprocess consumes the file-handle too. Last time I checked, it looked like it did, so merely opening the file should not cause leakage.

@Byron Byron merged commit 2ede752 into master Feb 25, 2017
@Byron Byron removed the in progress label Feb 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants