Duplicity crashes with --exclude-older-than

Bug #1853655 reported by David Walker on 2019-11-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Medium
Unassigned

Bug Description

The development version of duplicity crashes when --exclude-older-than is included on the command line. The following trackback is from 0.8.03, although 0.8.07 behaves the same way. 0.7.19 works OK.

> duplicity --exclude-older-than 2019-03-17T19:50:06-07:00 / ~/NoBackup/DuplicityTest

Traceback (innermost last):
  File "/usr/bin/duplicity", line 1711, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1697, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1530, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib64/python3.7/site-packages/duplicity/commandline.py", line 1153, in ProcessCommandLine
    args = parse_cmdline_options(cmdline_list)
  File "/usr/lib64/python3.7/site-packages/duplicity/commandline.py", line 683, in parse_cmdline_options
    (options, args) = parser.parse_args(arglist)
  File "/usr/lib64/python3.7/optparse.py", line 1387, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib64/python3.7/optparse.py", line 1427, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib64/python3.7/optparse.py", line 1501, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib64/python3.7/optparse.py", line 785, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib64/python3.7/site-packages/duplicity/commandline.py", line 203, in take_action
    self, action, dest, opt, value, values, parser)
  File "/usr/lib64/python3.7/optparse.py", line 805, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/usr/lib64/python3.7/site-packages/duplicity/commandline.py", line 261, in add_selection
    select_opts.append((util.fsdecode(option), util.fsdecode(additional_arg)))
  File "/usr/lib64/python3.7/os.py", line 821, in fsdecode
    filename = fspath(filename) # Does type-checking of `filename`.
 TypeError: expected str, bytes or os.PathLike object, not int

I am using duplicity under openSUSE Tumbleweed, 20191119 snapshot, Python 2.7.17.

Changed in duplicity:
assignee: nobody → Kenneth Loafman (kenneth-loafman)
importance: Undecided → Medium
milestone: none → 0.8.08
status: New → In Progress

The traceback says you are running Python 3.7, not 2.7. Plus, it looks to be from an older version of duplicity. Please uninstall all versions of duplicity, especially those from the repo, then reinstall from one of the ones below. "sudo apt uninstall duplicity"

Do a 'which -a duplicity' to find if multiple versions are installed. Remove all. Look in /usr/lib64/pythonX.Y/site packages and remove any duplicity directory found.

* Release tarball Install - https://launchpad.net/duplicity/+download
* Daily duplicity builds - https://launchpad.net/~duplicity-team/+archive/ubuntu/daily-dev-trunk
* Stable snap builds - “sudo snap install duplicity —classic"

David Walker (w-david-n) wrote :

Thanks for the quick response!

I removed (the single instances of) duplicity and /usr/lib64/python*/site-packages/duplicity, and then installed from the duplicity-0.8.07.tar.gz tarball with "python setup.py install".

Sorry, no luck:

> duplicity --exclude-older-than 2019-03-17T19:50:06-07:00 / ~/NoBackup/DuplicityTest
Traceback (innermost last):
  File "/usr/bin/duplicity", line 101, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 87, in with_tempdir
    fn()
  File "/usr/lib64/python2.7/site-packages/duplicity/dup_main.py", line 1526, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib64/python2.7/site-packages/duplicity/commandline.py", line 1168, in ProcessCommandLine
    args = parse_cmdline_options(cmdline_list)
  File "/usr/lib64/python2.7/site-packages/duplicity/commandline.py", line 686, in parse_cmdline_options
    (options, args) = parser.parse_args(arglist)
  File "/usr/lib64/python2.7/optparse.py", line 1400, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib64/python2.7/optparse.py", line 1440, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib64/python2.7/optparse.py", line 1515, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib64/python2.7/optparse.py", line 789, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib64/python2.7/site-packages/duplicity/commandline.py", line 205, in take_action
    self, action, dest, opt, value, values, parser)
  File "/usr/lib64/python2.7/optparse.py", line 809, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/duplicity/commandline.py", line 263, in add_selection
    addarg = None if additional_arg is None else util.fsdecode(additional_arg)
  File "/usr/lib64/python2.7/site-packages/duplicity/util.py", line 74, in fsdecode
    return bytes_filename.decode(globals.fsencoding, u"replace")
 AttributeError: 'int' object has no attribute 'decode'

Changed in duplicity:
assignee: Kenneth Loafman (kenneth-loafman) → nobody
status: In Progress → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers