We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following script:
# script.py import browser_cookie3 browser_cookie3.firefox()
Run it with with -Wa flag so resource warnings are shown. (python -Wa 'path/to/script.py') The following warning is shown:
-Wa
python -Wa 'path/to/script.py'
$ python -Wa 'script.py' C:\Users\a\AppData\Local\Programs\Python\Python311\Lib\site-packages\browser_cookie3\__init__.py:373: ResourceWarning: unclosed file <_io.BufferedRandom name='C:\\Users\\a\\AppData\\Local\\Temp\\ tmp3g0or7p1.sqlite'> suffix='.sqlite').name ResourceWarning: Enable tracemalloc to get the object allocation traceback
The result after enabling tracemalloc:
$ python -Wa -X tracemalloc 'script.py' C:\Users\a\AppData\Local\Programs\Python\Python311\Lib\site-packages\browser_cookie3\__init__.py:373: ResourceWarning: unclosed file <_io.BufferedRandom name='C:\\Users\\a\\AppData\\Local\\Temp\\ tmp1tq62xnu.sqlite'> suffix='.sqlite').name Object allocated at (most recent call last): File "C:\Users\a\AppData\Local\Programs\Python\Python311\Lib\tempfile.py", lineno 563 file = _io.open(dir, mode, buffering=buffering,
The text was updated successfully, but these errors were encountered:
fix(__get_connection_legacy): close tempfile to avoid ResourceWarning
5706142
The context manager will close the file explicitly. closes borisbabic#196
Successfully merging a pull request may close this issue.
Consider the following script:
Run it with with
-Wa
flag so resource warnings are shown. (python -Wa 'path/to/script.py'
)The following warning is shown:
The result after enabling tracemalloc:
The text was updated successfully, but these errors were encountered: