Description

If you enter a link to an attachment like

attachment:gro%DF.txt

an error is raised: 'utf8' codec can't decode bytes in position...

This(?) error is also observed in another scenario:

  1. Add file://gro%DF.txt to a page. (or try with this page)

  2. Click preview (text mode)
  3. Switch to GUI mode
  4. Switch to text mode

Steps to reproduce

see description

Details

This Wiki. - The bug seems to be more critical as it is possible to make pages practically non-accessible (like I did here for WikiSandBox by accident). The bug was originally observed in moin-1.5.4.

Workaround

Edit the page manually and replace the % by %25.

Discussion

wikiutil.py in url_unquote only tries to decode from config.charset (utf-8) and it doesn't catch or work around decoding errors (could use decodeUnknownInput to work at least for utf-8 and iso-8859-1 and config.charset (and not crash in any case).

TODO: find out why the gui converter(?) tries to unquote at all.

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/UnicodeDecodeErrorFor%escapingInLinksOrAttachments (last edited 2007-10-29 19:13:11 by localhost)