R. David Murray added the comment:
This is a duplicate of issue 6070, and has been fixed.
--
nosy: +r.david.murray
priority: -> normal
resolution: -> out of date
stage: -> committed/rejected
status: open -> closed
superseder: -> Python 2.6 makes .pyc/.pyo bytecode files executable
Skip Montanaro added the comment:
Steven> $ echo pass > test.py
Steven> $ chmod u+x test.py
Steven> $ python2.6 -c "import test"
Steven> $ ls -l test.pyc
Steven> -rwxrw-r-- 1 steve steve 94 2009-09-29 16:54 test.pyc
Steven> $ ./test.pyc
Steven> : command not found
And
New submission from Steven D'Aprano :
In Python 2.6, .pyc files inherit the executable bit from their .py
file. This can lead to strangeness:
$ echo pass > test.py
$ chmod u+x test.py
$ python2.6 -c "import test"
$ ls -l test.pyc
-rwxrw-r-- 1 steve steve 94 2009-09-29 16:54 test.pyc
$ ./test.py