[Python-Dev] 3.2.1 encoding surprise

Glenn Linderman v+python at g.nevcal.com
Tue Jul 19 00:06:30 CEST 2011


On 7/18/2011 2:13 PM, Vinay Sajip wrote:
>>      The reason I thought it did nothing, is that I checked assoc  (
>>      =Python.File ) and ftype ( =c:\python32\python.exe "%1" %* ) both of
>>      which look familiar, and neither of which mention   py.exe  which is
>>      what I think the launcher is supposed to have been named; and
>>      running  c:\python32\python.exe from the command line produces a
>>      Python that looks like 3.2.1 .
>>      But somehow, running    t32enc.py  from the command line fails, and
>>      loads 2.6.4 !
>>      From what I've read about the launcher, I thought it was supposed to
>>      take over the assoc and ftype and point Python.File to 
>>      c:\windows\system32\py.exe  -- but that hasn't happened (and yes,
>>      I've rebooted since doing the installs, so it is not just a leftover
>>      CMD that didn't pick up new values).
>>      So my question now is: how does the launcher really get activated
>>      when invoking .py files from the command line, if the assoc and
>>      ftype indicate that it should run c:\python32\python.exe (which when
>>      I run by hand, seems to be what the name claims it to be)?
>>      We don't need to create mysteries!
>>      Glenn
> The launcher's activation is done by the shell you're using, which does the
> lookups in the registry.
>
> Remember that there are two sets of locations - HKCU and HKLM - where the type
> associations are potentially held. Please do a registry search (with
> Administrator rights so you can search the whole registry) for "py.exe" or
> "pyw.exe" and see if they show up anywhere at all. The launcher code tries to
> add these keys in HKEY_CLASSES_ROOT, but I believe Windows can map this to HKCU
> rather than HKLM if you don't have administrator access, at least on XP.

Thanks for the response, Vinay... you are the one that would know, now 
that I've figured out it is a launcher issue rather than a Python issue.

Here is a list of py.exe references in my registry:

HCR\Python.CompiledFile
HCR\Python.File
HCR\Python.NoConFile
HCU\Software\Classes\Python.CompiledFile
HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.py\OpenWithListk
HLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21.....\Componer
HLM\SOFTWARE\Wow6432Note\Microsoft\Windows\CurrentVersion\SharedDLLs
HKU\S-1-5-21-.....\Software\Classes\Python.CompiledFile (and similar 
corresponding to the above HCR ones)

My (perhaps dated) understanding of the CMD commands attrib and ftype is 
that they reflect the contents of HCR.  But here HCR\Python.File is 
different than the value displayed by the CMD ftype Python.File.  Why?  
What am I missing?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110718/8c084fa4/attachment-0001.html>


More information about the Python-Dev mailing list