classification
Title: os.getenv('PATH') return different result between 2.5 and 3.0rc3
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.0
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, clive, loewis, r.david.murray
Priority: normal Keywords:

Created on 2008-11-24 02:21 by clive, last changed 2010-12-14 18:45 by r.david.murray. This issue is now closed.

Files
File name Uploaded Description Edit
path_result.txt clive, 2008-11-24 02:20
unnamed clive, 2008-11-25 05:06
unnamed clive, 2008-11-25 10:14
unnamed clive, 2008-11-26 01:47
Messages (8)
msg76294 - (view) Author: 赵现刚 (clive) Date: 2008-11-24 02:20
I am using windows xp(sp3),chinese simplified.I found that in os 
module,os.getenv('PATH') return different result between python 2.5 and 
3.0rc3.py2.5's result is the same as the path command's result.

path command's result:
PATH=C:\Tcl\bin;C:\oracle\product\10.2.0\db_1
\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program 
Files\Borland\Delphi7\Bin;C:\Program Files\Borland\Delphi7
\Projects\Bpl\;C:\Program Files\Java\jdk1.7.0\bin;C:\Python25
\;C:\Python30\;...
py2.5's result:
C:\Tcl\bin;C:\oracle\product\10.2.0\db_1
\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program 
Files\Borland\Delphi7\Bin;C:\Program Files\Borland\Delphi7
\Projects\Bpl\;C:\Program Files\Java\jdk1.7.0\bin;C:\Python25
\;C:\Python30\;...
py3.0rc3's result:
C:\Python25\;C:\Tcl\bin;C:\oracle\product\10.2.0\db_1
\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program 
Files\Borland\Delphi7\Bin;C:\Program Files\Borland\Delphi7
\Projects\Bpl\;C:\Program Files\Java\jdk1.7.0\bin;C:\Python25
\;C:\Python30\;...

you can see that python3.0 gets extra element "C:\Python25\",which is 
first. Is it a bug or something? thanks.
msg76310 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-11-24 09:00
I cannot reproduce this. Python does not modify the environment variables.
How did you exactly start the python interpreters, 2.5 and 3.0?
msg76399 - (view) Author: 赵现刚 (clive) Date: 2008-11-25 05:06
I have installed both py2.5 and py3.0rc3. I got the result as follows:

1.py3.0  : from the windows start menu-->run, type in "python" ,and py3.0 will startup(which I don't understand why),then execute 

import ossys_path=os.getenv('PATH')print(sys_path)
will get the result.

2.py2.5: First start the windows programme "cmd", and then type in "python", and py2.5 will startup,then  also execute the code 
import ossys_path=os.getenv('PATH')print(sys_path)
will get the result.

Thanks!> Subject: [issue4402] os.getenv('PATH') return different result between 2.5 and 3.0rc3> To: zhaolu8@hotmail.com> From: report@bugs.python.org> Date: Mon, 24 Nov 2008 09:00:33 +0000> > > Amaury Forgeot d'Arc <amauryfa@gmail.com> added the comment:> > I cannot reproduce this. Python does not modify the environment variables.> How did you exactly start the python interpreters, 2.5 and 3.0?> > ----------> nosy: +amaury.forgeotdarc> > _______________________________________> Python tracker <report@bugs.python.org>> <http://bugs.python.org/issue4402>> _______________________________________
_________________________________________________________________
MSN资讯快递,帮助你第一时间了解最新资讯!
http://im.live.cn/newsexpress
msg76402 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-11-25 08:24
Can you please check with the "regedit" application whether you have an
entry for the key:

"HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Windows\CURRENTVERSION\App
Paths\python.exe"

(this key is used when you type "python" in the "Run" dialog box)

What is its "(Default)" value?
Is there an additional entry named "PATH"?

(I presume that (Default)=C:\Python30\Python.exe, and PATH=C:\Python25\)
msg76403 - (view) Author: 赵现刚 (clive) Date: 2008-11-25 10:14
YES! It is exactly what you assumed. 
 The default value is "C:\Python30\Python.exe", and  there is also another entry "path",its value is "C:\Python25\".

Does that mean I should not start python from the "Run" dialog box? 

非常感谢您的回复!> Subject: [issue4402] os.getenv('PATH') return different result between 2.5 and 3.0rc3> To: zhaolu8@hotmail.com> From: report@bugs.python.org> Date: Tue, 25 Nov 2008 08:24:21 +0000> > > Amaury Forgeot d'Arc <amauryfa@gmail.com> added the comment:> > Can you please check with the "regedit" application whether you have an> entry for the key:> > "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Windows\CURRENTVERSION\App> Paths\python.exe"> > (this key is used when you type "python" in the "Run" dialog box)> > What is its "(Default)" value?> Is there an additional entry named "PATH"?> > (I presume that (Default)=C:\Python30\Python.exe, and PATH=C:\Python25\)> > _______________________________________> Python tracker <report@bugs.python.org>> <http://bugs.python.org/issue4402>> _______________________________________
_________________________________________________________________
MSN资讯快递,帮助你第一时间了解最新资讯!
http://im.live.cn/newsexpress
msg76427 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-11-25 20:59
> Does that mean I should not start python from the "Run" dialog box? 
Not at all. Just remove the "PATH" entry and the inconsistency will 
disappear.

I just wonder how to explain the presence of this additional variable.

Which distribution of python did you install, the "official" one from 
www.python.org, or another one, from ActiveState for example?
msg76457 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-11-26 10:41
(Clive's message was entirely in the HTML "unnamed" attachement)

Clive said:
> My python2.5 is from ActiveState, and python3.0 is the official.

Great.

But -- didn't you get the same behavior *before* installing python 3.0?
when python2.5 started from the "run" dialog box, didn't it get the same
addition to the PATH environment variable?

Martin: Could the msi installer remove the key named
"HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Windows\CURRENTVERSION\App
Paths\python.exe\Path"
when it is present? Or is this just a "Won't fix" issue?
msg123969 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-14 18:45
Looks like it is "won't fix", since it hasn't been.  It doesn't seem as though it is our responsibility to clean up crud in the windows registry introduced by other distributions.
History
Date User Action Args
2010-12-14 18:45:51r.david.murraysetstatus: open -> closed

type: behavior
assignee: loewis ->

nosy: + r.david.murray
messages: + msg123969
resolution: wont fix
stage: resolved
2010-10-25 17:56:39georg.brandlsetmessages: - msg76444
2008-11-26 10:41:03amaury.forgeotdarcsetassignee: loewis
messages: + msg76457
nosy: + loewis
2008-11-26 01:47:44clivesetfiles: + unnamed
messages: + msg76444
2008-11-25 20:59:14amaury.forgeotdarcsetmessages: + msg76427
2008-11-25 10:14:16clivesetfiles: + unnamed
messages: + msg76403
2008-11-25 08:24:20amaury.forgeotdarcsetmessages: + msg76402
2008-11-25 05:06:56clivesetfiles: + unnamed
messages: + msg76399
2008-11-24 09:00:32amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg76310
2008-11-24 02:21:00clivecreate