Issue #1204 resolved

Syntax errors reported during installation of CherryPy 3.2.3 on Python 3.x

Harry Pehkonen
created an issue

Suspect https://bitbucket.org/cherrypy/cherrypy/commits/0b598870c348118c4881a727f2dce604ce273549

C:\TEMP\CherryPy-3.2.3>which python
C:\Python33\python.EXE

C:\TEMP\CherryPy-3.2.3>python setup.py install
running install
running bdist_egg
[...snip...]
byte-compiling build\bdist.win32\egg\cherrypy\_cpcompat_subprocess.py to _cpcompat_subprocess.cpython-33.pyc
  File "build\bdist.win32\egg\cherrypy\_cpcompat_subprocess.py", line 484
    except (OSError, IOError), e:
                             ^
SyntaxError: invalid syntax
[...snip...]
Extracting CherryPy-3.2.3-py3.3.egg to c:\python33\lib\site-packages
  File "c:\python33\lib\site-packages\CherryPy-3.2.3-py3.3.egg\cherrypy\_cpcompat_subprocess.py", line 484
    except (OSError, IOError), e:
                             ^
SyntaxError: invalid syntax

Comments (5)

  1. Nabil BEN YOUSSEF

    Same errors for me too.

    In the documentation of _cpcompat_subprocess.py :

    This module should remain compatible with Python 2.2, see PEP 291.
    

    This is why this file cannot be compiled with Python3...

    Harry Pehkonen don't worry : this module is not imported when you will execute after CherryPy with Python3 : At the end of the file _cp_compat.py :

    # Use subprocess module from Python 2.7 on Python 2.3-2.6
    if sys.version_info < (2,7):
        import cherrypy._cpcompat_subprocess as subprocess
    else:
        import subprocess
    
  2. Nabil BEN YOUSSEF

    The installation doesn't really fail (as you have written in the title of this issue).

    There are just these two errors, that don't block the installation in your <python_path>\Lib\site-packages\cherrypy

    :-)

  3. Log in to comment