Opened 7 months ago

Last modified 6 months ago

#14153 new defect

Unable to use ASCIIMath macro in Trac 1.5 / Python 3

Reported by: roger.oberholtzer@… Owned by:
Priority: normal Component: AsciiMathMacro
Severity: normal Keywords: python3 patch
Cc: Trac Release:


When trying to use this macro in Trac 1.5 and Python 3 (3.10), I get this:

2022-09-08 14:45:08,892 Trac[loader] 
ERROR: Failed to load plugin from /vol1/trac/systems/plugins/
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/Trac-1.5.4.dev0-py3.10.egg/trac/", line 105, in _load_py_files
    imp.load_source(plugin_name, plugin_file)
  File "/usr/lib64/python3.10/", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/vol1/trac/systems/plugins/", line 342, in <module>
    Symbol(input="alpha",  el=El("mi", u"\u03B1"))
  File "/vol1/trac/systems/plugins/", line 80, in El
    if isinstance(text, basestring):
NameError: name 'basestring' is not defined

This is with version 18497 of the macro.

Attachments (1)

py3.diff (18.8 KB) - added by roger.oberholtzer@… 6 months ago.
Diffs to use ASCIIMath with Python 3.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 7 months ago by Jeffrey Armstrong

Owner: Jeffrey Armstrong deleted
Status: newassigned

I have no idea why this ticket is attached to me...

comment:2 Changed 7 months ago by Ryan J Ollos

Status: assignednew

Changed 6 months ago by roger.oberholtzer@…

Attachment: py3.diff added

Diffs to use ASCIIMath with Python 3.

comment:3 Changed 6 months ago by anonymous

I have attached my diffs to make this work with Python 3. I don't know if it will work with Python 2 as I no longer have that installed for testing. I think most differences were things that were depreciated a while ago, and were more recently finally removed.

It works for me in a current Trac 1.5

comment:4 Changed 6 months ago by anonymous

Keywords: patch added

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.

Add Comment

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

Note: See TracTickets for help on using tickets.