--exclude-device-files and --exclude-other-filesystems options crashes

Bug #1846678 reported by Marc Dequènes (Duck)
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

Quack,

I'm using duplicity 0.8.04-2 on Debian unstable (Python 3.7.4).

Recently I got:
Traceback (innermost last):
  File "/usr/bin/duplicity", line 107, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 93, in with_tempdir
    fn()
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 1522, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 1166, in ProcessCommandLine
    args = parse_cmdline_options(cmdline_list)
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 684, in parse_cmdline_options
    (options, args) = parser.parse_args(arglist)
  File "/usr/lib/python3.7/optparse.py", line 1387, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python3.7/optparse.py", line 1427, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python3.7/optparse.py", line 1501, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python3.7/optparse.py", line 785, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 203, in take_action
    self, action, dest, opt, value, values, parser)
  File "/usr/lib/python3.7/optparse.py", line 805, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 262, in add_selection
    select_opts.append((util.fsdecode(option), util.fsdecode(additional_arg)))
  File "/usr/lib/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 NoneType

Printing the `option` variable I got --exclude-device-files and --exclude-other-filesystems. As they do not take arguments I guess they should not use the `add_selection` callback but I'm not sure what it should do instead so I cannot provide a patch yet. Seems `ParseArgs()` is parsing options again, so maybe nothing is needed at this stage.

\_o<

Revision history for this message
François Marier (fmarier) wrote :

I also noticed the same problem. Here's a minimal test case that demonstrates the problem:

mkdir -p /tmp/duplicity-test/a
cd /tmp/duplicity-test/
touch a/one
touch a/two
mkdir b

PASSPHRASE=password duplicity --exclude-device-files a/ file:///tmp/duplicity-test/b

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.8.05
status: New → Fix Committed
Changed in duplicity:
status: Fix Committed → 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.