Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #33712 > unrolled thread

Re: windows question: default click action points to wrong python version

Started byTim Golden <mail@timgolden.me.uk>
First post2012-11-21 09:34 +0000
Last post2012-11-21 09:34 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: windows question: default click action points to wrong python version Tim Golden <mail@timgolden.me.uk> - 2012-11-21 09:34 +0000

#33712 — Re: windows question: default click action points to wrong python version

FromTim Golden <mail@timgolden.me.uk>
Date2012-11-21 09:34 +0000
SubjectRe: windows question: default click action points to wrong python version
Message-ID<mailman.134.1353490483.29569.python-list@python.org>
On 21/11/2012 08:23, Gelonida N wrote:
> Hi,
> 
> I installed python 2.6 and python 2.7 on a windows 7 machine.
> 
> At the moment Python 2.7 is the interpreter being used if I 'start' a
> python script without explicit interpreter.
> 
> I always thought, that 'repairing' Python 2.6 (reinstalling it) would
> set the default settings back to Python 2.6.
> 
> I also see with assoc / ftypes, that python 2.6. has now been configured
> as default.
> 
> However when I click on a script it is still started with 2.7.
> (even after a full restart of the machine)
> 
> This is really surprising to me.
> I thought ftype is the command to change file associations.


This area is a bit messy. There is a difference between: going to the
command line and typing "myscript.py"; and double-clicking on a file in
Explorer.

The former uses the result of merging the assoc/ftype registry keys:

   HKEY_CURRENT_USER\Software\Classes\Python.File\shell\open\command

   HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Python.File\shell\open\command


while the latter uses the Explorer registry keys at:


HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.py\UserChoice


Initially, I suppose, the two are in sync. But presumably they can get
out of sync, especially if you move backwards and forwards between
associations. I haven't bothered fishing around in the Shell API but I
presume that you can reconcile the two -- or just edit the registry,
obviously.

TJG

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web