Modify

Opened 4 years ago

Last modified 4 years ago

#8566 new enhancement

Port under Trac v.0.12.x and MasterTicket v.3.x ?

Reported by: slevin@… Owned by: ftiede
Priority: normal Component: TracTicketDepgraphPlugin
Severity: normal Keywords: Port Trac 0.12
Cc: Trac Release: 0.12

Description (last modified by rjollos)

Please make port to new stable versions of Trac and MasterTicket. Current version 0.11 have a problem like:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 70: ordinal not in range(128)
2011-03-03 20:57:03,322 Trac[main] WARNING: HTTPInternalError: 500 Error Trac (Error Genshi UnicodeDecodeError ...

Attachments (0)

Change History (4)

comment:1 Changed 4 years ago by rjollos

  • Description modified (diff)

comment:2 Changed 4 years ago by anonymous

  • Trac Release changed from 0.11 to 0.12

comment:3 Changed 4 years ago by anonymous

Just for the record... This is a well known problem when upgrading to newer python versions: you really need to care for encoding Unicode properly (here likely to UTF-8). Without specifying an encoding, python won't accept any character above 128.

The following patch will solve this problem for the titles generated into the dependency graph. Note: the problem is actually in the GraphvizPlugin

Index: setup.py
===================================================================
--- setup.py	(Revision 9982)
+++ setup.py	(Arbeitskopie)
@@ -12,7 +12,7 @@
 __id__        = '$Id$'
 __headurl__   = '$HeadURL$'
 __docformat__ = 'restructuredtext'
-__version__   = '0.7.5'
+__version__   = '0.7.5.1'
 
 from setuptools import setup, find_packages
 
Index: graphviz/graphviz.py
===================================================================
--- graphviz/graphviz.py	(Revision 9982)
+++ graphviz/graphviz.py	(Arbeitskopie)
@@ -408,7 +408,7 @@
             f = open(map_path, 'r')
             map = f.readlines()
             f.close()
-            map = "".join(map).replace('\n', '')
+            map = unicode("".join(map).replace('\n', ''), 'utf-8')
             return tag(tag.map(Markup(map), id='G'+sha_key, name='G'+sha_key),
                        tag.img(src=img_url, usemap="#G"+sha_key, 
                                alt=_("GraphViz image")))

comment:4 Changed 4 years ago by ichthyo

After solving that, there is still another problem: the default setting for the dpi-value (=96) is too large. Adjust it in the trac.ini

[graphviz]
default_graph_dpi = 70

Add Comment

Modify Ticket

Action
as new The owner will remain ftiede.
Author


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

 
Note: See TracTickets for help on using tickets.