This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ResourceWarning in test_logging.HandlerTest.test_post_fork_child_no_deadlock
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gregory.p.smith, vstinner, xtreak
Priority: normal Keywords: patch

Created on 2019-05-13 13:55 by xtreak, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 13283 merged xtreak, 2019-05-13 13:59
PR 13285 merged miss-islington, 2019-05-13 14:49
Messages (3)
msg342330 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-05-13 13:55
There was a test added with 64aa6d2000665efb1a2eccae176df9520bf5f5e6. It  opens a stream of '/dev/null' in the test and doesn't close it causing ResourceWarning. A fix would be to assign it to a variable and close it as part of test's cleanup process. I will raise a PR for this.

./python.exe -m unittest test.test_logging.HandlerTest.test_post_fork_child_no_deadlock
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_logging.py:142: ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' mode='wt' encoding='UTF-8'>
  loggerDict.clear()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
.
----------------------------------------------------------------------
Ran 1 test in 0.606s

OK
msg342335 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-05-13 14:48
New changeset 2c10538d11fa9be9a1a9f21605861e10ec4fa207 by Victor Stinner (Xtreak) in branch 'master':
bpo-36903: Fix ResourceWarning in test_logging (GH-13283)
https://github.com/python/cpython/commit/2c10538d11fa9be9a1a9f21605861e10ec4fa207
msg342344 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-05-13 15:39
New changeset 744129db5d4e7706fd7d46dfc691aa47fabd66fa by Victor Stinner (Miss Islington (bot)) in branch '3.7':
bpo-36903: Fix ResourceWarning in test_logging (GH-13283) (GH-13285)
https://github.com/python/cpython/commit/744129db5d4e7706fd7d46dfc691aa47fabd66fa
History
Date User Action Args
2022-04-11 14:59:15adminsetgithub: 81084
2019-05-13 15:43:45xtreaksetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-05-13 15:39:53vstinnersetmessages: + msg342344
2019-05-13 14:49:42miss-islingtonsetpull_requests: + pull_request13192
2019-05-13 14:48:55vstinnersetmessages: + msg342335
2019-05-13 13:59:05xtreaksetkeywords: + patch
stage: patch review
pull_requests: + pull_request13190
2019-05-13 13:57:05vstinnersetnosy: + vstinner
2019-05-13 13:55:54xtreakcreate