Modify

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#3898 closed defect (fixed)

coercing to Unicode: need string or buffer, NoneType found

Reported by: fstoffel@… Owned by: cboos
Priority: normal Component: GraphvizPlugin
Severity: normal Keywords: unicode nonetype
Cc: andre.sudhoff@… Trac Release: 0.11

Description

I've installed Trac 0.11.1 and the graphviz plugin 0.7.3 using Apache 2 and mod_python on a Debian machine. I've installed the graphviz package, libgv-python (Python bindings for graphviz), and python-pygraphviz (Python interface to the Graphviz graph layout and visualization package).

Whenever I want to create a graph in the wiki, for example using the provided graph

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

the following error message appears:

Trac detected an internal error: TypeError: coercing to Unicode: need string or buffer, NoneType found

The graphviz plugin is enabled in trac.conf using

[components]
...
graphviz.* = enabled

A separate [graphviz] section does not exist.
The stack trace and additional system information is attached.

Attachments (1)

traceinfo.txt (1.6 KB) - added by fstoffel@… 6 years ago.
trace and system information

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by fstoffel@…

trace and system information

comment:1 Changed 6 years ago by anonymous

  • Cc andre.sudhoff@… added

I have the same problem therefore I installed the latest graphviz version 2.20, but I still get the same error.
A workaround for the problem is to set "png_antialias = false" in the trac.ini [graphviz] section.

comment:2 Changed 6 years ago by cboos

  • Owner changed from pkropf to cboos

Would you mind trying this fix:

diff -r d371bc0e7b72 graphviz/graphviz.py
--- a/graphviz/graphviz.py      Mon Oct 20 10:34:54 2008 +0200
+++ b/graphviz/graphviz.py      Mon Oct 20 10:51:14 2008 +0200
@@ -498,7 +498,7 @@
             self.rsvg_path = self.rsvg_path_option or \
                     self._find_cmd('rsvg', cmd_paths)

-            if not os.path.exists(self.rsvg_path):
+            if not (self.rsvg_path and os.path.exists(self.rsvg_path)):
                 return _("The rsvg program is set to '%(path)s' but that path "
                          "does not exist.", path=self.rsvg_path)

(apply with patch -p1)

comment:3 Changed 6 years ago by cboos

  • Resolution set to fixed
  • Status changed from new to closed

(In [4538]) GraphvizPlugin: fix check for rsvg existence, as self.rsvg_path might end up being None if both unset and not found in default paths.

Closes #3898.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from cboos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.