duplicity-team team mailing list archive
-
duplicity-team team
-
Mailing list archive
-
Message #01264
[Merge] lp:~ed.so/duplicity/duplicity.helpfix into lp:duplicity
edso has proposed merging lp:~ed.so/duplicity/duplicity.helpfix into lp:duplicity.
Requested reviews:
duplicity-team (duplicity-team)
For more details, see:
https://code.launchpad.net/~ed.so/duplicity/duplicity.helpfix/+merge/123611
ix rare 'TypeError: encode() argument 1 must be string, not None'
read here
http://lists.nongnu.org/archive/html/duplicity-talk/2012-09/msg00016.html
--
https://code.launchpad.net/~ed.so/duplicity/duplicity.helpfix/+merge/123611
Your team duplicity-team is requested to review the proposed merge of lp:~ed.so/duplicity/duplicity.helpfix into lp:duplicity.
=== modified file 'duplicity/commandline.py'
--- duplicity/commandline.py 2012-05-16 11:03:20 +0000
+++ duplicity/commandline.py 2012-09-10 17:58:19 +0000
@@ -181,11 +181,11 @@
class OPHelpFix(optparse.OptionParser):
def _get_encoding(self, file):
"""
- try to get the encoding or switch to UTF-8
+ try to get the encoding or use UTF-8
which is default encoding in python3 and most recent unixes
"""
- encoding = getattr(file, "encoding", "UTF-8")
- return encoding
+ encoding = getattr(file, "encoding", None)
+ return encoding if encoding else 'utf-8'
def print_help(self, file=None):
"""
Follow ups