[issue3440] Starting any program as a subprocess fails when subprocess.Popen has env argument

2009-04-09 Thread Paul Morelle

Paul Morelle  added the comment:

Hello, I can reproduce the bug on a Windows XP Professional, SP 3, with
three versions of Python:

Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on
win32
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
(Intel)] on win32
Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit
(Intel)] on win32

I can have this error code with the following code:

===
import struct, subprocess

command = 'C:\\WINDOWS\\NOTEPAD.EXE'
env = {'FOO': 'bar'}
p = subprocess.Popen(command, env=env)

p.wait()

err = struct.unpack('I', struct.pack('i', p.returncode))[0]
print '%x (%d)'%(err, err)
===

The output is "c0150004 (3222601732)" with the three versions

If the `env' variable is set to None before the creation of the Popen
object, then Notepad.exe is launched correctly.

So, it is not only the python interpreter that fails with this call, it
would be the call to CreateProcess in the subprocess module that would
be incorrect…

Any hint?

--
nosy: +madprog
title: Starting Python as a subprocess fails when subprocess.Popen has env 
argument -> Starting any program as a subprocess fails when subprocess.Popen 
has env argument
Added file: http://bugs.python.org/file13663/fail2.py

___
Python tracker 
<http://bugs.python.org/issue3440>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3440] Starting any program as a subprocess fails when subprocess.Popen has env argument

2009-04-09 Thread Paul Morelle

Paul Morelle  added the comment:

I have just figured out that if you initialize env with
os.environ.copy() and then add/modify its components, then the bug
disappears:

env = os.environ.copy()
env['FOO'] = 'BAR'
[…]

But I have no idea (for the moment) of which variable is mandatory or not.

--

___
Python tracker 
<http://bugs.python.org/issue3440>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2016-03-29 Thread Paul Morelle

Changes by Paul Morelle :


--
nosy: +madprog

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