Description

Moin returns server error when wrong parameters passed to csv parser.

Steps to reproduce

Example

(provided by DmitryAndreev)

{{{#!csv , hide = 1,
a,b,c
d,e,f
}}}

Component selection

Details

MoinMoin Version

this wiki

OS and Version

Python Version

Server Setup

Server Details

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

Workaround

   1 diff -r 172146fe48a2 MoinMoin/parser/text_csv.py
   2 --- a/MoinMoin/parser/text_csv.py       Tue May 11 23:08:11 2010 +0200
   3 +++ b/MoinMoin/parser/text_csv.py       Fri May 21 02:59:08 2010 +0400
   4 @@ -96,7 +96,8 @@
   5                      except ValueError:
   6                          pass
   7                  else:
   8 -                    delimiter = arg.encode('utf-8')
   9 +                    if len(arg) == 1:
  10 +                        delimiter = arg.encode('utf-8')
  11                  continue
  12              if key == 'separator' or key == 'delimiter':
  13                  delimiter = val.encode('utf-8')

Discussion

There is more general problem to deal with: what should we do when parser (and other plugins) throws an exception? Just returning 500 isn't user-friendly.

The csv parser could made use of the arg parser which we introduced for macros.

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/CsvParserInternalServerErrorWrongOptions (last edited 2011-01-18 07:34:05 by ReimarBauer)