Modify

Opened 5 years ago

Closed 4 years ago

Last modified 10 months ago

#13619 closed defect (fixed)

1 failure on Trac 1.4

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

Description

$ ~/venv/trac/1.4/bin/python setup.py test
running test
running egg_info
writing requirements to TracBackLinkPlugin.egg-info/requires.txt
writing TracBackLinkPlugin.egg-info/PKG-INFO
writing top-level names to TracBackLinkPlugin.egg-info/top_level.txt
writing dependency_links to TracBackLinkPlugin.egg-info/dependency_links.txt
writing entry points to TracBackLinkPlugin.egg-info/entry_points.txt
reading manifest file 'TracBackLinkPlugin.egg-info/SOURCES.txt'
writing manifest file 'TracBackLinkPlugin.egg-info/SOURCES.txt'
running build_ext
test_attachment_links (tracbacklink.tests.api.GatherLinksTestCase) ... ok
test_changeset_links_cached_repository (tracbacklink.tests.api.GatherLinksTestCase) ... ok
test_changeset_links_non_cached_repository (tracbacklink.tests.api.GatherLinksTestCase) ... ok
test_milestone_links (tracbacklink.tests.api.GatherLinksTestCase) ... ok
test_ticket_links (tracbacklink.tests.api.GatherLinksTestCase) ... ok
test_wiki_links (tracbacklink.tests.api.GatherLinksTestCase) ... ok
test_wiki_syntax (tracbacklink.tests.api.GatherLinksTestCase) ... ok
test_attachment (tracbacklink.tests.api.ChangeListenersTestCase) ... ok
test_changeset_with_cached_repos (tracbacklink.tests.api.ChangeListenersTestCase) ... ok
test_changeset_with_non_cached_repos (tracbacklink.tests.api.ChangeListenersTestCase) ... ok
test_milestone (tracbacklink.tests.api.ChangeListenersTestCase) ... ok
test_ticket (tracbacklink.tests.api.ChangeListenersTestCase) ... ok
test_wiki_page (tracbacklink.tests.api.ChangeListenersTestCase) ... FAIL

