Double quotes in ODT comments cause exception in Renderer

Bug #1213724 reported by Atis Straujums
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Appy
New
Undecided
Unassigned

Bug Description

To reproduce:
- create an ODT document with some paragraphs
- select one of them and add a comment, saying: do text if mydict["mybool"]
- in Python, pass this to the renderer as the context variable: {"mydict" : {"mybool":True}}

The expected behaviour is to see the paragraph printed in the output.

Instead, the Renderer crashes with the log output similar to this:

Traceback (most recent call last):
  File "C:\<irrelevant>.py", line 233, in <module>
    renderer.run()
  File "C:\Python27\lib\site-packages\appy\pod\renderer.py", line 428, in run
    self.currentParser.parse(self.contentXml)
  File "C:\Python27\lib\site-packages\appy\shared\xml_parser.py", line 257, in p
arse
    self.parser.parse(inputSource)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "C:\Python27\lib\xml\sax\xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "C:\Python27\lib\xml\sax\expatreader.py", line 304, in end_element
    self._cont_handler.endElement(name)
  File "C:\Python27\lib\site-packages\appy\pod\pod_parser.py", line 333, in endE
lement
    e.context)
  File "C:\Python27\lib\site-packages\appy\pod\actions.py", line 108, in execute

    self.do(result, context, eRes)
  File "C:\Python27\lib\site-packages\appy\pod\actions.py", line 252, in do
    self.evaluateBuffer(result, context)
  File "C:\Python27\lib\site-packages\appy\pod\actions.py", line 112, in evaluat
eBuffer
    self.buffer.evaluate(result, context, removeMainElems=self.minus)
  File "C:\Python27\lib\site-packages\appy\pod\buffers.py", line 678, in evaluat
e
    evalEntry.action.execute(result, context)
  File "C:\Python27\lib\site-packages\appy\pod\actions.py", line 105, in execute

    eRes,error = self.evaluateExpression(result, context, self.expr)
  File "C:\Python27\lib\site-packages\appy\pod\actions.py", line 88, in evaluate
Expression
    errorMessage = EVAL_ERROR % (expr, self.getExceptionLine(e))
  File "C:\Python27\lib\site-packages\appy\pod\actions.py", line 58, in getExcep
tionLine
    return '%s.%s: %s' % (e.__module__, e.__class__.__name__, str(e))
AttributeError: 'exceptions.SyntaxError' object has no attribute '__module__'

Revision history for this message
Atis Straujums (atis-straujums) wrote :

Oh, forgot to add, that the error disappears if the ODT comment is rewritten to read like this: do text if mydict['mybool']

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.