#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
comment:3 Changed 11 months ago by
Severity: | blocker → normal |
---|
comment:4 Changed 10 months ago by
Cc: | clemens added |
---|
comment:5 Changed 10 months ago by
Great! I tested the new version 1.0.14 (r18598) of TracBackLinkPlugin with TRAC 1.6. It works fine.
Thanks Jun.
Are you using the latest version? Also, please post stacktrace of the error from your trac.log.