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 sjmachin
Recipients sjmachin
Date 2008-12-24.22:39:24
SpamBayes Score 2.399701e-07
Marked as misclassified No
Message-id <1230158367.11.0.521550154703.issue4742@psf.upfronthosting.co.za>
In-reply-to
Content
File foo3.py is [cut down (orig 87Kb)] output of 2to3 conversion tool
and (coincidentally) is still valid 2.x syntax. There are no syntax
errors reported by any of the following:
   \python26\python -c "import foo3"
   \python26\python foo3.py
   \python26\python setup.py install
   \python30\python -c "import foo3"
   \python30\python foo3.py
However 3.0 install
   \python30\python setup.py install
produces:
"""
[snip]
running install_lib
copying build\lib\foo3.py -> C:\python30\Lib\site-packages
byte-compiling C:\python30\Lib\site-packages\foo3.py to foo3.pyc
  File "C:\python30\Lib\site-packages\foo3.py", line 0
### Note also "line 0" above ###
SyntaxError: unknown encoding: cp1252
"""
Same happens if alternative name windows-1252 is used instead of cp1252.

NOTE: file foo3.py actually does have some non-ASCII characters (\xa0,
\x93, \x94), in comments. Another file (bar3.py) from the same package
contains \xb7 twice, but doesn't have the unknown encoding problem.
There are several other files in the same package that start with "# -*-
coding: windows-1252 -*-" (or cp1252, or even cp1251(!)) but have no
non-ASCII characters in them. They don't get this incorrect error
message either.
History
Date User Action Args
2008-12-24 22:39:27sjmachinsetrecipients: + sjmachin
2008-12-24 22:39:27sjmachinsetmessageid: <1230158367.11.0.521550154703.issue4742@psf.upfronthosting.co.za>
2008-12-24 22:39:26sjmachinlinkissue4742 messages
2008-12-24 22:39:24sjmachincreate