Skip to content

use subprocess.DEVNULL instead of open(os.devnull) to avoid leaking a… #13329

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 4 commits into from
Dec 19, 2023

Conversation

graingert
Copy link
Contributor

@graingert graingert commented Dec 18, 2023

… file handle

fixes #13328

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CLAassistant
Copy link

CLAassistant commented Dec 18, 2023

CLA assistant check
All committers have signed the CLA.

@graingert graingert marked this pull request as ready for review December 18, 2023 15:00
@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (343aa78) 58.04% compared to head (11a9081) 58.05%.

❗ Current head 11a9081 differs from pull request most recent head b8ff036. Consider uploading reports for the commit b8ff036 to get more accurate results

Files Patch % Lines
py/selenium/webdriver/firefox/firefox_binary.py 50.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #13329   +/-   ##
=======================================
  Coverage   58.04%   58.05%           
=======================================
  Files          88       88           
  Lines        5337     5338    +1     
  Branches      224      224           
=======================================
+ Hits         3098     3099    +1     
  Misses       2015     2015           
  Partials      224      224           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Can you please make the linter happy and I can merge this:

  import os
 import time
 from platform import system
-from subprocess import STDOUT, DEVNULL
+from subprocess import DEVNULL
+from subprocess import STDOUT
 from subprocess import Popen

https://github.com/SeleniumHQ/selenium/actions/runs/7249860032/job/19771842820?pr=13329#step:5:24

@graingert graingert requested a review from diemol December 19, 2023 09:30
Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you, @graingert!

@diemol diemol merged commit e01be4a into SeleniumHQ:trunk Dec 19, 2023
@graingert graingert deleted the fix-unclosed-devnull branch December 19, 2023 10:23
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.

[🐛 Bug]: firefox Options raises ResourceWarning
4 participants