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: Use fdwalk() within os.closerange() impl if available
Type: performance Stage: resolved
Components: Demos and Tools Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: gregory.p.smith, iritkatriel, miss-islington
Priority: normal Keywords: patch

Created on 2019-09-11 13:40 by gregory.p.smith, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15224 merged kulikjak, 2019-09-11 13:40
PR 15978 merged miss-islington, 2019-09-11 15:12
Messages (6)
msg351875 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2019-09-11 13:40
On POSIX platforms that support the fdwalk() API, use it within the os.closerange() implementation.
msg351890 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2019-09-11 14:10
contribution from Jakub Kulík (see the PR)
msg351927 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2019-09-11 15:11
"""On Solaris, we are patching (for many years now) `posix_closerange` function to use `fdwalk` to close file descriptors instead of a for loop. While for a long time only Solaris had `fdwalk`, but if I am not mistaken, some other OSes implement it today as well and as such others might be interested in this as well.

If you will like it, I can create an issue for that. Also, I am not sure whether `_fdwalk_close_func` needs a clinic part or if configure detection is sufficient this way - I am open to all comments and ideas and can rewrite it as needed ;).

""" - Jakub
msg351928 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2019-09-11 15:12
New changeset e20134f889a0cfcc37a46979f31a1c98b800de07 by Gregory P. Smith (Jakub Kulík) in branch 'master':
bpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)
https://github.com/python/cpython/commit/e20134f889a0cfcc37a46979f31a1c98b800de07
msg352113 - (view) Author: miss-islington (miss-islington) Date: 2019-09-12 11:19
New changeset 84eb42e3c90c03f13262f19185b14566e10941ac by Miss Islington (bot) in branch '3.8':
bpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)
https://github.com/python/cpython/commit/84eb42e3c90c03f13262f19185b14566e10941ac
msg378375 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-10-10 10:29
This seems complete, can it be closed?
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82291
2020-10-11 19:23:32gregory.p.smithsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-10-10 10:29:36iritkatrielsetnosy: + iritkatriel
messages: + msg378375
2019-09-12 11:19:24miss-islingtonsetnosy: + miss-islington
messages: + msg352113
2019-09-11 15:12:08miss-islingtonsetpull_requests: + pull_request15611
2019-09-11 15:12:01gregory.p.smithsetmessages: + msg351928
2019-09-11 15:11:10gregory.p.smithsetmessages: + msg351927
2019-09-11 14:10:06gregory.p.smithsetassignee: gregory.p.smith
messages: + msg351890
2019-09-11 13:40:16kulikjaksetkeywords: + patch
pull_requests: + pull_request15581
2019-09-11 13:40:01gregory.p.smithcreate