Modify

Opened 12 months ago

Closed 11 months ago

Last modified 11 months ago

#14254 closed defect (fixed)

Python 3 says SyntaxError: multiple exception types must be parenthesized

Reported by: clemens Owned by: Álvaro Iradier
Priority: normal Component: SearchAllPlugin
Severity: blocker Keywords:
Cc: clemens, stei Trac Release: 1.6

Description (last modified by clemens)

Running the SearchAllPlugin (revision r18446) on TRAC 1.6 with Python 3 makes problems.

Basically the plugin is supposed to offer a new check-box "All projects" in the search page.

In the log file we can see the error:

2023-11-19 15:58:08,012 Trac[env] INFO: -------------------------------- environment startup [Trac 1.6] --------------------------------
2023-11-19 15:58:08,190 Trac[loader] ERROR: Skipping "tracsearchall = tracsearchall.searchall": 
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/trac/loader.py", line 80, in _load_eggs
    entry.load(require=True)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2468, in load
    return self.resolve()
           ^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2474, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/tracsearchall/searchall.py", line 120
    except Exception, ex:
           ^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized (searchall.py, line 120)

I am not a Python expert, but source:/searchallplugin/0.11/tracsearchall/searchall.py#L120 contains except Exception, ex: where it should rather be except Exception as ex:. As I learned from here.

Attachments (0)

Change History (7)

comment:1 Changed 12 months ago by clemens

Cc: clemens added

comment:2 Changed 12 months ago by clemens

Trac Release: 1.6

comment:3 Changed 11 months ago by Jun Omae

Resolution: fixed
Status: newclosed

Fixed in [18605].

comment:4 Changed 11 months ago by clemens

I tested the bugfix and can confirm that revision r18605 works with TRAC 1.6.
Thanks

Shall we consider incrementing the version number for SearchAllPlugin from 0.9 to 0.10?

comment:5 Changed 11 months ago by clemens

Description: modified (diff)

comment:6 Changed 11 months ago by stei

Cc: stei added

comment:7 Changed 11 months ago by Jun Omae

In 18610:

TracSearchAll 0.10: bump up the version to 0.10 (refs #14254)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Álvaro Iradier.
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.