plone / Installers-UnifiedInstaller

Linux/BSD/OSX Installer
28 stars 24 forks source link

--with-python=/usr/bin/python3 encounters python2 modules #122

Closed ktry closed 2 years ago

ktry commented 2 years ago

Is it common for the unified installer to encounter python2 code as reported below when using Python 3.6.15?

Plone-5.2.7-UnifiedInstaller-1.0 # ./install.sh --with-python=/usr/bin/python3 --password=****** --instance=Wiki --daemon-user=plone --owner=plone --group=plone standalone
<snip/>

Compiling Python files.
  File "/opt/plone/buildout-cache/eggs/cp36m/plone.staticresources-1.4.4-py3.6.egg/plone/staticresources/static/components/jqtree/_entries/insert.py", line 44
    print 'rename %s to %s' % (old_filename, new_filename)
                          ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/cp36m/plone.staticresources-1.4.4-py3.6.egg/plone/staticresources/static/components/jqtree/_entries/renumber.py", line 36
    print 'rename %s to %s' % (old_filename, new_filename)
                          ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/cp36m/zodbpickle-2.0.0-py3.6-linux-x86_64.egg/zodbpickle/pickle_2.py", line 882
    except _Stop, stopinst:
                ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/cp36m/zodbpickle-2.0.0-py3.6-linux-x86_64.egg/zodbpickle/pickletools_2.py", line 1803
    print "skipping %r: it doesn't look like an opcode name" % name
                                                           ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("skipping %r: it doesn't look like an opcode name" % name)?

  File "/opt/plone/buildout-cache/eggs/cp36m/zodbpickle-2.0.0-py3.6-linux-x86_64.egg/zodbpickle/tests/pickletester_2.py", line 433
    x = [0, 1L, 2.0, 3.0+0j]
             ^
SyntaxError: invalid syntax

Compiling locale files.
Buildout completed
<snip/>
ktry commented 2 years ago

And with Python 2.7.18, I get syntax errors on python3 components:

plonesrc/Plone-5.2.7-UnifiedInstaller-1.0 # ./install.sh --with-python=/usr/bin/python --password=****** --instance=Wiki --daemon-user=plone --owner=plone --group=plone standalone
<snip/>
Compiling Python files.
  File "/opt/plone/buildout-cache/eggs/cp27mu/attrs-21.2.0-py2.7.egg/attr/_next_gen.py", line 16
    *,
     ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/cp27mu/zodbpickle-2.0.0-py2.7-linux-x86_64.egg/zodbpickle/pickle_3.py", line 178
    def __init__(self, file, protocol=None, *, fix_imports=True):
                                             ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/cp27mu/zodbpickle-2.0.0-py2.7-linux-x86_64.egg/zodbpickle/pickletools_3.py", line 2049
    print("%5d:" % pos, end=' ', file=out)
                           ^
SyntaxError: invalid syntax

  File "/opt/plone/buildout-cache/eggs/cp27mu/zodbpickle-2.0.0-py2.7-linux-x86_64.egg/zodbpickle/tests/pickletester_3.py", line 142
    class use_metaclass(object, metaclass=metaclass):
                                         ^
SyntaxError: invalid syntax

Compiling locale files.
Buildout completed

<snip/>
mauritsvanrees commented 2 years ago

This would be code that is shipped in a package but is only loaded when starting Plone with a specific Python version.