Modify

Opened 2 years ago

Closed 12 months ago

#14153 closed defect (fixed)

Unable to use ASCIIMath macro in Trac 1.5 / Python 3

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

Description

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/ASCIIMath.py:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/Trac-1.5.4.dev0-py3.10.egg/trac/loader.py", line 105, in _load_py_files
    imp.load_source(plugin_name, plugin_file)
  File "/usr/lib64/python3.10/imp.py", 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/ASCIIMath.py", line 342, in <module>
    Symbol(input="alpha",  el=El("mi", u"\u03B1"))
  File "/vol1/trac/systems/plugins/ASCIIMath.py", 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@… 2 years ago.
Diffs to use ASCIIMath with Python 3.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 2 years ago by Jeffrey Armstrong

Owner: Jeffrey Armstrong deleted
Status: newassigned

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

comment:2 Changed 2 years ago by Ryan J Ollos

Status: assignednew

Changed 2 years ago by roger.oberholtzer@…

Attachment: py3.diff added

Diffs to use ASCIIMath with Python 3.

comment:3 Changed 2 years 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 2 years ago by anonymous

Keywords: patch added

comment:5 Changed 12 months ago by Jun Omae

Owner: set to Jun Omae
Resolution: fixed
Status: newclosed

In 18583:

AsciiMathMacro: make compatible with Python 3 (closes #14153)

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.