Mailing List Archive

TracBackLinkPlugin - TypeError: 'Fragment' object is not callable
Hello

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).

https://trac-hacks.org/wiki/TracBackLinkPlugin

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.

I have been using this plugin (older version) for years with great
success on our old TRAC 1.2 But now I upgraded our TRAC to 1.4.2 and
also upgraded the plugin and the problem started.

I need your help, please.

--------------
Of course I have execute the required upgrade and sync-command to
populate the database table:

trac-admin <REPO> upgrade
trac-admin <REPO> backlink sync


---------------
I am running TRAC 1.4.2.
No other plugins are enabled.

TracBackLinkPlugin
version is 1.0.12 [17951 by jun66j5]

I also tested an earlier version, which also fails.
version 1.0.11 [17948 by jun66j5]

--------------

Python Traceback

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)

Above error is for a ticket and points to:
_render_ticket_backlinks

https://trac-hacks.org/browser/tracbacklinkplugin/1.0/tracbacklink/web_ui.py#L250

... but the error may also appear when viewing a wiki page:
_render_wiki_backlinks

https://trac-hacks.org/browser/tracbacklinkplugin/1.0/tracbacklink/web_ui.py#L209



I would appreciate any help or comments on this matter.
The TracBackLinkPlugin is very valuable and I would love to use it on
our site.

Best regards
Clemens

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/581d4f61-ee12-bf33-90bb-cac9b6eb59d2%40osypkamed.com.
Re: TracBackLinkPlugin - TypeError: 'Fragment' object is not callable [ In reply to ]
On Mon, Jan 18, 2021 at 4:48 PM Clemens Feige <c.feige@osypkamed.com> wrote:

> Hello
>
> 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).
>
> https://trac-hacks.org/wiki/TracBackLinkPlugin
>
> 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.
>
> I have been using this plugin (older version) for years with great
> success on our old TRAC 1.2 But now I upgraded our TRAC to 1.4.2 and
> also upgraded the plugin and the problem started.
>
> I need your help, please.
>
> --------------
> Of course I have execute the required upgrade and sync-command to
> populate the database table:
>
> trac-admin <REPO> upgrade
> trac-admin <REPO> backlink sync
>
>
> ---------------
> I am running TRAC 1.4.2.
> No other plugins are enabled.
>
> TracBackLinkPlugin
> version is 1.0.12 [17951 by jun66j5]
>
> I also tested an earlier version, which also fails.
> version 1.0.11 [17948 by jun66j5]
>
> --------------
>
> Python Traceback
>
> 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)
>
> Above error is for a ticket and points to:
> _render_ticket_backlinks
>
>
> https://trac-hacks.org/browser/tracbacklinkplugin/1.0/tracbacklink/web_ui.py#L250
>
> ... but the error may also appear when viewing a wiki page:
> _render_wiki_backlinks
>
>
> https://trac-hacks.org/browser/tracbacklinkplugin/1.0/tracbacklink/web_ui.py#L209
>
>
>
> I would appreciate any help or comments on this matter.
> The TracBackLinkPlugin is very valuable and I would love to use it on
> our site.
>
> Best regards
> Clemens
>

I'm not sure about the cause, but I would open a ticket for the plugin:
https://trac-hacks.org/wiki/TracBackLinkPlugin#BugsFeatureRequests

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CA%2BBGpn_2%3DfaYsRXmdqVRpSk4u8VEa0nTtrD6zQ_PY0nQxKVgAg%40mail.gmail.com.
Re: TracBackLinkPlugin - TypeError: 'Fragment' object is not callable [ In reply to ]
Thanks for the reporting. Reopened
https://trac-hacks.org/ticket/13619#comment:9.
It seems to be caused by that Fragment in genshi has __call__() method
but Fragment in trac 1.4 doesn't.

