Modify

Opened 19 months ago

Closed 14 months ago

Last modified 14 months ago

#14154 closed defect (fixed)

Make compatible with Jinja2 3.1+

Reported by: roger.oberholtzer@… Owned by: Jun Omae
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords: jinja2
Cc: Olemis Lang Trac Release:

Description

When trying to load this plugin in Trac 1.5 / Python 3 (3.10), the trac log reports:

2022-09-08 15:22:38,544 Trac[loader] ERROR: Skipping "TracXMLRPC = tracrpc":
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/Trac-1.5.4.dev0-py3.10.egg/trac/loader.py", line 80, in _load_eggs
    entry.load(require=True)
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2471, in load
    return self.resolve()
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2477, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.10/site-packages/TracXMLRPC-1.2.0.dev0-py3.10.egg/tracrpc/__init__.py", line 16, in <module>
    from tracrpc.web_ui import *
  File "/usr/lib/python3.10/site-packages/TracXMLRPC-1.2.0.dev0-py3.10.egg/tracrpc/web_ui.py", line 45, in <module>
    class RPCWeb(Component):
  File "/usr/lib/python3.10/site-packages/TracXMLRPC-1.2.0.dev0-py3.10.egg/tracrpc/web_ui.py", line 153, in RPCWeb
    _expand_docs_jinja = jinja2.contextfunction(_expand_docs_jinja)
AttributeError: module 'jinja2' has no attribute 'contextfunction'

This with version 18497.

Attachments (0)

Change History (3)

comment:1 Changed 19 months ago by Jun Omae

Keywords: jinja2 added; python3 removed
Summary: Unable to load XmlRpcPlugin in Trac 1.5 / Python 3Make compatible with Jinja2 3.1+

jinja2.contextfunction is replaced by jinja2.pass_context in Jinja2 3.1.0.

See also https://jinja.palletsprojects.com/en/3.1.x/changes/#version-3-1-0

comment:2 Changed 14 months ago by Jun Omae

Resolution: fixed
Status: newclosed

Fixed in [18512].

comment:3 Changed 14 months ago by Jun Omae

Owner: changed from osimons to Jun Omae

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.