[Checkins] SVN: zope.tal/trunk/ Fix printing of error messages for msgid conflict with non-ASCII texts.

Wichert Akkerman wichert at wiggy.net
Fri Mar 26 16:29:07 EDT 2010


Log message for revision 110220:
  Fix printing of error messages for msgid conflict with non-ASCII texts.

Changed:
  U   zope.tal/trunk/CHANGES.txt
  U   zope.tal/trunk/src/zope/tal/talgettext.py

-=-
Modified: zope.tal/trunk/CHANGES.txt
===================================================================
--- zope.tal/trunk/CHANGES.txt	2010-03-26 17:10:59 UTC (rev 110219)
+++ zope.tal/trunk/CHANGES.txt	2010-03-26 20:29:07 UTC (rev 110220)
@@ -5,7 +5,7 @@
 3.5.3 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- Fix printing of error messages for msgid conflict with non-ASCII texts.
 
 
 3.5.2 (2009-10-31)

Modified: zope.tal/trunk/src/zope/tal/talgettext.py
===================================================================
--- zope.tal/trunk/src/zope/tal/talgettext.py	2010-03-26 17:10:59 UTC (rev 110219)
+++ zope.tal/trunk/src/zope/tal/talgettext.py	2010-03-26 20:29:07 UTC (rev 110220)
@@ -133,10 +133,10 @@
             existing_msgid = msgids[idx]
             if msgid.default != existing_msgid.default:
                 references = '\n'.join([location[0]+':'+str(location[1]) for location in domain[msgid]])
-                print >> sys.stderr, "Warning: msgid '%s' in %s already exists " \
+                print >> sys.stderr, (u"Warning: msgid '%s' in %s already exists " \
                          "with a different default (bad: %s, should be: %s)\n" \
                          "The references for the existent value are:\n%s\n" % \
-                         (msgid, self.file+':'+str(position), msgid.default, existing_msgid.default, references)
+                         (msgid, self.file+':'+str(position), msgid.default.encode('utf-8'), existing_msgid.default.encode('utf-8'), references)).encode('utf-8')
         domain[msgid].append((self.file, position))
         return 'x'
 



More information about the checkins mailing list