[New-bugs-announce] [issue6773] subprocess issue on Win 7 x64

Piotr Foltyn report at bugs.python.org
Mon Aug 24 10:36:05 CEST 2009


New submission from Piotr Foltyn <piotr.foltyn at displaylink.com>:

The sample code presented below produces error (screenshot available in 
attachment) on Windows 7 RC x64 with latest version of Python 2.6 
installed. Both 32bit and 64bit versions of Python 2.6 are affected by 
this issue. Python 3 executes this code flawlessly.
The problem seems to be related to stdout redirection. If the "stdout = 
PIPE" is omitted in the first statement of main() function, code 
executes properly but we don't have access to the processes output. If 
the line "Popen(["dir"], stdout = PIPE, shell = True)" is changed to 
"sin, sout = os.popen2(["dir"])" and os module is imported everything 
works fine. It doesn't matter what command is executed ("dir", "bcedit", 
"mspaint" etc)


import sys
from subprocess import Popen, PIPE
from multiprocessing import Process

def myProcess():
    Popen(["dir"], shell = True) # ERROR :(

def main():
    Popen(["dir"], stdout = PIPE, shell = True)
    Process(target = myProcess).start()
    return 0

if __name__ == "__main__":
    sys.exit(main())

----------
components: Library (Lib), Windows
files: Win7RCx64.jpg
messages: 91910
nosy: tesla
severity: normal
status: open
title: subprocess issue on Win 7 x64
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file14777/Win7RCx64.jpg

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6773>
_______________________________________


More information about the New-bugs-announce mailing list