Ticket #4568 (closed defect: fixed)
Graphviz: AttributeError: 'Formatter' object has no attribute 'base_url'
| Reported by: | acarr | Owned by: | jonas |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11 |
| Component: | wiki system | Version: | devel |
| Severity: | normal | Keywords: | graphviz macros |
| Cc: |
Description
General Description
I had an existing site, running an early 0.11dev, (October 10th ish, 2006) version of trac on a locally compiled python stack, on Redhat AS3. For other reasons (packages are your friends), we chose to redeploy to an Ubuntu 6.10 setup.
I've got most of the site up and running, getting the various parts to cooperate again, but, graphviz pages now die with the error reported here.
The page in question had 3 graphviz macros on it, and when I remove the graphviz egg, I get the error that it doesn't know how to interpret "{ { {#!graphviz ... } } }" stuff, which seems like a reasonable error.
I'm presently running r4608, and I grabbed the current copy of graphviz, too (r1887).
I tried uncommenting the hack in graphviz.py, line 90ish, which has been reported to make it work, but it doesn't.
My present workaround is going to be text file attachments, and include pictures as pictures in the page.
How to Reproduce
While doing a GET operation on /wiki/General System Design, Trac issued an internal error.
The error is reliably caused by having a graphviz element in the page, when the graphviz plugin is installed and enabled.
System Information
| Trac | 0.11dev |
| Python | 2.4.4c1 (#1, Oct 11 2006, 21:48:21) |
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)]
| pyPgSQL | 2.5.1 |
| Genshi | 0.3.6 |
| Subversion | 1.3.2 |
Python Traceback
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 395, in dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 227, in dispatch
content_type)
File "/usr/lib/python2.4/site-packages/trac/web/chrome.py", line 552, in render_template
return stream.render(method, doctype=doctype)
File "build/bdist.linux-i686/egg/genshi/core.py", line 141, in render
File "build/bdist.linux-i686/egg/genshi/output.py", line 203, in __call__
File "build/bdist.linux-i686/egg/genshi/output.py", line 491, in __call__
File "build/bdist.linux-i686/egg/genshi/output.py", line 439, in __call__
File "build/bdist.linux-i686/egg/genshi/core.py", line 202, in _ensure
File "build/bdist.linux-i686/egg/genshi/core.py", line 202, in _ensure
File "/usr/lib/python2.4/site-packages/trac/web/chrome.py", line 580, in _strip_accesskeys
for kind, data, pos in stream:
File "build/bdist.linux-i686/egg/genshi/core.py", line 202, in _ensure
File "/usr/lib/python2.4/site-packages/trac/web/chrome.py", line 569, in _generate
for kind, data, pos in stream:
File "build/bdist.linux-i686/egg/genshi/filters.py", line 147, in __call__
File "build/bdist.linux-i686/egg/genshi/template.py", line 1149, in _match
File "build/bdist.linux-i686/egg/genshi/filters.py", line 147, in __call__
File "build/bdist.linux-i686/egg/genshi/template.py", line 1123, in _match
File "build/bdist.linux-i686/egg/genshi/template.py", line 1112, in _strip
File "build/bdist.linux-i686/egg/genshi/template.py", line 925, in _eval
File "build/bdist.linux-i686/egg/genshi/eval.py", line 102, in evaluate
File "/usr/share/trac/templates/wiki_view.html", line 55, in <Expression u"context.wiki_to_html(page.text)">
${context.wiki_to_html(page.text)}
File "/usr/lib/python2.4/site-packages/trac/wiki/api.py", line 286, in wiki_to_html
Formatter(self).format(wikitext, out, escape_newlines)
File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 799, in format
self.handle_code_block(line)
File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 734, in handle_code_block
processed = self.code_processor.process(self.code_text)
File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 118, in process
text = self.processor(text)
File "/usr/lib/python2.4/site-packages/trac/wiki/formatter.py", line 105, in _macro_processor
return self.macro_provider.render_macro(self.formatter, self.name, text)
File "build/bdist.linux-i686/egg/graphviz/graphviz.py", line 261, in render_macro
AttributeError: 'Formatter' object has no attribute 'base_url'


