Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue37267

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:os.dup() creates an inheritable fd when handling a character file on Windows
Type:behaviorStage:resolved
Components:Extension Modules, WindowsVersions:Python 3.9, Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: ZackerySpytz, josh.r, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Priority:normalKeywords:patch

Created on2019-06-13 10:12 byZackerySpytz, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 14051mergedZackerySpytz,2019-06-13 10:19
PR 14140mergedmiss-islington,2019-06-17 07:17
PR 14141mergedmiss-islington,2019-06-17 07:17
Messages (8)
msg345494 -(view)Author: Zackery Spytz (ZackerySpytz)*(Python triager)Date: 2019-06-13 10:12
InPR 13739, Eryk Sun mentioned that the Windows implementation of os.dup() returns an inheritable fd when handling a character file. A comment in _Py_dup() makes it seem as though this is due to a belief that handles for character files cannot be made non-inheritable (which is wrong).
msg345513 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-06-13 12:44
If you care of inherited handles on Windows, please have a look at:*https://github.com/python/cpython/pull/7827 fromhttps://bugs.python.org/issue18174*https://github.com/python/cpython/pull/7966 fromhttps://bugs.python.org/issue33966ref:https://pythondev.readthedocs.io/unstable_tests.html#windows-handlesI decided to give up because of multiprocessing race conditions. I failed to fix them.
msg345799 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-06-17 07:17
New changeset28fca0c422b425a6be43be31add0a5328c16b0b8 by Victor Stinner (Zackery Spytz) in branch 'master':bpo-37267: Do not check for FILE_TYPE_CHAR in os.dup() on Windows (GH-14051)https://github.com/python/cpython/commit/28fca0c422b425a6be43be31add0a5328c16b0b8
msg345800 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-06-17 07:21
According to the discussion inPR 14051: if os.dup() fails to make the new file descriptor new inheritable for a character device, the error must not be ignored. Instead, the caller is supposed to use os.dup(fd, inheritable=False).Before *this bugfix*, os.dup() didn't respect its contract: fd2 was inheritable sometimes. Now the caller is aware of such special case and so can handle it properly.
msg345824 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-06-17 08:45
New changeset71589491ad0da27f57789b97354f6094a91e2eb3 by Victor Stinner (Miss Islington (bot)) in branch '3.7':bpo-37267: Do not check for FILE_TYPE_CHAR in os.dup() on Windows (GH-14051) (GH-14141)https://github.com/python/cpython/commit/71589491ad0da27f57789b97354f6094a91e2eb3
msg345825 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-06-17 08:45
New changeset693945d45dfe50c843970cab3e3aa1fa3a3eddbe by Victor Stinner (Miss Islington (bot)) in branch '3.8':bpo-37267: Do not check for FILE_TYPE_CHAR in os.dup() on Windows (GH-14051) (GH-14140)https://github.com/python/cpython/commit/693945d45dfe50c843970cab3e3aa1fa3a3eddbe
msg345827 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-06-17 08:49
Thanks Zackery Spytz as usual!
msg347633 -(view)Author: Josh Rosenberg (josh.r)*(Python triager)Date: 2019-07-10 18:43
This may have caused a regression, see#37549.
History
DateUserActionArgs
2022-04-11 14:59:16adminsetgithub: 81448
2019-07-10 18:43:06josh.rsetnosy: +josh.r
messages: +msg347633
2019-06-17 08:49:27vstinnersetstatus: open -> closed
resolution: fixed
messages: +msg345827

stage: patch review -> resolved
2019-06-17 08:45:29vstinnersetmessages: +msg345825
2019-06-17 08:45:07vstinnersetmessages: +msg345824
2019-06-17 07:21:01vstinnersetmessages: +msg345800
2019-06-17 07:17:44miss-islingtonsetpull_requests: +pull_request13982
2019-06-17 07:17:38miss-islingtonsetpull_requests: +pull_request13981
2019-06-17 07:17:18vstinnersetmessages: +msg345799
2019-06-13 12:44:38vstinnersetnosy: +vstinner
messages: +msg345513
2019-06-13 10:19:15ZackerySpytzsetkeywords: +patch
stage: patch review
pull_requests: +pull_request13913
2019-06-13 10:12:30ZackerySpytzcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp