Issue #22 invalid

Command line arguments not being passed to script when using py.exe as the default way to run .py scripts

Bart van Nierop
created an issue

Like the title describes, command line arguments do not appear to be passed to a python script when executed using C:\Windows\py.exe as the default program for .py files.

To illustrate this, I wrote a very simple script. Lets call it foo.py:

  import sys

  print sys.argv
  print sys.executable

Executing this script as

  C:\tmp> foo.py -foo -bar -baz

Results in the output

  ['C:\\tmp\\foo.py']
  C:\Python27\python.exe

Running it as

  C:\tmp> py foo.py -foo -bar -baz

Gets the expected result:

  ['hah.py', '-foo', '-bar', '-baz']
  C:\Python27\python.exe

Changing the default program to C:\Python27\python.exe and running the script as

  C:\tmp> foo.py -foo -bar -baz

Results in the expected output:

  ['C:\\tmp\\hah.py', '-foo', '-bar', '-baz']
  C:\Python27\python.exe

Comments (5)

  1. Bart van Nierop reporter

    I have not been able to reproduce this at work, earlier today. Yet, on my system at home:

    [Edit] I should note that right before this I uninstalled and then installed pylauncher using a freshly downloaded msi.

  2. Vinay Sajip

    It looks as if your registry on your home machine might be hosed. Uninstall the launcher, ensure that there are no registry entries relating to .py or Python.File and similar (deleting them manually if necessary), then reinstall the latest launcher and try again.

    I'd be surprised if it's a real bug, since no one else has reported it and quite a few people use the launcher all the time; someone would surely have noticed.

  3. Log in to comment