On Tue, Jan 19, 2021 at 9:56 AM Ryan Ollos <rjollos@gmail.com> wrote:
>
> On Mon, Jan 18, 2021 at 4:48 PM Clemens Feige <c.feige@osypkamed.com> wrote:
>>
>> Hello
>>
>> 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).
>>
>> https://trac-hacks.org/wiki/TracBackLinkPlugin
>>
>> 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.
>>
>> I have been using this plugin (older version) for years with great
>> success on our old TRAC 1.2 But now I upgraded our TRAC to 1.4.2 and
>> also upgraded the plugin and the problem started.
>>
>> I need your help, please.
>>
>> --------------
>> Of course I have execute the required upgrade and sync-command to
>> populate the database table:
>>
>> trac-admin <REPO> upgrade
>> trac-admin <REPO> backlink sync
>>
>>
>> ---------------
>> I am running TRAC 1.4.2.
>> No other plugins are enabled.
>>
>> TracBackLinkPlugin
>> version is 1.0.12 [17951 by jun66j5]
>>
>> I also tested an earlier version, which also fails.
>> version 1.0.11 [17948 by jun66j5]
>>
>> --------------
>>
>> Python Traceback
>>
>> 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)
>>
>> Above error is for a ticket and points to:
>> _render_ticket_backlinks
>>
>> https://trac-hacks.org/browser/tracbacklinkplugin/1.0/tracbacklink/web_ui.py#L250
>>
>> ... but the error may also appear when viewing a wiki page:
>> _render_wiki_backlinks
>>
>> https://trac-hacks.org/browser/tracbacklinkplugin/1.0/tracbacklink/web_ui.py#L209



--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMagAnsuQ3qgq9KROXAhu_SJOseoygmPbCCD2%2BWrM3C4pFA%40mail.gmail.com.
Re: TracBackLinkPlugin - TypeError: 'Fragment' object is not callable [ In reply to ]
Could you please try the attached patch?

On Tue, Jan 19, 2021 at 12:06 PM Jun Omae <jun66j5@gmail.com> wrote:
>
> Thanks for the reporting. Reopened
> https://trac-hacks.org/ticket/13619#comment:9.
> It seems to be caused by that Fragment in genshi has __call__() method
> but Fragment in trac 1.4 doesn't.
>
> On Tue, Jan 19, 2021 at 9:56 AM Ryan Ollos <rjollos@gmail.com> wrote:
> >
> > On Mon, Jan 18, 2021 at 4:48 PM Clemens Feige <c.feige@osypkamed.com> wrote:
> >>
> >> Hello
> >>
> >> 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).
> >>
> >> https://trac-hacks.org/wiki/TracBackLinkPlugin
> >>
> >> 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.
> >>
> >> I have been using this plugin (older version) for years with great
> >> success on our old TRAC 1.2 But now I upgraded our TRAC to 1.4.2 and
> >> also upgraded the plugin and the problem started.
> >>
> >> I need your help, please.
> >>
> >> --------------
> >> Of course I have execute the required upgrade and sync-command to
> >> populate the database table:
> >>
> >> trac-admin <REPO> upgrade
> >> trac-admin <REPO> backlink sync
> >>
> >>
> >> ---------------
> >> I am running TRAC 1.4.2.
> >> No other plugins are enabled.
> >>
> >> TracBackLinkPlugin
> >> version is 1.0.12 [17951 by jun66j5]
> >>
> >> I also tested an earlier version, which also fails.
> >> version 1.0.11 [17948 by jun66j5]
> >>
> >> --------------
> >>
> >> Python Traceback
> >>
> >> 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)
> >>
> >> Above error is for a ticket and points to:
> >> _render_ticket_backlinks
> >>
> >> https://trac-hacks.org/browser/tracbacklinkplugin/1.0/tracbacklink/web_ui.py#L250
> >>
> >> ... but the error may also appear when viewing a wiki page:
> >> _render_wiki_backlinks
> >>
> >> https://trac-hacks.org/browser/tracbacklinkplugin/1.0/tracbacklink/web_ui.py#L209
>
>
>
> --
> Jun Omae <jun66j5@gmail.com> (?? ?)



--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMajsnpmggUKvOgfdE3gDb0a2WdVs8rys1a%3DaC-DoyxkA_g%40mail.gmail.com.
Re: TracBackLinkPlugin - TypeError: 'Fragment' object is not callable [ In reply to ]
Dear Jun

Your patch is working.
Very well done (and so fast)!

Many thanks
Clemens

Jun Omae wrote on 19.01.2021 at 04:39:
> Could you please try the attached patch?
>
> On Tue, Jan 19, 2021 at 12:06 PM Jun Omae <jun66j5@gmail.com> wrote:
>>
>> Thanks for the reporting. Reopened
>> https://trac-hacks.org/ticket/13619#comment:9.
>> It seems to be caused by that Fragment in genshi has __call__() method
>> but Fragment in trac 1.4 doesn't.
>>
>> On Tue, Jan 19, 2021 at 9:56 AM Ryan Ollos <rjollos@gmail.com> wrote:
>>>
>>> On Mon, Jan 18, 2021 at 4:48 PM Clemens <c.feige@osypkamed.com> wrote:
>>>>
>>>> Hello
>>>>
>>>> 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).
>>>>
>>>> https://trac-hacks.org/wiki/TracBackLinkPlugin
>>>>
>>>> The particular error message is as follow:
>>>>
>>>> Oops...
>>>> Trac detected an internal error:
>>>> TypeError: 'Fragment' object is not callable

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/f4053e12-b498-0676-b0fc-223a9a2b2917%40osypkamed.com.
Re: TracBackLinkPlugin - TypeError: 'Fragment' object is not callable [ In reply to ]
On Monday, January 18, 2021 at 7:06:58 PM UTC-8 Jun Omae wrote:

