duplicity --short-filenames crashes with TypeError

Bug #589495 reported by Albert Y. C. Lai
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned
Nominated for 0.6 by Olivier Berger
Debian
Fix Released
Unknown
duplicity (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

ubuntu 10.04
duplicity version 0.6.08b from ubuntu 10.04
Python 2.6.5 from ubuntu 10.04
filesystem ext4

duplicity -v9 --short-filenames /usr/share/doc/duplicity file:///tmp

Using temporary directory /tmp/duplicity-60Hb6y-tempdir
Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1239, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1232, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1118, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.6/dist-packages/duplicity/commandline.py", line 878, in ProcessCommandLine
    args = parse_cmdline_options(cmdline_list)
  File "/usr/lib/python2.6/dist-packages/duplicity/commandline.py", line 452, in parse_cmdline_options
    (options, args) = parser.parse_args()
  File "/usr/lib/python2.6/optparse.py", line 1394, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.6/optparse.py", line 1434, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python2.6/optparse.py", line 1509, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python2.6/optparse.py", line 788, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.6/dist-packages/duplicity/commandline.py", line 169, in take_action
    self, action, dest, opt, value, values, parser)
  File "/usr/lib/python2.6/optparse.py", line 808, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/duplicity/commandline.py", line 403, in <lambda>
    callback=lambda o, s, v, p: (setattr(p.values, o.dest, True),
TypeError: attribute name must be string, not 'NoneType'

Tags: patch
Revision history for this message
Olivier Berger (olivierberger) wrote :

I think the following patch may fix the parsing issue... but I'm not completely sure it's safe :-/

=== modified file 'duplicity/commandline.py'
--- duplicity/commandline.py 2010-08-26 14:11:14 +0000
+++ duplicity/commandline.py 2010-09-05 14:55:07 +0000
@@ -403,7 +403,7 @@
     parser.add_option("--sftp-command", metavar=_("command"))

     # If set, use short (< 30 char) filenames for all the remote files.
- parser.add_option("--short-filenames", action="callback",
+ parser.add_option("--short-filenames", action="callback", dest="short_filenames",
                       callback=lambda o, s, v, p: (setattr(p.values, o.dest, True),
                                                    old_fn_deprecation(s)))

Changed in duplicity:
status: New → Confirmed
Revision history for this message
Olivier Berger (olivierberger) wrote :

Also, similar fix should probably be applied to --old-filenames which uses same construct.

I'm not so sure about --ignore-errors which also seems to use setattr(p.values, o.dest, True) without adding a 'dest' param to parser.add_option either

Revision history for this message
az (az-debian) wrote :

i've just applied the following patch to the Debian version. i think the patch covers all spots where
callbacks without dest might foul the parser.

Changed in duplicity:
importance: Undecided → Medium
assignee: nobody → Kenneth Loafman (kenneth-loafman)
status: Confirmed → In Progress
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Applied patch from az above.

Changed in duplicity:
assignee: Kenneth Loafman (kenneth-loafman) → nobody
milestone: none → 0.6.10
status: In Progress → Fix Committed
Revision history for this message
Daniel Hahler (blueyed) wrote :

Kenneth, do you have a 0.6.10 release planned in the next days?

I think this should get both into the next release of Debian and Ubuntu.
Ubuntu should sync from Debian, once it gets uploaded there.

Changed in duplicity (Ubuntu):
status: New → Triaged
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote : Re: [Bug 589495] Re: duplicity --short-filenames crashes with TypeError

I will try to get it out by the weekend. Is that soon enough?

...Ken

Daniel Hahler wrote:
> Kenneth, do you have a 0.6.10 release planned in the next days?
>
> I think this should get both into the next release of Debian and Ubuntu.
> Ubuntu should sync from Debian, once it gets uploaded there.
>
> ** Also affects: duplicity (Ubuntu)
> Importance: Undecided
> Status: New
>
> ** Changed in: duplicity (Ubuntu)
> Status: New => Triaged
>
>

Changed in duplicity:
status: Fix Committed → Fix Released
tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package duplicity - 0.6.10-0ubuntu1

---------------
duplicity (0.6.10-0ubuntu1) maverick; urgency=low

  * New upstream release
    - Fixes crash when using --short-filenames (LP: #589495)
  * debian/patches/03forcecleanup.dpatch: Updated to apply
  * debian/patches/04fixparsed_url.dpatch: Dropped, applied upstream
 -- Michael Terry <email address hidden> Sun, 19 Sep 2010 20:36:24 -0400

Changed in duplicity (Ubuntu):
status: Triaged → Fix Released
Changed in debian:
status: Unknown → Confirmed
Changed in debian:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.