Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] base: fix qweb ast validation for python 3.8.4
As of Python 3.8.4, when `ast.Name` is instantiated with either `True`, `False` and `None`, a ValueError is raised [1][2]. Because of that, QWeb views processing will crash. Replacing `ast.Name` with `ast.Constant` is the proper way to instantiate those constants, and is supported since Python 3.6.0. This fix was tested on Python 3.6, 3.7 and 3.8, and is in 14.0 already. It is now considered for backport in 13.0 because: - 13.0 still represented 75% of the new installations as of September 2020, so if left unpatched it will generate a large number of obscure errors and support tickets for our users. - Ubuntu 20.04 has started to deploy Python 3.8.5 via unattended upgrades in October 2020, replacing 3.8.2, and thus triggers the problem [4]. 1: https://docs.python.org/3/whatsnew/changelog.html#id7 2: https://bugs.python.org/issue40870 3: https://packages.ubuntu.com/focal/python3.8 backport of d73b44a using ast.NameConstant (available in python with python/cpython@442f209 and deprecated in python 3.8) because python 3.5 doesn't have ast.Constant. closes odoo#59630 Signed-off-by: Olivier Dony (odo) <[email protected]>
- Loading branch information