-
Notifications
You must be signed in to change notification settings - Fork 99
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
Upgrade to Chameleon 4.6.0. #1252
base: master
Are you sure you want to change the base?
Conversation
According to https://chameleon.readthedocs.io/en/latest/configuration.html either |
I am working in a sandbox with The errors are all the same it seems. There are supposedly indentation errors towards the top of the file where the import statements are. But when I look at the compiled source they look fine, see example below. The only oddity I can see is that every one of the supposedly faulty source files has a whole bunch of identical Example error:
The top of the mentioned file # -*- coding: utf-8 -*-
# template: <string>
#
__filename = '<string>'
__tokens = {31: ('modules/ZTUtils', 2, 24), 48: (' python:ztu.Batch(range(10), 5', 2, 41), 103: ('b', 3, 21), 146: ('n', 4, 39), 188: ('b/next', 6, 21), 236: ('n', 7, 39)}
from chameleon.tales import DEFAULT_MARKER as _DEFAULT_MARKER
from chameleon.tales import DEFAULT_MARKER as _DEFAULT_MARKER
from chameleon.tales import DEFAULT_MARKER as _DEFAULT_MARKER
from chameleon.tales import DEFAULT_MARKER as _DEFAULT_MARKER
from sys import exc_info as _exc_info
from Products.PageTemplates.engine import _compile_zt_expr as __compile_zt_expr
from Products.PageTemplates.engine import _C2ZContextWrapper as __C2ZContextWrapper
_static_4589148944 = {}
... Partial diff comparing Python output between Chameleon 4.4.4 and 4.6.0 (diff between 4.4.4 and 4.5.0 as the first failing version is similar): --- chameleon444/38eaa4e4a325ebb3b85247942ea63989.py 2025-02-21 09:04:11
+++ chameleon460/167832ff5f17ce388c229d45458f835d.py 2025-02-21 09:03:36
@@ -4,15 +4,31 @@
__filename = '<string>'
__tokens = {31: ('modules/ZTUtils', 2, 24), 48: (' python:ztu.Batch(range(10), 5', 2, 41), 103: ('b', 3, 21), 146: ('n', 4, 39), 188: ('b/next', 6, 21), 236: ('n', 7, 39)}
-
-from Products.PageTemplates.expression import BoboAwareZopeTraverse as _BoboAwareZopeTraverse
-from sys import exc_info as _exc_info
from chameleon.tales import DEFAULT_MARKER as _DEFAULT_MARKER
-from AccessControl.cAccessControl import guarded_getattr as _guarded_getattr
-
-_static_4432424208 = _BoboAwareZopeTraverse()
-_static_4419559312 = {}
-
+from chameleon.tales import DEFAULT_MARKER as _DEFAULT_MARKER
+from chameleon.tales import DEFAULT_MARKER as _DEFAULT_MARKER
+from chameleon.tales import DEFAULT_MARKER as _DEFAULT_MARKER
+from sys import exc_info as _exc_info
+from Products.PageTemplates.engine import _compile_zt_expr as __compile_zt_expr
+from Products.PageTemplates.engine import _C2ZContextWrapper as __C2ZContextWrapper
+_static_4416692816 = {} |
One more data point: When I unset
|
Another data point about the "new" traceback: Under Chameleon 4.6.0 the expression Under Chameleon 4.4.4 this expression looks like I don't know why that expression is so different between Chameleon 4.4.4 and Chameleon 4.(5|6).0. |
We should use latest Chameleon (only possible on Python 3.9+) to avoid deprecation warnings for some changes in the
ast
module. In Python 3.14 these will become errors.See chameleon PR.
Zope itself also uses some deprecated
ast
code inProducts.PageTemplates
. Andz3c.pt
does it as well. Maybe it needs to be fixed there first:At any rate the Zope tests currently fail with latest Chameleon:
I did not yet manage to get that generated python file and see what the source code is.