From 3d22bc56c4d20dd654f41da9d6405055edbfd3d7 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Mon, 31 May 2010 09:58:42 +0000 Subject: [PATCH] Fix encoding error in migration procedure, otherwise migration procedure breaks on joining output list in case we have there any non-ascii characters. [piv] svn path=/plone.app.discussion/trunk/; revision=36844 --- CHANGES.txt | 3 +++ plone/app/discussion/browser/migration.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 21ae8b1..2ebceb1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,9 @@ Changelog 1.0b5 (unreleased) ------------------ +* Fix encoding error in migration procedure, otherwise migration procedure + breaks on joining output list in case we have there any non-ascii characters. + [piv] * plone.z3cform 0.6.0 compatibility (fix maximum recursion depth error which appears with plone.z3cform higher than 0.5.10) diff --git a/plone/app/discussion/browser/migration.py b/plone/app/discussion/browser/migration.py index 886c8e5..6fd0e9a 100644 --- a/plone/app/discussion/browser/migration.py +++ b/plone/app/discussion/browser/migration.py @@ -48,6 +48,9 @@ class View(BrowserView): dtool = context.portal_discussion def log(msg): + # encode string before sending it to external world + if isinstance(msg, unicode): + msg = msg.encode('utf-8') context.plone_log(msg) out.append(msg)