[18.0][FIX] cetmix_tower_server: drop re.template, removed in Python 3.13 #492
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 319 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #492"
general
weight: 0.35
ivs-cetmix
Problem
cx_tower_variable.pyandcx_tower_command.pyboth wrap theremodule forsafe_evaland whitelistre.template. That function was deprecated in Python 3.11 and removed in 3.13, so on 3.13+ neither module can be imported:The failure is at import time, so
-i cetmix_toweraborts part-way through loading the module graph and leaves the database half-initialised. There is no partial degradation — the module simply cannot install.Reproduce
Install
cetmix_toweron Odoo 18.0 running on Python 3.13 or newer. Encountered on Ubuntu 26.04 / Python 3.14 while setting up a control plane.This affects any host on Python 3.13+ — Ubuntu 25.10 onward, Debian trixie onward — so it becomes more common over time, not less.
Fix
Remove
"template"from bothwrap_module()whitelists. Two lines.re.templatewas undocumented and deprecated for two releases, so this takes away nothing anyone can be relying on: on 3.13+ it cannot be called at all, and Odoo's ownsafe_evaldoes not expose it either.If you would rather keep it available on older interpreters, the alternative is to build the list conditionally:
Happy to switch to that if you prefer it.
Scope
I checked every
wrap_module()call in the repo against Python 3.14, resolving each wrapped module and asserting each whitelisted attribute exists.re.templatein these two files is the only one affected —requests,json,hashlib,hmac,urllib.parse,tldextractand thedns.wrappers all resolve cleanly.No version bump included, since the post-merge bot appears to handle that.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Bug Fixes
Improved compatibility with newer Python versions by handling the unavailable
re.templatefeature safely.Preserved supported regular-expression functionality, including
re.templatewhere available.* Fixed command evaluation and variable validation imports that could fail on Python versions without
re.template.<!-- end of auto-generated comment: release notes by coderabbit.ai -->