This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jwilk
Recipients jwilk
Date 2013-12-10.11:04:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386673497.85.0.313178291575.issue19941@psf.upfronthosting.co.za>
In-reply-to
Content
If you have a non-ASCII .py file without encoding declaration, then you can't normally import it:

$ python --version
Python 2.7.6

$ python -c 'import test'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "test.py", line 1
SyntaxError: Non-ASCII character '\xc2' in file test.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details


However, "python -m" happily imports such files:

$ python -m test
¡Hello world!
History
Date User Action Args
2013-12-10 11:04:57jwilksetrecipients: + jwilk
2013-12-10 11:04:57jwilksetmessageid: <1386673497.85.0.313178291575.issue19941@psf.upfronthosting.co.za>
2013-12-10 11:04:57jwilklinkissue19941 messages
2013-12-10 11:04:57jwilkcreate