duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Duplicity-talk] [PATCH] --help with non-ascii system locale


From: Wolfgang
Subject: [Duplicity-talk] [PATCH] --help with non-ascii system locale
Date: Mon, 10 Oct 2011 01:26:35 +0200
User-agent: KMail/4.7.2 (Linux/3.0.0-12-generic; KDE/4.7.1; x86_64; ; )

  File "/usr/lib/python2.7/optparse.py", line 1669, in print_help
    file.write(self.format_help().encode(encoding, "replace"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2114: 
ordinal not in range(128)

this is duplicity 0.6.15

LANG is de_DE.UTF-8

the help string passed to optparse is type str, containing utf-8 text.
The bug disappears if I change /usr/lib/python2.7/optparse.py:

-        file.write(self.format_help().encode(encoding, "replace"))
+        file.write(self.format_help().decode('utf-8').encode(encoding, 
"replace"))

but that is of course not the right fix.

I found some hints about possible solutions but did not try to fix
it myself at this link:

http://stackoverflow.com/questions/5545197/utf-8-error-with-python-and-gettext

-- 
Wolfgang



reply via email to

[Prev in Thread] Current Thread [Next in Thread]