Merge lp:~ed.so/duplicity/duplicity.helpfix into lp:duplicity/0.6

Proposed by edso
Status: Merged
Merged at revision: 859
Proposed branch: lp:~ed.so/duplicity/duplicity.helpfix
Merge into: lp:duplicity/0.6
Diff against target: 18 lines (+3/-3)
1 file modified
duplicity/commandline.py (+3/-3)
To merge this branch: bzr merge lp:~ed.so/duplicity/duplicity.helpfix
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+123611@code.launchpad.net

Description of the change

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

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity/commandline.py'
2--- duplicity/commandline.py 2012-05-16 11:03:20 +0000
3+++ duplicity/commandline.py 2012-09-10 17:58:19 +0000
4@@ -181,11 +181,11 @@
5 class OPHelpFix(optparse.OptionParser):
6 def _get_encoding(self, file):
7 """
8- try to get the encoding or switch to UTF-8
9+ try to get the encoding or use UTF-8
10 which is default encoding in python3 and most recent unixes
11 """
12- encoding = getattr(file, "encoding", "UTF-8")
13- return encoding
14+ encoding = getattr(file, "encoding", None)
15+ return encoding if encoding else 'utf-8'
16
17 def print_help(self, file=None):
18 """

Subscribers

People subscribed via source and target branches

to all changes: