classification
Title: Avoid ResourceWarnings from platform._dist_try_harder
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: lemburg, miss-islington, scop, vstinner, xtreak
Priority: normal Keywords: patch

Created on 2016-08-30 21:19 by scop, last changed 2018-11-29 12:08 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
platform-resourcewarning.patch scop, 2016-08-30 21:19 review
Pull Requests
URL Status Linked Edit
PR 10792 merged vstinner, 2018-11-29 11:15
PR 10793 merged miss-islington, 2018-11-29 11:31
Messages (9)
msg273969 - (view) Author: Ville Skyttä (scop) * Date: 2016-08-30 21:19
Use opened files as context managers.
msg326338 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python triager) Date: 2018-09-25 10:06
Thanks for the report and patch Ville. CPython development now uses GitHub PR instead of patches. It seems usages of this function was removed in 8b94b41ab7b12f745dea744e8940631318816935 during removal of platform.linux_distribution. This essentially seems to be unused code on master which I hope can be removed. So this patch is effective only for 3.7 and 3.6. Would you like to make a PR to take this forward?

No usages on master except definition.

➜  cpython git:(master) rg _dist_try_harder
Lib/platform.py
230:def _dist_try_harder(distname, version, id):


Thanks
msg330662 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python triager) Date: 2018-11-29 05:50
I guess this can be closed as out of date since the function was removed with https://github.com/python/cpython/pull/10787/. 

cc: Victor
msg330680 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-29 11:16
Python 3.6 and 3.7 are still supported. The patch LGTM, I converted it to a PR.
msg330681 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-29 11:31
New changeset 7eeab87263b831adbe617a4af7ec5b5d9296962a by Victor Stinner in branch '3.7':
bpo-27903: Fix ResourceWarning in platform.dist() (GH-10792)
https://github.com/python/cpython/commit/7eeab87263b831adbe617a4af7ec5b5d9296962a
msg330682 - (view) Author: miss-islington (miss-islington) Date: 2018-11-29 11:53
New changeset cbf57674e257617977b35c016e861a52b5f65359 by Miss Islington (bot) in branch '3.6':
bpo-27903: Fix ResourceWarning in platform.dist() (GH-10792)
https://github.com/python/cpython/commit/cbf57674e257617977b35c016e861a52b5f65359
msg330683 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-29 12:04
Thanks Ville Skyttä for your bugfix! I applied it in 3.6 and 3.7 branches.

FYI as Karthikeyan Singaravelan wrote, the function is gone (I removed it) from the master branch ;-)
msg330684 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python triager) Date: 2018-11-29 12:08
Ah sorry I forgot the previous versions that had this code. Thanks for the catch and PR victor :)
msg330685 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-29 12:08
No problem, thanks for "cc-ing" me ;-)
History
Date User Action Args
2018-11-29 12:08:48vstinnersetmessages: + msg330685
2018-11-29 12:08:04xtreaksetmessages: + msg330684
2018-11-29 12:04:41vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-11-29 12:04:32vstinnersetmessages: + msg330683
2018-11-29 11:53:21miss-islingtonsetnosy: + miss-islington
messages: + msg330682
2018-11-29 11:31:23miss-islingtonsetstage: resolved -> patch review
pull_requests: + pull_request10040
2018-11-29 11:31:10vstinnersetmessages: + msg330681
2018-11-29 11:16:14vstinnersetstatus: closed -> open
resolution: out of date -> (no value)
messages: + msg330680

versions: + Python 3.6, Python 3.7
2018-11-29 11:15:41vstinnersetpull_requests: + pull_request10039
2018-11-29 05:50:57xtreaksetstatus: open -> closed

nosy: + vstinner
messages: + msg330662

resolution: out of date
stage: resolved
2018-09-25 10:06:20xtreaksetmessages: + msg326338
2018-09-21 11:46:12xtreaksetnosy: + xtreak
2016-08-31 02:14:42ned.deilysetnosy: + lemburg
2016-08-30 21:19:38scopcreate