Florian Bruhin added the comment:

Sorry I missed this - I can reproduce this on Windows 8.1, but not on Windows 
7. I hope I'll be able to try another Windows 8.1 machine today.

SYSTEMROOT is definitely set in the original environment:

    >>> os.environ['SYSTEMROOT']
    'C:\\Windows'
    >>> subprocess.call('{} /c set SYSTEMROOT'.format(cmd32), env=os.environ)
    Environment variable SYSTEMROOT not defined
    1
    >>> subprocess.call('{} /c set SYSTEMROOT'.format(cmd32))
    SystemRoot=C:\Windows
    0

It seems only a minimal set of environment variables are set in the spawned 
process:

    >>> subprocess.call('{} /c set'.format(cmd32), env=os.environ)
    COMSPEC=C:\Windows\SysWOW64\cmd.exe
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC
    PROMPT=$P$G

----------
title: subprocess with env=os.environ fails with "fatal python error" when 
calling 32-bit python from 64-bit one on Windows -> subprocess with 
env=os.environ doesn't preserve environment variables when calling a 32bit 
process on Windows 8.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24493>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to