======================================================================
FAIL: test_wiki_page (tracbacklink.tests.api.ChangeListenersTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jun66j5/src/tracbacklinkplugin/tracbacklink/tests/api.py", line 570, in test_wiki_page
    self._verify_sets(expected, self._db_query())
  File "/home/jun66j5/src/tracbacklinkplugin/tracbacklink/tests/api.py", line 463, in _verify_sets
    self.assertEqual(s1 - (s1 & s2), s2 - (s1 & s2))
AssertionError: Items in the first set but not the second:
('ticket', '44', None, None, 'comment', '2', 'wiki', 'SandBox/NewPage')
('wiki', 'TracInstall', None, None, 'wiki', 'SandBox/NewPage', None, None)
Items in the second set but not the first:
(u'wiki', u'TracIni', None, None, u'wiki', u'SandBox/NewPage', None, None)

----------------------------------------------------------------------
Ran 13 tests in 0.391s

FAILED (failures=1)

Attachments (1)

tracbacklinkplugin-r17954.diff (3.3 KB) - added by clemens 4 years ago.
patch by Jun Omae for Oops... Trac detected an internal error: TypeError: 'Fragment' object is not callable

Download all attachments as: .zip

Change History (17)

comment:1 Changed 4 years ago by Ryan J Ollos

The plugin uses Genshi transformer. Do you think it will eventually be made compatible with Jinja2?

comment:2 Changed 4 years ago by Ryan J Ollos

comment:3 Changed 4 years ago by clemens

Cc: clemens added

comment:4 Changed 4 years ago by Jun Omae

Resolution: fixed
Status: newclosed

In 17944:

TracBackLinkPlugin/1.0.11: make compatible with Trac 1.4 (closes #13619)

comment:5 in reply to:  4 ; Changed 4 years ago by clemens

Replying to Jun Omae:

changeset:17944: compatible with Trac 1.4 (closes #13619)

Hello Jun

Many many thanks for making TracBackLinkPlugin version 1.0.11 compatible with Trac 1.4. After testing your changes I can confirm that it works well with Trac 1.4.2. Great!

However, with changeset:17944 there seems to be an installation issue. The file base.js is missing, it is not being installed with PIP. This is the error message:

2021-01-01 01:06:01,000 Trac[chrome] WARNING: File base.js not found in any of ['/usr/local/lib/python2.7/dist-packages/tracbacklink/htdocs']
2021-01-01 01:06:01,078 Trac[main] WARNING: [127.0.0.1] HTTPNotFound: 404 Not Found (File base.js not found), <RequestWithSession "GET '/chrome/tracbacklink/base.js'">, referrer 'http://localhost:8000/testrepo/ticket/3'

I managed to work around this by manually downloading the missing base.js into /usr/local/lib/python2.7/dist-packages/tracbacklink/htdocs. I guess that you forgot to include the new base.js file in the python setup. I am not a python programmer, but I guess that in setup.py the package_data argument needs to include something like htdocs/*.js. Am I right?

Clemens

comment:6 Changed 4 years ago by Jun Omae

In 17948:

TracBackLinkPlugin/1.0.11: fix missing htdocs/*.js files in package data (refs #13619)

comment:7 in reply to:  5 ; Changed 4 years ago by Jun Omae

Replying to clemens:

However, with changeset:17944 there seems to be an installation issue. The file base.js is missing, it is not being installed with PIP.

Thanks for the testing and reporting, Clemens. Your suggestion is correct. Fixed in r17948.

comment:8 in reply to:  7 Changed 4 years ago by clemens

Replying to Jun Omae:

installation issue. The file base.js is missing.

Fixed in r17948.

Thanks Jun

I tested again the PIP installation. Thanks to your fix the missing file htdocs/base.js is now auto-installed by PIP. Perfect now!

Clemens

comment:9 Changed 4 years ago by Jun Omae

Resolution: fixed
Status: closedreopened

The following error is reported at mailing list, https://groups.google.com/d/msgid/trac-users/581d4f61-ee12-bf33-90bb-cac9b6eb59d2%40osypkamed.com.

After upgrading my site from TRAC 1.2.3 to 1.4.2 the TracBackLinkPlugin is causing mysterious "Trac Oops" errors when viewing some ticket or wiki pages (but only on some of them).

File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 639, in dispatch_request
   dispatcher.dispatch(req)
File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 252, in dispatch
   resp = self._post_process_request(req, *resp)
File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 495, in _post_process_request
   resp = f.post_process_request(req, *resp[:-1])
File "/usr/local/lib/python2.7/dist-packages/tracbacklink/web_ui.py", line 100, in post_process_request
   if type_ else None
File "/usr/local/lib/python2.7/dist-packages/tracbacklink/web_ui.py", line 156, in _get_backlinks_content
   rendered = self._render_backlinks(req, sources)
File "/usr/local/lib/python2.7/dist-packages/tracbacklink/web_ui.py", line 206, in _render_backlinks
   rendered.update(f(req, sources))
File "/usr/local/lib/python2.7/dist-packages/tracbacklink/web_ui.py", line 323, in _render_repository_backlinks
   rendered(' ' if idx else u' \u2013 ', item)

comment:10 in reply to:  9 Changed 4 years ago by clemens

Replying to Jun Omae:

The following error is reported at mailing list,
https://groups.google.com/d/msgid/trac-users/581d4f61-ee12-bf33-90bb-cac9b6eb59d2%40osypkamed.com.

After upgrading my site from TRAC 1.2.3 to 1.4.2 the TracBackLinkPlugin is causing mysterious "Trac Oops" errors when viewing some ticket or wiki pages (but only on some of them).

Just for the records: The particular error message is as follow:

Oops... 
Trac detected an internal error: 
TypeError: 'Fragment' object is not callable

Surprising this error does not trigger on all tickets or wiki pages. Only some of them cause the error (maybe 25% of them). Other tickets and wiki page work fine and I can see the desired "Back Link" box. This tells me that the plugin is basically working. So far I could not see a pattern.

comment:11 Changed 4 years ago by clemens

Just for the records: Ryan has opened a new TRAC ticket in scope of this issue: trac:#13343

Changed 4 years ago by clemens

patch by Jun Omae for Oops... Trac detected an internal error: TypeError: 'Fragment' object is not callable

comment:12 in reply to:  9 Changed 4 years ago by clemens

Keywords: patch added

Replying to Jun Omae:

The following error is reported at mailing list, https://groups.google.com/d/msgid/trac-users/581d4f61-ee12-bf33-90bb-cac9b6eb59d2%40osypkamed.com.

After upgrading my site from TRAC 1.2.3 to 1.4.2 the TracBackLinkPlugin is causing mysterious "Trac Oops" errors when viewing some ticket or wiki pages (but only on some of them).

In the mailing list Jun has submitted a patch for above error. I tested it and it works. No more "Trac Oops" anymore. Good job!

I do not understand the internals of this patch. But since it is obviously an improvement, I propose to accept it for the TracBackLinkPlugin.

comment:13 Changed 4 years ago by Jun Omae

Resolution: fixed
Status: reopenedclosed

In 17971:

TracBackLinkPlugin/1.0.13: fix 'Fragment' object is not callable while rendering backlinks and add unit tests (closes #13619)

comment:14 Changed 10 months ago by stei

Cc: stei added

comment:15 Changed 10 months ago by clemens

Cc: clemens removed

comment:16 Changed 10 months ago by clemens

Cc: clemens added

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.