FilePrefixError on all --exclude

Bug #1849335 reported by Jay Bienvenu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
New
Undecided
Unassigned

Bug Description

I'm getting this error for the --exclude option, no matter what I specify to exclude and even if I --exclude-filelist. Here's an example of my trace. I'm using duplicity 0.7.17, Ubuntu 18.04.3 LTS, Python 2.7.15+.

> duplicity --exclude .git ~/source_folder file:///target
Traceback (innermost last):
  File "/usr/bin/duplicity", line 1555, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1541, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1380, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1149, in ProcessCommandLine
    set_selection()
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 973, in set_selection
    sel.ParseArgs(select_opts, select_files)
  File "/usr/lib/python2.7/dist-packages/duplicity/selection.py", line 250, in ParseArgs
    self.add_selection_func(self.glob_get_sf(arg, 0))
  File "/usr/lib/python2.7/dist-packages/duplicity/selection.py", line 434, in glob_get_sf
    sel_func = self.glob_get_filename_sf(glob_str, include)
  File "/usr/lib/python2.7/dist-packages/duplicity/selection.py", line 502, in glob_get_filename_sf
    raise FilePrefixError(filename)
 FilePrefixError: .git

> duplicity -v9
Command line error: Expected 2 args, got 0
Enter 'duplicity --help' for help screen.
Using temporary directory /tmp/duplicity-oupQbS-tempdir

Revision history for this message
Matthijs Kooijman (matthijskooijman) wrote :

This error means that the source you're backing up (`~/source_folder` is not a prefix of your exclude `.git`). Really that means that excludes should always match the full path, not just a single component. If you want to exclude all files/directories called .git, you could instead specify `--exclude **/.git` to specify all filenames where the last part is `.git`.

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.