UnicodeDecodeError: 'ascii' codec can't decode byte... errorson OS XX

Matt Mackall mpm at selenic.com
Fri Aug 23 16:48:53 UTC 2013


On Fri, 2013-08-23 at 15:01 +0200, Matthias Pigulla wrote:
> Am 23.08.13 01:57 schrieb "Sean Farley" unter
> <sean.michael.farley at gmail.com>:
> >
> >Unfortunately, I can't reproduce the error :-( Try Matt's suggestion
> >of disabling the extensions and we'll go from there.
> 
> No, problem persists.
> 
> Any idea how/where I could amend every message handled/processed by
> gettext with debugging information in a way that we could see how an
> already localized message made it into gettext calls as msgid again?

Maybe something like this:

diff -r 6ac206fb6f27 mercurial/i18n.py
--- a/mercurial/i18n.py	Thu Aug 15 21:36:53 2013 -0400
+++ b/mercurial/i18n.py	Fri Aug 23 11:48:43 2013 -0500
@@ -36,6 +36,13 @@
     if message is None:
         return message
 
+    if message.startswith('@'):
+        print "whoa!", message
+
+    frame = sys._getframe(1)
+    pos = "@%s:%s\n" % (frame.f_code.co_filename, frame.f_lineno)
+    message = pos + message
+
     paragraphs = message.split('\n\n')
     # Be careful not to translate the empty string -- it holds the
     # meta data of the .po file.

You might need to adjust that '1' to go further up the stack.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list