can't pass command-line arguments

Peter Hansen peter at engcorp.com
Mon Apr 10 12:02:21 EDT 2006


BartlebyScrivener wrote:
>>>You missed the other option: if PATHEXT has .pyc in front of .py then you
>>>get exactly the described behaviour.
> 
> That's it!!
> 
> Trust me, I didn't do it. It was either ActiveState, Wing, or Komodo
> Dragon, or some combination thereof.
> 
> So remove .pyc from pathext?

Doing that will prevent a leftover .pyc file in a directory earlier in 
the PATH from overriding a .py file later on in the PATH.  If that was 
the specific problem, definitely remove it.

Duncan, the answer to "why anyone would want to put .pyc into PATHEXT" 
is at least "because that's how it's almost always recommended".  At 
least, I have been using that myself, probably for the same reason Rick 
did, and I can see lots of search results that list it that way.  I'm 
just glad it was he who got caught by this and found the problem, and 
not me. ;-)

I think the only reason one would want .pyc in the PATHEXT is if one 
ever wanted to run .pyc files that didn't have matching .py files, 
without having to specify the extension.  That's certainly not a common 
enough usecase to justify making ".pyc;.py" the recommended or standard 
thing to add to PATHEXT.

-Peter




More information about the Python-list mailing list