> Thanks for the reporting. Reopened
> https://trac-hacks.org/ticket/13619#comment:9.
> It seems to be caused by that Fragment in genshi has __call__() method
> but Fragment in trac 1.4 doesn't.
>

Should we add the __call__() method to Fragment in trac/util/html.py?

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/a1624d32-a38d-4142-a2be-9b1f7c75065bn%40googlegroups.com.
Re: TracBackLinkPlugin - TypeError: 'Fragment' object is not callable [ In reply to ]
On Wed, Jan 20, 2021 at 2:49 AM RjOllos <rjollos@gmail.com> wrote:
>
> On Monday, January 18, 2021 at 7:06:58 PM UTC-8 Jun Omae wrote:
>>
>> Thanks for the reporting. Reopened
>> https://trac-hacks.org/ticket/13619#comment:9.
>> It seems to be caused by that Fragment in genshi has __call__() method
>> but Fragment in trac 1.4 doesn't.
>
> Should we add the __call__() method to Fragment in trac/util/html.py?

Yes. It would be to improve compatibility with Fragment in Genshi library.

The Fragment.__call__() in Genshi accepts multiple arguments and each
argument is passed to Fragment.append(). Fragment.append() accepts
only 1 argument.

--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMahFvqYuDoRg9ctm6tLeDOswqQ_X5yAdzPvHWKaRs71FeQ%40mail.gmail.com.
Re: TracBackLinkPlugin - TypeError: 'Fragment' object is not callable [ In reply to ]
On Thursday, January 21, 2021 at 1:34:12 AM UTC-8 Jun Omae wrote:

> On Wed, Jan 20, 2021 at 2:49 AM RjOllos <rjo...@gmail.com> wrote:
> >
> > On Monday, January 18, 2021 at 7:06:58 PM UTC-8 Jun Omae wrote:
> >>
> >> Thanks for the reporting. Reopened
> >> https://trac-hacks.org/ticket/13619#comment:9.
> >> It seems to be caused by that Fragment in genshi has __call__() method
> >> but Fragment in trac 1.4 doesn't.
> >
> > Should we add the __call__() method to Fragment in trac/util/html.py?
>
> Yes. It would be to improve compatibility with Fragment in Genshi library.
>
> The Fragment.__call__() in Genshi accepts multiple arguments and each
> argument is passed to Fragment.append(). Fragment.append() accepts
> only 1 argument.
>
>
Thanks, created: https://trac.edgewall.org/ticket/1334

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/5c4d2e83-5f4c-4f08-b1b0-7437dbf98235n%40googlegroups.com.
Re: TracBackLinkPlugin - TypeError: 'Fragment' object is not callable [ In reply to ]
On Thursday, January 21, 2021 at 1:34:12 AM UTC-8 Jun Omae wrote:

> On Wed, Jan 20, 2021 at 2:49 AM RjOllos <rjo...@gmail.com> wrote:
> >
> > On Monday, January 18, 2021 at 7:06:58 PM UTC-8 Jun Omae wrote:
> >>
> >> Thanks for the reporting. Reopened
> >> https://trac-hacks.org/ticket/13619#comment:9.
> >> It seems to be caused by that Fragment in genshi has __call__() method
> >> but Fragment in trac 1.4 doesn't.
> >
> > Should we add the __call__() method to Fragment in trac/util/html.py?
>
> Yes. It would be to improve compatibility with Fragment in Genshi library.
>
> The Fragment.__call__() in Genshi accepts multiple arguments and each
> argument is passed to Fragment.append(). Fragment.append() accepts
> only 1 argument.
>
> --
> Jun Omae <jun...@gmail.com> (?? ?)
>

Thanks, created: https://trac.edgewall.org/ticket/13343

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/550893c2-9c3c-4b58-9d73-dfc4f918a52cn%40googlegroups.com.