
Feb. 27, 2010
4:32 a.m.
On Fri, Feb 26, 2010 at 5:13 PM, Brett Cannon <brett@python.org> wrote:
On Fri, Feb 26, 2010 at 15:35, Glenn Linderman <v+python@g.nevcal.com>
When a .pyc is renamed to .py, Python (3.1 at least) recognizes and uses it... I assume by design, rather than accident, but I don't know the history.
This does not work for me (nor should it):
touch temp.py
python3 -c "import temp"
rm temp.py
mv temp.pyc temp.py
python3 -c "import temp"
Traceback (most recent call last): File "<string>", line 1, in <module> File "temp.py", line 2 SyntaxError: Non-UTF-8 code starting with '\x95' in file temp.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Try "python temp.py" though. -- --Guido van Rossum (python.org/~guido)