Description

If you miss to select attachment on using Load for uploading an image for example you get an traceback because of'utf8' codec can't decode byte 0x89 in position 0: unexpected code byte.

Steps to reproduce

  1. do this...

Example

Component selection

Details

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

Discussion

Could be fixed by

diff -r aea1aadf2cfb MoinMoin/action/Load.py
--- a/MoinMoin/action/Load.py   Fri Oct 05 07:54:22 2007 -0700
+++ b/MoinMoin/action/Load.py   Sat Oct 06 22:41:52 2007 +0200
@@ -83,7 +83,12 @@ class Load(ActionBase):
             status = True

         else:
-            filecontent = unicode(filecontent, config.charset)
+            # prevents a traceback if one tries to add bin data as revision
+            try:
+                filecontent = unicode(filecontent, config.charset)
+            except:
+                msg = _("This file can't be loaded as page, try attachment")
+                return status, msg
             self.pagename = wikiutil.escape(target)
             page = Page(self.request, self.pagename)
             pagedir = page.getPagePath("", check_create=0)

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/1.7devLoadFailsWithTraceback (last edited 2009-11-28 17:22:47 by ReimarBauer)