docker-odoo-project icon indicating copy to clipboard operation
docker-odoo-project copied to clipboard

lxml dep issue w/ `ghcr.io/camptocamp/docker-odoo-project:16.0-4.5.11`

Open fsismondi opened this issue 5 months ago • 3 comments

🔨🔨 Install official/OCA modules 🔨🔨
/usr/local/bin/odoo:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').require('odoo==16.0')
/odoo/src/odoo/tools/appdirs.py:77: SyntaxWarning: invalid escape sequence '\*'
  """Return full path to the user-shared data dir for this application.
/odoo/src/odoo/tools/appdirs.py:188: SyntaxWarning: invalid escape sequence '\*'
  """Return full path to the user-shared data dir for this application.
/odoo/src/odoo/tools/mail.py:402: SyntaxWarning: invalid escape sequence '\s'
  html = re.sub('<br\s*/?>', '\n', html)
Traceback (most recent call last):
  File "/usr/local/bin/odoo", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/odoo/src/setup/odoo", line 5, in <module>
    import odoo
  File "/odoo/src/odoo/__init__.py", line 113, in <module>
    from . import modules
  File "/odoo/src/odoo/modules/__init__.py", line 8, in <module>
    from . import db, graph, loading, migration, module, registry, neutralize
  File "/odoo/src/odoo/modules/graph.py", line 10, in <module>
    import odoo.tools as tools
  File "/odoo/src/odoo/tools/__init__.py", line 16, in <module>
    from .mail import *
  File "/odoo/src/odoo/tools/mail.py", line 43, in <module>
    safe_attrs = clean.defs.safe_attrs | frozenset(
                 ^^^^^^^^^^
AttributeError: module 'lxml.html.clean' has no attribute 'defs'

rings a bell?

fsismondi avatar Jul 24 '25 15:07 fsismondi

Hello @fsismondi AFAIR this is linked to an update of the sourcecode. Coming back at you when I have found the culprit.

On which project do you have this issue?

leemannd avatar Jul 25 '25 08:07 leemannd

After lxml 5.2, clean is moved into a separate package and def is not
importable from clean anymore.

https://github.com/odoo/odoo/commit/8494d81e478fd482533b846a49a2451f6b660713

So you should either pin lxml version or either update the sourcecode if you have a python_version>=3.12 https://github.com/odoo/odoo/blob/18.0/requirements.txt#L38

leemannd avatar Jul 25 '25 08:07 leemannd

Thank you @leemannd I will check and be back asap

fsismondi avatar Jul 30 '25 12:07 fsismondi