changeset 66:0f25fe665367

except unicode errors too
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 12 Jun 2010 09:46:36 -0700
parents 4e41e1084e56
children 3550159184cf
files bitsyblog/bitsyblog.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bitsyblog/bitsyblog.py
+++ b/bitsyblog/bitsyblog.py
@@ -641,17 +641,17 @@ class BitsyBlog(object):
         settings = { 'report_level': 5 }
         string = string.strip()
         try:
             
             parts = docutils.core.publish_parts(string,
                                                 writer_name='html',
                                                 settings_overrides=settings)
             body = parts['body']
-        except SystemMessage, e:
+        except (SystemMessage, UnicodeError), e:
             lines = [ cgi.escape(i.strip()) for i in string.split('\n') ]
             body = '<br/>\n'.join(lines)
             
 
         retval = '<div class="blog-body">%s</div>' % body
         return retval
 
 #         # XXX this should be reenabled if 'system-message's again appear in the markup