Modify

Opened 6 years ago

Closed 4 years ago

#3133 closed defect (fixed)

AttributeError: ScannerError instance has no attribute 'message'

Reported by: makro Owned by: malsmith
Priority: highest Component: GanttChartPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.11

Description

I installed the gantt plugin on trac 012dev. This are the steps I did to install:

Installed Prerequisites:

  • PyYAML
  • python-dateutil
  • Python Imaging library (PIL)

Installation via easy_install (0.11) and uploading the egg in the Admin -> Plugins section.

Cache dir:
Created cache directory, made it writable for the webserver, added the following lines to trac.ini:

[gantt]
cache_dir = /path/to/cache_dir

Now, adding test data using that plugin to the wiki results in the following error:

AttributeError: ScannerError instance has no attribute 'message'

System Information:

User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.14; .NET CLR 2.0.50727; ffco7) Gecko/20080404 Firefox/2.0.0.14
Trac: 	0.12dev-r7181
Python: 2.4.4 (#1, Apr 5 2007, 20:09:06) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]
setuptools: 	0.6c3
psycopg2: 	2.0.5.1 (dec mx dt ext pq3)
Genshi: 	0.4.4
Pygments: 	0.10dev-20080603
jQuery:	1.2.3

Debug on site: (full logs are attached)

Python Traceback
Letzer Aufruf:

    * Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/templates/wiki_view.html", Zeile 37, in <Expression u'wiki_to_html(context, page.text)'>
      Code-Abschnitt:
        32. </table>
        33. </py:if>
        34.  
        35. <div class="wikipage searchable" py:choose="" xml:space="preserve">
        36. <py:when test="page.exists" xml:space="preserve">
        37. ${wiki_to_html(context, page.text)}
        38. </py:when>
        39. <py:otherwise>
        40. Describe ${name_of(page.resource)} here.
        41. </py:otherwise>
        42. </div>
      Lokale Variablen:
      Name	Wert
      data 	[{'_choose.matched': True}, {'abs_url_of': <function get_abs_url at ...
    * Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/util/compat.py", Zeile 133, in newfunc
      Code-Abschnitt:
       128. try:
       129. from functools import partial
       130. except ImportError:
       131. def partial(func_, *args, **kwargs):
       132. def newfunc(*fargs, **fkwargs):
       133. return func_(*(args + fargs), **dict(kwargs, **fkwargs))
       134. newfunc.func = func_
       135. newfunc.args = args
       136. newfunc.keywords = kwargs
       137. try:
       138. newfunc.__name__ = func_.__name__
      Lokale Variablen:
      Name	Wert
      args 	(<trac.env.Environment object at 0x4229980c>,)
      fargs 	(<Context <Resource u'wiki:gantt'>>, u"Test\r\n\r\n{{{\r\n#!gantt\r\n0 : ...
      fkwargs 	{}
      func_ 	<function format_to_html at 0x41f7a72c>
      kwargs 	{}
    * Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 1107, in format_to_html
      Code-Abschnitt:
      1102. return format_to_html(env, context, wikidom, **options)
      1103.  
      1104. def format_to_html(env, context, wikidom, escape_newlines=False):
      1105. if not wikidom:
      1106. return Markup()
      1107. return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
      1108.  
      1109. def format_to_oneliner(env, context, wikidom, shorten=False):
      1110. if not wikidom:
      1111. return Markup()
      1112. return InlineHtmlFormatter(env, context, wikidom).generate(shorten)
      Lokale Variablen:
      Name	Wert
      context 	<Context <Resource u'wiki:gantt'>>
      env 	<trac.env.Environment object at 0x4229980c>
      escape_newlines 	False
      wikidom 	u"Test\r\n\r\n{{{\r\n#!gantt\r\n0 : {start: '2008-03-20', dur: 5d, title: ...
    * Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 1066, in generate
      Code-Abschnitt:
      1061. newlines in the wikidom will be preserved if `escape_newlines` is set.
      1062. """
      1063. # FIXME: compatibility code only for now
      1064. out = StringIO()
      1065. Formatter(self.env, self.context).format(self.wikidom, out,
      1066. escape_newlines)
      1067. return Markup(out.getvalue())
      1068.  
      1069.  
      1070. class InlineHtmlFormatter(object):
      1071. """Format parsed wiki text to inline elements HTML.
      Lokale Variablen:
      Name	Wert
      escape_newlines 	False
      out 	<StringIO.StringIO instance at 0x4242af8c>
      self 	<trac.wiki.formatter.HtmlFormatter object at 0x4242d20c>
    * Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 833, in format
      Code-Abschnitt:
       828. def format(self, text, out=None, escape_newlines=False):
       829. self.reset(text, out)
       830. for line in text.splitlines():
       831. # Handle code block
       832. if self.in_code_block or line.strip() == WikiParser.STARTBLOCK:
       833. self.handle_code_block(line)
       834. continue
       835. # Handle Horizontal ruler
       836. elif line[0:4] == '----':
       837. self.close_table()
       838. self.close_paragraph()
      Lokale Variablen:
      Name	Wert
      escape_newlines 	False
      line 	u'}}}'
      out 	<StringIO.StringIO instance at 0x4242af8c>
      result 	u'Test'
      self 	<trac.wiki.formatter.Formatter object at 0x4242af6c>
      text 	u"Test\r\n\r\n{{{\r\n#!gantt\r\n0 : {start: '2008-03-20', dur: 5d, title: ...
    * Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 764, in handle_code_block
      Code-Abschnitt:
       759. self.close_table()
       760. self.close_paragraph()
       761. if self.code_buf:
       762. self.code_buf.append('')
       763. code_text = os.linesep.join(self.code_buf)
       764. processed = self.code_processor.process(code_text)
       765. self.out.write(_markup_to_unicode(processed))
       766.  
       767. else:
       768. self.code_buf.append(line)
       769. elif not self.code_processor:
      Lokale Variablen:
      Name	Wert
      code_text 	u"0 : {start: '2008-03-20', dur: 5d, title: Punchlist}\n1 : {start: ...
      line 	u'}}}'
      self 	<trac.wiki.formatter.Formatter object at 0x4242af6c>
    * Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 179, in process
      Code-Abschnitt:
       174. if self.error:
       175. text = system_message(tag('Error: Failed to load processor ',
       176. tag.code(self.name)),
       177. self.error)
       178. else:
       179. text = self.processor(text)
       180. if not text:
       181. return ''
       182. if in_paragraph:
       183. content_for_span = None
       184. interrupt_paragraph = False
      Lokale Variablen:
      Name	Wert
      in_paragraph 	False
      self 	<trac.wiki.formatter.WikiProcessor object at 0x424382cc>
      text 	u"0 : {start: '2008-03-20', dur: 5d, title: Punchlist}\n1 : {start: ...
    * Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 160, in _legacy_macro_processor
      Code-Abschnitt:
       155.  
       156. def _legacy_macro_processor(self, text): # TODO: remove in 0.12
       157. self.env.log.warning('Executing pre-0.11 Wiki macro %s by provider %s'
       158. % (self.name, self.macro_provider))
       159. return self.macro_provider.render_macro(self.formatter.req, self.name,
       160. text)
       161.  
       162. def _macro_processor(self, text):
       163. self.env.log.debug('Executing Wiki macro %s by provider %s'
       164. % (self.name, self.macro_provider))
       165. return self.macro_provider.expand_macro(self.formatter, self.name,
      Lokale Variablen:
      Name	Wert
      self 	<trac.wiki.formatter.WikiProcessor object at 0x424382cc>
      text 	u"0 : {start: '2008-03-20', dur: 5d, title: Punchlist}\n1 : {start: ...
    * Datei "build/bdist.linux-i686/egg/gantt/gantt.py", Zeile 204, in render_macro
      Lokale Variablen:
      Name	Wert
      URL_in_graph 	False
      buf 	<cStringIO.StringO object at 0x424686c0>
      content 	"0 : {start: '2008-03-20', dur: 5d, title: Punchlist}\n1 : {start: ...
      detail 	<yaml.scanner.ScannerError instance at 0x4234e34c>
      encoding 	'utf-8'
      img_name 	u'97abdf4c90f80510a06798f8af1717f485abdd65.std.png'
      img_path 	u'/opt/trac/env/plugins/ganttcache/97abdf4c90f80510a06798f8af1717f485abdd65 ...
      l_out_format 	u''
      l_proc 	u''
      m 	<_sre.SRE_Match object at 0x41f64e78>
      map_name 	u'97abdf4c90f80510a06798f8af1717f485abdd65.std.map'
      map_path 	u'/opt/trac/env/plugins/ganttcache/97abdf4c90f80510a06798f8af1717f485abdd65 ...
      msg 	<cStringIO.StringO object at 0x42443200>
      name 	u'gantt'
      proc_cmd 	''
      req 	<Request "GET u'/wiki/gantt'">
      self 	<gantt.gantt.GanttMacro object at 0x42345fcc>
      sha_key 	'97abdf4c90f80510a06798f8af1717f485abdd65'
      sha_text 	"std0 : {start: '2008-03-20', dur: 5d, title: Punchlist}\n1 : {start: ...
      trouble 	False

Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/templates/wiki_view.html", Zeile 37, in <Expression u'wiki_to_html(context, page.text)'>
  ${wiki_to_html(context, page.text)}
Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/util/compat.py", Zeile 133, in newfunc
  return func_(*(args + fargs), **dict(kwargs, **fkwargs))
Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 1107, in format_to_html
  return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 1066, in generate
  escape_newlines)
Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 833, in format
  self.handle_code_block(line)
Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 764, in handle_code_block
  processed = self.code_processor.process(code_text)
Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 179, in process
  text = self.processor(text)
Datei "/usr/lib/python2.4/site-packages/Trac-0.12dev_r7181-py2.4.egg/trac/wiki/formatter.py", Zeile 160, in _legacy_macro_processor
  text)
Datei "build/bdist.linux-i686/egg/gantt/gantt.py", Zeile 204, in render_macro
}

Attachments (1)

gantt.log (33.5 KB) - added by makro 6 years ago.
Log file

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by makro

Log file

comment:1 Changed 6 years ago by anonymous

I have the same issue on 0.11, too.

comment:2 Changed 6 years ago by alias2696

  • Priority changed from normal to highest
  • Severity changed from normal to blocker

i have the same issue on trac 0.11b

comment:3 Changed 4 years ago by anonymous

  • Summary changed from AttributeError: ScannerError instance has no attribute 'message' to AttributeError: ScannerError instance has no attribute 'messagwa'

comment:4 Changed 4 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from AttributeError: ScannerError instance has no attribute 'messagwa' to AttributeError: ScannerError instance has no attribute 'message'

comment:5 Changed 4 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:6 Changed 4 years ago by rjollos

I believe this may have been fixed in #7129, but I will test with 0.12 shortly.

comment:7 Changed 4 years ago by rjollos

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

Tested and confirmed to work with Trac 0.12.1dev-r10056.

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 malsmith. 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.