[issue34044] subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)

2018-07-05 Thread Sebastian Bank


Sebastian Bank  added the comment:

Perfect, thanks for the quick fix.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34044] subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)

2018-07-05 Thread STINNER Victor


STINNER Victor  added the comment:

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.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34044] subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)

2018-07-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 29be3bd3c9aed0190e60096a603120cacda82375 by Victor Stinner in 
branch '3.7':
bpo-34044: subprocess.Popen copies startupinfo (GH-8090) (GH-8121)
https://github.com/python/cpython/commit/29be3bd3c9aed0190e60096a603120cacda82375


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34044] subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)

2018-07-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7706

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34044] subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)

2018-07-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 483422f57e5d8c8bf8820fec29fc9b96bb15d4ef by Victor Stinner in 
branch 'master':
bpo-34044: subprocess.Popen copies startupinfo (GH-8090)
https://github.com/python/cpython/commit/483422f57e5d8c8bf8820fec29fc9b96bb15d4ef


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34044] subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)

2018-07-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7705

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34044] subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)

2018-07-04 Thread STINNER Victor


Change by STINNER Victor :


--
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34044] subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)

2018-07-04 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +7691
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34044] subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)

2018-07-04 Thread Sebastian Bank


New submission from Sebastian Bank :

AFAIU, the change for https://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.6

I think the documentation in

https://docs.python.org/3/library/subprocess.html#windows-popen-helpers

does 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 also https://bugs.python.org/issue19764#msg320784

--
components: Library (Lib)
messages: 321047
nosy: eryksun, vstinner, xflr6
priority: normal
severity: normal
status: open
title: subprocess: reusing STARTUPINFO breaks under 3.7 (Windows)
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com