Modify

Opened 8 years ago

Last modified 8 years ago

#12897 accepted defect

AttributeError: '_pygit2.Patch' object has no attribute 'status'

Reported by: mwg@… Owned by: Jun Omae
Priority: normal Component: TracPygit2Plugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

I have set up Trac on Ubuntu 16.04 system, with Git, Python 2.7 and most of its packages installed from Ubuntu repositories, and Trac & Trac hacks/plugins installed by pip from their respective sites. I had problems in browsing repository using 'git' type since it contained a reference to a git submodule/subrepository, which looked like infinitely-nested folder in Trac browser. So I decided to install python-pygit2 from Ubuntu repo. and TracPygit2Plugin by pip, then switched Trac repo. type from 'git' to 'pygit2' (also tried 'cached-pygit2' and 'direct-pygit2'). After this switch I synced the repo. by 'trac-admin' as it requested, and after this change found that I can not view changesets in Trac repo. browser: I get an exception like AttributeError: '_pygit2.Patch' object has no attribute 'status' in file pygit2_fs.py.

Full stack :

Python Traceback

Most recent call last:
File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 554, in _dispatch_request
File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 247, in dispatch
File "/usr/local/lib/python2.7/dist-packages/trac/versioncontrol/web_ui/changeset.py", line 353, in process_request
File "/usr/local/lib/python2.7/dist-packages/trac/versioncontrol/web_ui/changeset.py", line 580, in _render_html
File "/usr/local/lib/python2.7/dist-packages/trac/versioncontrol/web_ui/changeset.py", line 396, in get_changes
File "/usr/local/lib/python2.7/dist-packages/tracext/pygit2/pygit2_fs.py", line 1376, in get_changes
File "/usr/local/lib/python2.7/dist-packages/tracext/pygit2/pygit2_fs.py", line 827, in _get_changes
File "/usr/local/lib/python2.7/dist-packages/tracext/pygit2/pygit2_fs.py", line 827, in <genexpr>
System Information:

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/53.0.2785.143 Chrome/53.0.2785.143 Safari/537.36

Trac	1.0.10
Docutils	0.12
Genshi	0.7 (with speedups)
GIT	2.7.4
mod_wsgi	4.3.0 (WSGIProcessGroup WSGIApplicationGroup s1.platform20k.org|/trac/p20k)
pygit2	0.24.0 (compiled with libgit2 0.24.0)
Pygments	2.1
pysqlite	2.6.0
Python	2.7.12 (default, Jul 1 2016, 15:12:24) [GCC 5.4.0 20160609]
pytz	2014.10
setuptools	20.7.0
SQLite	3.11.0
jQuery	1.7.2
jQuery UI	1.8.21
jQuery Timepicker	1.0.1

Enabled Plugins:

Budgeting-Plugin	0.6.5	/usr/local/lib/python2.7/dist-packages
gantt	0.3dev-r0	/usr/local/lib/python2.7/dist-packages
TicketValidator	0.2dev-r0	/usr/local/lib/python2.7/dist-packages
timingandestimationplugin	1.4.8b0	/usr/local/lib/python2.7/dist-packages
Trac-jsGantt	0.11.post0	/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.11.post0-py2.7.egg
TracAccountManager	0.4.4	/usr/local/lib/python2.7/dist-packages
TracCustomFieldAdmin	0.2.12	/usr/local/lib/python2.7/dist-packages
TracDateField	3.0.0	/usr/local/lib/python2.7/dist-packages/TracDateField-3.0.0-py2.7.egg
TracGanttCalendarPlugin	0.6.4.post0	/usr/local/lib/python2.7/dist-packages/TracGanttCalendarPlugin-0.6.4.post0-py2.7.egg
TracKanbanBoard	0.2	/usr/local/lib/python2.7/dist-packages
TracPygit2Plugin	0.12.0.1	/usr/local/lib/python2.7/dist-packages
TracWysiwyg	0.12.0.5.post0	/usr/local/lib/python2.7/dist-packages/TracWysiwyg-0.12.0.5.post0-py2.7.egg

This is what I get from Trac itself. Please ask if you need more information. Thanks in advance for your help, I would like to be able to make this module useful again.

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by Jun Omae

Status: newaccepted

Fixed the AttributeError in [15911], if pygit2 is v0.22.1+.

However, 4 errors in unit tests are still remaining.

$ /dev/shm/pygit2/bin/python setup.py test
....

======================================================================
ERROR: test_changeset_others (tracext.pygit2.tests.pygit2_fs.NonCachedNormalTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jun66j5/src/tracpygit2plugin/tracext/pygit2/tests/pygit2_fs.py", line 351, in test_changeset_others
    changes.next())
StopIteration

======================================================================
ERROR: test_get_changes_different_revs (tracext.pygit2.tests.pygit2_fs.NonCachedNormalTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jun66j5/src/tracpygit2plugin/tracext/pygit2/tests/pygit2_fs.py", line 686, in test_get_changes_different_revs
    changes.next())
StopIteration

======================================================================
ERROR: test_changeset_others (tracext.pygit2.tests.pygit2_fs.CachedNormalTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jun66j5/src/tracpygit2plugin/tracext/pygit2/tests/pygit2_fs.py", line 351, in test_changeset_others
    changes.next())
StopIteration

======================================================================
ERROR: test_get_changes_different_revs (tracext.pygit2.tests.pygit2_fs.CachedNormalTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jun66j5/src/tracpygit2plugin/tracext/pygit2/tests/pygit2_fs.py", line 686, in test_get_changes_different_revs
    changes.next())
StopIteration

----------------------------------------------------------------------
Ran 124 tests in 2.906s

FAILED (errors=4)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as accepted The owner will remain Jun Omae.

Add Comment


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

 
Note: See TracTickets for help on using tickets.