Ho-Ho-Ho,
With the EOL of Python 2.7 Plone becomes unusable for Santa. The distro of Santa drops 2.7 because upstream does. Santa does not have the resources to invest in migration to Python 3 soon. Santa has already the important job of delivering presents. Santa’s stuck on Plone legacy. Santa does not mind because 4.3.X is Santa's favorite version. Santa and the Reindeers need to maintain Plone legacy for a long time.
For this Santa investigate the use of Tauthon. Tauthon strive to be the "drop in" replacement for Python 2.7. The Plone installer, virtualenv and pip are not compatible with Tauthon because they hard-coded PY_VERSION
. And there is an AttributeError that even @zopyx never had seen with Plone. Santa noticed that Tauthon is Python 3 made easy. Tauthon does promises and awakens expectations that are appealing, at least to Santa. A summary from Tauthon on Github:
Summary
Tauthon is a backwards-compatible fork of the Python 2.7.17 interpreter with new syntax, builtins, and libraries backed from Python 3.x. Python code and C-extensions targeting Python 2.7 or below are expected to run unmodified on Tauthon and produce the same output.
Santa did a test run with Plone 4.3.19 and thinks that the AttributeError is caused by RestrictedPython being restricted to PY_VERSION <= 2.7.X
. Tauthon is version 2.8
. Santa hopes there is someone with a clue how to fix this issue. Santa thinks it is "a real Plone issue" that Plone is not compatible with Tauthon. Santa also thinks that Tauthon is an opportunity par excellence for Plone. Think of the amazing legacy. Why use Python anyhow? Santa thinks that the print statement in Tauthon does not prove that there is need for Python 3 because with the __future__ module
print can be also a function in Tauthon, and wishes the Plone Community a Merry Christmas and a Happy New Year.
Santa.
AttributeError
Summary
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFPlone.browser.admin, line 223, in __call__
Module Products.CMFPlone.factory, line 97, in addPloneSite
Module Products.GenericSetup.tool, line 388, in runAllImportStepsFromProfile
- __traceback_info__: profile-Products.CMFPlone:plone-content
Module Products.GenericSetup.tool, line 1469, in _runImportStepsFromContext
Module Products.GenericSetup.tool, line 1281, in _doRunImportStep
- __traceback_info__: plone-content
Module Products.CMFPlone.setuphandlers, line 491, in importContent
Module Products.CMFPlone.setuphandlers, line 361, in setupPortalContent
Module Products.PythonScripts.PythonScript, line 78, in manage_addPythonScript
Module Products.PythonScripts.PythonScript, line 123, in __init__
Module Products.PythonScripts.PythonScript, line 293, in _makeFunction
Module Products.PythonScripts.PythonScript, line 245, in _compile
Module Products.PythonScripts.PythonScript, line 239, in _compiler
Module RestrictedPython.RCompile, line 91, in compile_restricted_function
Module RestrictedPython.RCompile, line 74, in compileAndTuplize
Module RestrictedPython.RCompile, line 67, in compile
Module RestrictedPython.RCompile, line 59, in _get_tree
Module RestrictedPython.MutatingWalker, line 74, in walk
Module RestrictedPython.MutatingWalker, line 71, in dispatchNode
Module RestrictedPython.RestrictionMutator, line 364, in visitModule
Module RestrictedPython.MutatingWalker, line 32, in defaultVisitNode
Module RestrictedPython.MutatingWalker, line 57, in dispatchObject
Module RestrictedPython.MutatingWalker, line 71, in dispatchNode
Module RestrictedPython.MutatingWalker, line 32, in defaultVisitNode
Module RestrictedPython.MutatingWalker, line 59, in dispatchObject
Module RestrictedPython.MutatingWalker, line 42, in visitSequence
Module RestrictedPython.MutatingWalker, line 57, in dispatchObject
Module RestrictedPython.MutatingWalker, line 71, in dispatchNode
Module RestrictedPython.RestrictionMutator, line 141, in visitFunction
AttributeError: Function instance has no attribute 'argnames'
2019-12-20 17:50:17 ERROR ZServerPublisher exception caught
Traceback (most recent call last):
File "/usr/home/zope/Plone/buildout-cache/eggs/Zope2-2.13.29-py2.8.egg/ZServer/PubCore/ZServerPublisher.py", line 31, in __init__
response=b)
File "/usr/home/zope/Plone/buildout-cache/eggs/Zope2-2.13.29-py2.8.egg/ZPublisher/Publish.py", line 455, in publish_module
environ, debug, request, response)
File "/usr/home/zope/Plone/buildout-cache/eggs/Zope2-2.13.29-py2.8.egg/ZPublisher/Publish.py", line 276, in publish_module_standard
if request is not None: request.close()
File "/usr/home/zope/Plone/buildout-cache/eggs/Zope2-2.13.29-py2.8.egg/ZPublisher/BaseRequest.py", line 220, in close
notify(EndRequestEvent(None, self))
File "/usr/home/zope/Plone/buildout-cache/eggs/zope.event-3.5.2-py2.8.egg/zope/event/__init__.py", line 31, in notify
subscriber(event)
File "/usr/home/zope/Plone/buildout-cache/eggs/zope.component-3.9.5-py2.8.egg/zope/component/event.py", line 24, in dispatch
zope.component.subscribers(event, None)
File "/usr/home/zope/Plone/buildout-cache/eggs/zope.component-3.9.5-py2.8.egg/zope/component/_api.py", line 136, in subscribers
return sitemanager.subscribers(objects, interface)
File "/usr/home/zope/Plone/buildout-cache/eggs/zope.component-3.9.5-py2.8.egg/zope/component/registry.py", line 321, in subscribers
return self.adapters.subscribers(objects, provided)
AttributeError: adapters
Test run
Summary
$ ./bin/test
Test-module import failures:
Module: RestrictedPython.tests.testRestrictions
Traceback (most recent call last):
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/tests/testRestrictions.py", line 566, in <module>
create_rmodule()
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/tests/testRestrictions.py", line 71, in create_rmodule
code = compile_restricted(source, fn, 'exec')
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/RCompile.py", line 114, in compile_restricted
gen.compile()
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/RCompile.py", line 67, in compile
tree = self._get_tree()
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/RCompile.py", line 59, in _get_tree
MutatingWalker.walk(tree, self.rm)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 74, in walk
return MutatingWalker(visitor).dispatchNode(tree)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 71, in dispatchNode
return meth(node, self)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/RestrictionMutator.py", line 364, in visitModule
node = walker.defaultVisitNode(node)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 32, in defaultVisitNode
v = self.dispatchObject(child)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 57, in dispatchObject
return self.dispatchNode(ob)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 71, in dispatchNode
return meth(node, self)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 32, in defaultVisitNode
v = self.dispatchObject(child)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 59, in dispatchObject
return self.visitSequence(ob)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 42, in visitSequence
v = self.dispatchObject(child)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 57, in dispatchObject
return self.dispatchNode(ob)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 71, in dispatchNode
return meth(node, self)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/RestrictionMutator.py", line 141, in visitFunction
for argname in node.argnames:
AttributeError: Function instance has no attribute 'argnames'
Running zope.testing.testrunner.layer.UnitTests tests:
Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds.
Failure in test /usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/README.txt
Traceback (most recent call last):
File "/usr/local/lib/tauthon2.8/unittest/case.py", line 329, in run
testMethod()
File "/usr/local/lib/tauthon2.8/doctest.py", line 2224, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for README.txt
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/README.txt", line 0
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/README.txt", line 15, in README.txt
Failed example:
code = compile_restricted(src, '<string>', 'exec')
Exception raised:
Traceback (most recent call last):
File "/usr/local/lib/tauthon2.8/doctest.py", line 1315, in __run
compileflags, 1) in test.globs
File "<doctest README.txt[2]>", line 1, in <module>
code = compile_restricted(src, '<string>', 'exec')
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/RCompile.py", line 114, in compile_restricted
gen.compile()
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/RCompile.py", line 67, in compile
tree = self._get_tree()
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/RCompile.py", line 59, in _get_tree
MutatingWalker.walk(tree, self.rm)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 74, in walk
return MutatingWalker(visitor).dispatchNode(tree)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 71, in dispatchNode
return meth(node, self)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/RestrictionMutator.py", line 364, in visitModule
node = walker.defaultVisitNode(node)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 32, in defaultVisitNode
v = self.dispatchObject(child)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 57, in dispatchObject
return self.dispatchNode(ob)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 71, in dispatchNode
return meth(node, self)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 32, in defaultVisitNode
v = self.dispatchObject(child)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 59, in dispatchObject
return self.visitSequence(ob)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 42, in visitSequence
v = self.dispatchObject(child)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 57, in dispatchObject
return self.dispatchNode(ob)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/MutatingWalker.py", line 71, in dispatchNode
return meth(node, self)
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/RestrictionMutator.py", line 141, in visitFunction
for argname in node.argnames:
AttributeError: Function instance has no attribute 'argnames'
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/README.txt", line 19, in README.txt
Failed example:
exec(code)
Exception raised:
Traceback (most recent call last):
File "/usr/local/lib/tauthon2.8/doctest.py", line 1315, in __run
compileflags, 1) in test.globs
File "<doctest README.txt[3]>", line 1, in <module>
exec(code)
NameError: name 'code' is not defined
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/README.txt", line 24, in README.txt
Failed example:
hello_world()
Exception raised:
Traceback (most recent call last):
File "/usr/local/lib/tauthon2.8/doctest.py", line 1315, in __run
compileflags, 1) in test.globs
File "<doctest README.txt[4]>", line 1, in <module>
hello_world()
NameError: name 'hello_world' is not defined
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/README.txt", line 177, in README.txt
Failed example:
exec(code)
Expected:
Traceback (most recent call last):
...
TypeError: attribute-less object (assign or del)
Got nothing
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/README.txt", line 196, in README.txt
Failed example:
fibonacci
Expected:
[1, 1, 2, 3, 5]
Got:
5
File "/usr/home/zope/Plone/buildout-cache/eggs/RestrictedPython-3.6.0-py2.8.egg/RestrictedPython/README.txt", line 198, in README.txt
Failed example:
sorted(transl.keys())
Exception raised:
Traceback (most recent call last):
File "/usr/local/lib/tauthon2.8/doctest.py", line 1315, in __run
compileflags, 1) in test.globs
File "<doctest README.txt[37]>", line 1, in <module>
sorted(transl.keys())
NameError: name 'transl' is not defined
Ran 26 tests with 1 failures and 0 errors in 0.088 seconds.
Tearing down left over layers:
Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.
Test-modules with import problems:
RestrictedPython.tests.testRestrictions