[New-bugs-announce] [issue18069] Subprocess picks the wrong executable on Windows

berdario report at bugs.python.org
Sun May 26 21:15:42 CEST 2013

New submission from berdario:

To reproduce:
I installed 2 versions of python: python2.7 and python3.3, both in C:\
I then used the distribute-setup and get-pip script on both interpreters

I copied C:\Python33\Scripts\pip.exe to C:\Python33\pip.exe

And I set up the PATH system variable, to have C:\Python27\Scripts;C:\Python33\; at the beginning

When invoking python, it'll pick Python3.3, as expected, and then:

> python
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from shutil import which
>>> import os
>>> os.environ['PATH']
'C:\\Python27\\Scripts;C:\\Python33\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Microsoft Windows Performance Toolkit\\;C:\\Program Files (x86)\\Bazaar;C:\\Program Files\\Mercurial\\;C:\\MinGW\\bin; C:\\Program Files (x86)\\Git\\cmd;C:\\Users\\Dario\\Documents\\WindowsPowerShell\\Modules\\Pscx\\Apps;C:\\Users\\Dario\\Applications\\bin;C:\\Users\\Dario\\Applications\\emacs\\bin'
>>> which('pip')
>>> from subprocess import call
>>> call('pip --version'.split())
Cannot open C:\Python33\pip-script.py

components: Interpreter Core, Windows
messages: 190106
nosy: berdario
priority: normal
severity: normal
status: open
title: Subprocess picks the wrong executable on Windows
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list