Ticket #193 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Graphviz and PageOutline Macro cannot coexist

Reported by: anonymous Assigned to: pkropf
Priority: normal Component: GraphvizPlugin
Severity: minor Keywords:
Cc: jgartrel Trac Release:

Description (Last modified by athomas)

I get the following error when I try to use the PageOutline Macro on the same page that I have a Graphviz graph:

Error: Macro PageOutline(2-3) failed 
'NoneType' object has no attribute 'args'

I used "The Sandbox" wiki page on my trac installation to duplicate this problem, using the following source:

= The Sandbox =

[[PageOutline(2-3)]]

This is just a page to practice and learn WikiFormatting. 

Go ahead, edit it freely.

----
== Subheading 1 ==
Test

----
== Subheading 2 ==
Test Again

 {{{
  #!graphviz
  digraph G {Hello->World->Graphviz->Rules}
 }}}

Below is the output from my trac.log:

13:40:55 Trac[graphviz] INFO: id: $Id: graphviz.py 254 2006-01-03 05:47:12Z pkropf $
13:40:55 Trac[graphviz] INFO: processors: ['dot', 'neato', 'twopi', 'circo', 'fdp']
13:40:55 Trac[graphviz] INFO: formats: ['png', 'jpg', 'gif', 'svg', 'svgz']
13:40:55 Trac[formatter] DEBUG: Executing Wiki macro PageOutline by provider <trac.wiki.macros.PageOutlineMacro object at 0xb7d791cc>
13:40:55 Trac[api] DEBUG: Updating wiki page index
13:40:55 Trac[formatter] DEBUG: Executing Wiki macro graphviz by provider <graphviz.graphviz.GraphvizMacro object at 0xb7d7918c>
13:40:55 Trac[graphviz] DEBUG: dir(req): ['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__']
13:40:55 Trac[formatter] ERROR: Macro PageOutline(2-3) failed
Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 376, in _macro_formatter
    return macro.process(self.req, args, 1)
  File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 110, in process
    text = self.processor(req, text)
  File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 101, in _macro_processor
    return macro_provider.render_macro(req, self.name, text)
  File "/usr/lib/python2.3/site-packages/trac/wiki/macros.py", line 188, in render_macro
    max_depth=max_depth, min_depth=min_depth))
  File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 763, in wiki_to_outline
    min_depth)
  File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 717, in format
    Formatter.format(self, text, NullOut())
  File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 584, in format
    self.handle_code_block(line)
  File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 554, in handle_code_block
    self.out.write(self.code_processor.process(self.req, self.code_text))
  File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 110, in process
    text = self.processor(req, text)
  File "/usr/lib/python2.3/site-packages/trac/wiki/formatter.py", line 101, in _macro_processor
    return macro_provider.render_macro(req, self.name, text)
  File "build/bdist.linux-i686/egg/graphviz/graphviz.py", line 91, in render_macro
AttributeError: 'NoneType' object has no attribute 'args'
13:40:55 Trac[formatter] DEBUG: Executing Wiki macro graphviz by provider <graphviz.graphviz.GraphvizMacro object at 0xb7d7918c>
13:40:55 Trac[graphviz] DEBUG: dir(req): ['_CGIRequest__environ', '_CGIRequest__input', '_CGIRequest__output', '__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__', '_getFieldStorage', '_headers', '_send_cookie_headers', 'args', 'authname', 'base_url', 'cgi_location', 'check_modified', 'display', 'end_headers', 'get_header', 'hdf', 'idx_location', 'incookie', 'method', 'outcookie', 'path_info', 'perm', 'read', 'redirect', 'remote_addr', 'remote_user', 'scheme', 'send_file', 'send_header', 'send_response', 'server_name', 'server_port', 'session', 'write']
13:40:55 Trac[graphviz] DEBUG: req.args: FieldStorage(None, None, [MiniFieldStorage('page', 'SandBox')])
13:40:55 Trac[graphviz] DEBUG: req.base_url: https://XXXXXXXXXXXXXXXXXX.com/trac/dev
13:40:55 Trac[graphviz] DEBUG: self.cache_dir: /tmp/trac/graphviz
13:40:55 Trac[graphviz] DEBUG: self.cmd_path: /usr/bin
13:40:55 Trac[graphviz] DEBUG: self.prefix_url: https://XXXXXXXXXXXXXXXX.com/trac/graphviz
13:40:55 Trac[graphviz] DEBUG: self.out_format: png
13:40:55 Trac[graphviz] DEBUG: self.processor: dot
13:40:55 Trac[graphviz] DEBUG: self.png_anti_alias: True
13:40:55 Trac[graphviz] DEBUG: self.rsvg_path: /usr/bin/rsvg
13:40:55 Trac[graphviz] DEBUG: self.cache_max_count: 2000
13:40:55 Trac[graphviz] DEBUG: self.cache_min_count: 1500
13:40:55 Trac[graphviz] DEBUG: self.cache_max_size: 10000000
13:40:55 Trac[graphviz] DEBUG: self.cache_min_size: 5000000

The problem will go away if I either remove the graphviz graph, or remove the PageOutline macro. Although the error reports itself as a PageOutline issue, the trac.log seems to point to GraphvizPlugin as the cause.

We are using a modified version of 0.9 release, however, I don't believe that our modifications are causing this issue. I have not yet been able to try it on the latest 0.9.4 version.

If you have any questions feel free to post them here

Attachments

gviz.patch (0.6 kB) - added by eblot on 03/21/06 20:26:28.
Workaround

Change History

02/22/06 03:14:39 changed by jgartrel

  • cc set to jgartrel.

02/22/06 04:18:13 changed by athomas

  • description changed.

03/07/06 19:50:14 changed by anonymous

03/18/06 04:10:17 changed by pkropf

Without seeming too dense, can you point me off to the PageOutline? macro? I'm having trouble finding it...

03/18/06 04:44:11 changed by jgartrel

The PageOutline? Macro is part of the default trac install, the online documentation is available in the standard trac wiki help pages: http://projects.edgewall.com/trac/wiki/WikiMacros

03/21/06 20:26:28 changed by eblot

  • attachment gviz.patch added.

Workaround

03/21/06 20:27:50 changed by eblot

I've attached a workaround for 0.9:

  • discards debug traces that access the null req object
  • discards the assignation of self.base_url which not used anyway.

03/21/06 21:19:05 changed by jgartrel

  • severity changed from major to minor.

Yes thank you the patch works very well

03/23/06 21:54:21 changed by rcastellucci@solisys.com

Patch working for me.

03/24/06 00:52:02 changed by coderanger

  • status changed from new to closed.
  • resolution set to fixed.

This was fixed in [533].


Add/Change #193 (Graphviz and PageOutline Macro cannot coexist)




Change Properties
Action