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.

classification
Title: SyntaxError messages during install due to compilation of lib2to3 test files
Type: Stage:
Components: Installation Versions: Python 3.1, Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, ned.deily
Priority: normal Keywords:

Created on 2010-03-18 11:06 by ned.deily, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg101258 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-03-18 11:06
On Python 3.1.2rc1 and py3k, "make install" results in two identical spurious error messages:

Compiling /path/to/lib/python3.1/lib2to3/tests/data/bom.py ...
***   File "/usr/local/lib/python3.1/lib2to3/tests/data/bom.py", line 1
    # coding: utf-8
      ^
SyntaxError: invalid character in identifier

The messages are triggered by the libinstall Makefile which calls compileall twice to generate .pyc and .pyo files for all modules in the installed library.  compileall uses py_compile which, due to the problem documented in Issue8168, stumbles over the lib2to3 data file bom.py.  While fixing that issue would make this problem go away, it seems like it would be better to avoid compiling the lib2to3 test files altogether.  Modifying the '-x" regexp on the two relevant calls to compileall in Makefile.pre.in accomplishes this:

-x 'bad_coding|badsyntax|site-packages|py2_test_grammar|crlf|different_encoding|lib2to3/tests' \

A similar change should be considered for trunk and 2.6 as well.
msg101282 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-03-18 21:21
Hopefully fixed in r79051. Can you try the 3.1 branch?
msg101289 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2010-03-18 22:53
'bad_coding' is still needed in the -x regexp.  BTW, it's easy enough to test by doing something like:
   make install DESTDIR=/tmp/p/
msg101290 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-03-18 23:01
2010/3/18 Ned Deily <report@bugs.python.org>:
>
> Ned Deily <nad@acm.org> added the comment:
>
> 'bad_coding' is still needed in the -x regexp.  BTW, it's easy enough to test by doing something like:
>   make install DESTDIR=/tmp/p/

Ok. :) Refixed in r79076.
History
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52416
2010-03-18 23:01:52benjamin.petersonsetmessages: + msg101290
2010-03-18 22:53:37ned.deilysetmessages: + msg101289
2010-03-18 21:21:23benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg101282
2010-03-18 11:06:06ned.deilycreate