Ticket #3367 (new defect)

Opened 5 months ago

Last modified 3 months ago

IOError: cannot open resource

Reported by: anonymous Assigned to: malsmith
Priority: normal Component: GanttChartPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.11

Description

I installed ganttchart plugin. but doesn't work. I just followed this web site's guide. (all pre-required installed and using example in this web site)

Here is my trac.log.

/arial                                                                                                                                                           
    result = _eval_expr(data, ctxt, **vars)
  File "/usr/local/lib/python2.5/site-packages/Genshi-0.5-py2.5-linux-i686.egg/genshi/template/base.py", line 286, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/usr/local/lib/python2.5/site-packages/Genshi-0.5-py2.5-linux-i686.egg/genshi/template/eval.py", line 180, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/templates/wiki_view.html", line 37, in <Expression u'wiki_to_html(context, page.text)'>
    ${wiki_to_html(context, page.text)}
  File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/formatter.py", line 1095, in format_to_html
    return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
  File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/formatter.py", line 1054, in generate
    escape_newlines)
  File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/formatter.py", line 833, in format
    self.handle_code_block(line)
  File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/formatter.py", line 764, in handle_code_block
    processed = self.code_processor.process(code_text)
  File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/formatter.py", line 179, in process
    text = self.processor(text)
  File "/usr/local/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/wiki/formatter.py", line 160, in _legacy_macro_processor
    text)
  File "build/bdist.linux-i686/egg/gantt/gantt.py", line 202, in render_macro
    self.draw_chart(data,mstart,mend,img_path,80,20,False)
  File "build/bdist.linux-i686/egg/gantt/gantt.py", line 465, in draw_chart
    font = ImageFont.truetype("arial.ttf", 12)
  File "/usr/local/lib/python2.5/site-packages/PIL/ImageFont.py", line 205, in truetype
    return FreeTypeFont(filename, size, index, encoding)
  File "/usr/local/lib/python2.5/site-packages/PIL/ImageFont.py", line 121, in __init__
    self.font = _imagingft.getfont(file, size, index, encoding)
IOError: cannot open resource

Attachments

Change History

07/11/08 03:33:33 changed by thsturm

See closed ticket #3368 with the same problem, but a point to the problem (on Linux)

07/11/08 17:58:24 changed by anonymous

See closed ticket #3349 with the same problem, but a point to the problem (on Linux)

07/12/08 09:08:10 changed by nigelsim

See if you can find a copy of arial.ttf (debian systems can install them with a package called msttcorefonts, look in /usr/share/fonts/truetype/msttcorefonts/).

Now, put this file in the $PWD of the trac script. If you are using tracd, then this is where you called tracd from. In an FCGI scenario then this is the dir where the fcgi script lives (in my case /var/www/cgi-bin).

Ideally there would be a configurable prefix for the fonts, and probably also let you choose an alternative font.

07/23/08 18:10:54 changed by apuredol

Sorry, I am using Apache with mod_wsgi, I have arial.ttf but I couldn“t make it work. Do you have any idea where do I have to put arial.ttf?

09/11/08 05:35:08 changed by jsantana@unkasoft.com

to solve this do that: open gantt.py and go to:

font = ImageFont?.truetype("arial.ttf", 12)

and add this:

font_path = self.config.get('gantt', 'font_path') font = ImageFont?.truetype(font_path,12)

now in gantt section in yout trac.ini add:

[gantt] cache_dir = /tmp/gantt_cache font_path = /path/to/my/font/arial.ttf

now you can use a custom font in a custom place.

09/11/08 05:37:13 changed by anonymous

to solve this do that:

open gantt.py and go to:

font = ImageFont.truetype("arial.ttf", 12)

and add this:

font_path = self.config.get('gantt', 'font_path')
font = ImageFont.truetype(font_path,12)

now in gantt section in yout trac.ini add:

[gantt]
cache_dir = /tmp/gantt_cache
font_path = /path/to/my/font/arial.ttf

now you can use a custom font in a custom place.

09/11/08 05:37:54 changed by anonymous

sorry, i forgot use wikiformat :/


Add/Change #3367 (IOError: cannot open resource)




Change Properties
Action