[Python-Dev] 3.2.1 encoding surprise

Vinay Sajip vinay_sajip at yahoo.co.uk
Mon Jul 18 23:13:27 CEST 2011


>     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.

Regards,

Vinay Sajip



More information about the Python-Dev mailing list