Description

The request.formatter.parser() function will sometimes write its result to the request, as documented in the comments in FormatterBase code, but sometimes it will not write to the request and instead return the result as a return value (even though the code in the FormatterBase seems to always return "").

(!) In fact it either does:

Steps to reproduce

  1. Redirect output in the request with request.redirect() to a StringIO buffer

  2. Call request.formatter.parser for the text/python parser

  3. Check the buffer's getvalue()

  4. It's empty

Component selection

Details

The funny thing is, when I copy the code from the FormatterBase into my parser directly, instead of calling it, it works fine -- so my guess is that the method is somehow overriden.

MoinMoin Version

1.6, 1.7

OS and Version

Python Version

Server Setup

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

Workaround

Get both the return value and the buffer, and concatenate them for the actual result.

Discussion

After refactoring the text_python, assemble_code etc. voodoo, we could refactor the parsers to return the result and not use request.write.

Plan

  • Priority:
  • Assigned to:
  • Status:


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/FormatterParserOutputReturnedNotWritten (last edited 2007-12-19 02:21:04 by ThomasWaldmann)