New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows install error when choosing to compile .py files #50965
Comments
There seem to be 3 problems in Python 3.1.1rc1 Windows installer package.
First, I tried to install Python 3.1.1rc1 just by double-clicking the Operating System version: Windows XP Professional SP3 (Japanese version) Then the following dialog message appeared during installation. There is a problem with this Windows Installer package. A program run as Despite the message, installation of Python interpreter seemed completed msiexec /i python-3.1.1rc1.msi /L*v python-3.1.1rc1.log Installation failed again, and the following is the part of the log file MSI (s) (18:50) [15:08:25:096]: Note: 1: 1722 2: CompilePyc 3: Also, installation completes normally if I choose not to compile .py ------ Because installation fails if I choose to compile .py files during After finishing installation without compiling .py files, I did the C:\Python31\python.exe "C:\Python31\Lib\compileall.py" -f -x And I got the following error message. This means, in English, So I thought the command would be interpreted correctly if I embrace the bad_coding|badsyntax|site-packages|py2_ So I did the following from command prompt. C:\Python31\python.exe "C:\Python31\Lib\compileall.py" -f -x And the compilation seemed to proceed. However, the log file above (python-3.1.1rc1.log) says the argument is ------ Compiling .py files seems to proceed by double-quoting the argument Listing C:\Python31\Lib\lib2to3\tests\data ... Compiling C:\Python31\Lib\lib2to3\tests\data\different_encoding.py ...
*** Traceback (most recent call last):
File "C:\Python31\Lib\py_compile.py", line 142, in compile
codeobject = builtins.compile(codestring, dfile or file,'exec')
File "C:\Python31\Lib\lib2to3\tests\data\different_encoding.py", line 3
print
u'\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde'
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python31\Lib\compileall.py", line 72, in compile_dir
ok = py_compile.compile(fullname, None, dfile, True)
File "C:\Python31\Lib\py_compile.py", line 146, in compile
raise py_exc
py_compile.PyCompileError: File
"C:\Python31\Lib\lib2to3\tests\data\different_encoding.py", line 3
print
u'\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde'
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python31\Lib\compileall.py", line 170, in <module>
exit_status = int(not main())
File "C:\Python31\Lib\compileall.py", line 160, in main
force, rx, quiet):
File "C:\Python31\Lib\compileall.py", line 97, in compile_dir
quiet):
File "C:\Python31\Lib\compileall.py", line 97, in compile_dir
quiet):
File "C:\Python31\Lib\compileall.py", line 97, in compile_dir
quiet):
File "C:\Python31\Lib\compileall.py", line 80, in compile_dir
print(err.msg)
UnicodeEncodeError: 'cp932' codec can't encode character '\xdf' in
position 86: illegal multibyte sequence 'cp932' is the default code page of Japanese version of Windows. chcp 850 By doing so, the UnicodeEncodeError seemed to be avoided as expected. ------ After changing the code page to 850, the UnicodeEncodeError doesn't seem Compiling C:\Python31\Lib\lib2to3\tests\data\crlf.py ... Compiling C:\Python31\Lib\lib2to3\tests\data\different_encoding.py ... I don't know about how these script files (crlf.py and |
The same problems I reported persist in python-3.1.1.msi, too. |
I just saw this today while installing the 3.1.1 final MSI on a Server 2003 box. |
Please don't report multiple issues in a single bug report; when people follow up claiming they saw "this", it's then not clear what exactly they saw. I have now fixed problem 1 in r78976, and put an installer incorporating that change on http://www.dcl.hpi.uni-potsdam.de/home/loewis/u/python-2.7.14683.msi Please confirm that this actually fixes the problem. |
Your MSI works for me and fixes problem 1. |
To loewis: I'm sorry for submitting multiple issues in a single bug report. To other members who might follow this issue: Please specify problem numbers when reporting. Thanks. |
Merged last commit to py3k, as r78991. |
Problem 2 is resolved as of r78992 |
Problem 3 is now fixed in r78994. Leaving this report open for backporting the changes to 2.6/3.1 |
Merged as r79248 and r79250. |
r78994 (exclude 2to3 tests from compileall) should be backported to trunk and the 2.6 branch, but I don't see them (yet). |
Gabriel: can you explain why that should be backported? |
Sorry for being so terse and not filling in the gaps! In the end, I changed my mind on this bug - it's not an installer issue. The 2.6.5 MSI installer, when asked to compile .pyc files, exits with an error as reported here: Both Problem#1 and Problem#3 (as reported in this issue) apply to the 2.6.5 installer. Properly quoting the -x argument fixed Problem#1 (already done). But Problem#3 still applies: compileall fails on one test case in lib2to3 because of a syntax error (this was not so clearly stated in the c.l.p. post). The error is: SyntaxError: ('invalid syntax', ('d:\\apps\\python26\\Lib\\lib2to3\\tests\\data\\py2_test_grammar.py', 936, 23, ' with manager(), manager():\n')) That syntax is not 2.6 compatible (but 2.7 does allow it). My initial idea was to completely exclude lib2to3\tests from being precompiled, as done in r78994 for py3k, and both for 2.6 and 2.7. But after looking more closely to the error (and noticing that it is legal in 2.7) I'd leave the installer as it is, and report the issue in py2_test_grammar.py as a separate bug. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: