Modify

Opened 11 months ago

Closed 11 months ago

Last modified 10 months ago

#14253 closed defect (fixed)

Python 3 says AttributeError: 'dict' object has no attribute 'iteritems'

Reported by: clemens Owned by: Jun Omae
Priority: normal Component: TracBackLinkPlugin
Severity: normal Keywords:
Cc: clemens Trac Release:

Description

Running the TracBackLinkPlugin (revision r17971) on TRAC 1.6 with Python 3 makes problems.

The first problem appears when running SYNC on the command line:

trac-admin <my-repo> backlink sync
Gathered 372 links from 60 wiki objects
Gathered 2 links from 2 ticket objects
Gathered 0 links from 4 milestone objects
Gathered 0 links from 0 changeset objects
AttributeError: 'dict' object has no attribute 'iteritems'

The above error is a blocker because one cannot use the plug-in without SYNC.

I am not a Python expert, but looks like the iteritems() method is not supported for Python 3 anymore. See here.

I was able to work-around the problem by replacing iteritems() with items() in source:/tracbacklinkplugin/1.0/tracbacklink/admin.py#L71 However, this is not a full solution, I found the iteritems method in several files:

  • admin.py
  • api.py
  • web.py

We have been using the great TracBackLinkPlugin since many years. Please help to get it running also with TRAC 1.6 and Python 3.

Attachments (0)

Change History (5)

comment:1 Changed 11 months ago by anonymous

Are you using the latest version? Also, please post stacktrace of the error from your trac.log.

comment:2 Changed 11 months ago by Jun Omae

Resolution: fixed
Status: newclosed

In 18598:

TracBackLinkPlugin/1.0.14: fix backlink sync command with Python 3 (closes #14253)

comment:3 Changed 11 months ago by Jun Omae

Severity: blockernormal

comment:4 Changed 10 months ago by clemens

Cc: clemens added

comment:5 Changed 10 months ago by clemens

Great! I tested the new version 1.0.14 (r18598) of TracBackLinkPlugin with TRAC 1.6. It works fine.

Thanks Jun.

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.