Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue34044

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:subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)
Type:behaviorStage:resolved
Components:Library (Lib)Versions:Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: eryksun, vstinner, xflr6
Priority:normalKeywords:patch

Created on2018-07-04 14:55 byxflr6, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 8090mergedvstinner,2018-07-04 15:16
PR 8120closedmiss-islington,2018-07-05 20:54
PR 8121mergedvstinner,2018-07-05 20:59
Messages (5)
msg321047 -(view)Author: Sebastian Bank (xflr6)Date: 2018-07-04 14:55
AFAIU, the change forhttps://bugs.python.org/issue19764 broke the following usage of subprocess on Windows (re-using a subprocess.STARTUPINFO instance to hide the command window):    import os, subprocess    STARTUPINFO = subprocess.STARTUPINFO()    STARTUPINFO.dwFlags |= subprocess.STARTF_USESHOWWINDOW    STARTUPINFO.wShowWindow = subprocess.SW_HIDE    # raises OSError: [WinError 87]    # in the second loop iteration starting with Python 3.7    for i in range(2):        print(i)        with open(os.devnull, 'w') as stderr:            subprocess.check_call(['attrib'], stderr=stderr,                                  startupinfo=STARTUPINFO)AFAICT, this works on Python 2.7, 3.4, 3.5, and 3.6I think the documentation inhttps://docs.python.org/3/library/subprocess.html#windows-popen-helpersdoes not mention that every Popen call should be done with a fresh instance, so either the documentation needs to be changed, or the implementation (e.g. by deep-copying the instance).See alsohttps://bugs.python.org/issue19764#msg320784
msg321131 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2018-07-05 20:54
New changeset483422f57e5d8c8bf8820fec29fc9b96bb15d4ef by Victor Stinner in branch 'master':bpo-34044: subprocess.Popen copies startupinfo (GH-8090)https://github.com/python/cpython/commit/483422f57e5d8c8bf8820fec29fc9b96bb15d4ef
msg321132 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2018-07-05 21:15
New changeset29be3bd3c9aed0190e60096a603120cacda82375 by Victor Stinner in branch '3.7':bpo-34044: subprocess.Popen copies startupinfo (GH-8090) (GH-8121)https://github.com/python/cpython/commit/29be3bd3c9aed0190e60096a603120cacda82375
msg321133 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2018-07-05 21:20
Sebastian Bank: Thank you for your bug report and your example! I used your example to write an unit test. I fixed the bug in 3.7 and master branches. The fix will be part of the future 3.7.1 release.
msg321138 -(view)Author: Sebastian Bank (xflr6)Date: 2018-07-05 22:27
Perfect, thanks for the quick fix.
History
DateUserActionArgs
2022-04-11 14:59:02adminsetgithub: 78225
2018-07-05 22:27:55xflr6setmessages: +msg321138
2018-07-05 21:20:00vstinnersetstatus: open -> closed
resolution: fixed
messages: +msg321133

stage: patch review -> resolved
2018-07-05 21:15:37vstinnersetmessages: +msg321132
2018-07-05 20:59:20vstinnersetpull_requests: +pull_request7706
2018-07-05 20:54:47miss-islingtonsetpull_requests: +pull_request7705
2018-07-05 20:54:22vstinnersetmessages: +msg321131
2018-07-04 15:17:05vstinnersetversions: + Python 3.8
2018-07-04 15:16:56vstinnersetkeywords: +patch
stage: patch review
pull_requests: +pull_request7691
2018-07-04 14:55:46xflr6create
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp