Issue 4402: os.getenv('PATH') return different result between 2.5 and 3.0rc3 (original) (raw)

Created on 2008-11-24 02:21 by clive, last changed 2022-04-11 14:56 by admin. 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: [] 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: [] 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
2022-04-11 14:56:41 admin set github: 48652
2010-12-14 18:45:51 r.david.murray set status: open -> closedtype: behaviorassignee: loewis -> nosy: + r.david.murraymessages: + resolution: wont fixstage: resolved
2010-10-25 17:56:39 georg.brandl set messages: -
2008-11-26 10:41:03 amaury.forgeotdarc set assignee: loewismessages: + nosy: + loewis
2008-11-26 01:47:44 clive set files: + unnamedmessages: +
2008-11-25 20:59:14 amaury.forgeotdarc set messages: +
2008-11-25 10:14:16 clive set files: + unnamedmessages: +
2008-11-25 08:24:20 amaury.forgeotdarc set messages: +
2008-11-25 05:06:56 clive set files: + unnamedmessages: +
2008-11-24 09:00:32 amaury.forgeotdarc set nosy: + amaury.forgeotdarcmessages: +
2008-11-24 02:21:00 clive create