Bill Hayes <bhaye...@yahoo.com> added the comment:

I finally found a solution from a page on StackOverflow.
I had to add the two characters  %*
to the end of the Data value for the Windows registry key:
  HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command
So the Data value is now:
   "C:\Python26\python.exe" "%1" %*
just as it appears above including the two sets of double quotes.

I had modified or added six other keys but only the one above solved the 
problem.
I am running Python 2.6 under MS Windows Vista Home Premium 32 bit.
For completeness I tested potential fixes as follows:
I had a program show_args.py which had the two lines:
  import sys
  print 'argv length is ', len(sys.argv)
In order for show_args.py to receive args from the command line invocation 
(before I did the registry fix) I had to explicitly call the python 
interpreter, so ...

Before the fix:
C:\...>python show_args.py aaa bbb ccc
argv length is 4
C:\...>show_args.py aaa bbb ccc
argv length is 1

After the fix:
C:\...>show_args.py aaa bbb ccc
argv length is 4

In hindsight I should have searched the registry for python paths that didn't 
have the ending %*.

Very briefly, for those unfamiliar with Windows' RegEdit:
Click the Start button and enter   regedit    in the Search box and the 
Regedit.exe name will appear in the list above - click it.
Repeatedly do Edit/Find   python.exe   
until you find a python path of the form: ...\python.exe" "%1"
instead of the form ...\python.exe" "%1" %*
In the right pane of Regedit, under Name click the word (Default), it will turn 
blue, then select Edit/Modify...
Simply add a space and the two chars  %* to the end of the entry in the Value 
data box, then click OK.
Changes take effect immediately; you don't have to reboot or re-open your 
prompt window, but if you are using IDLE or another IDE you probably have to 
close and restart it.

----------
versions: +Python 2.6 -Python 3.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7936>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to