← Back to team overview

duplicity-team team mailing list archive

Re: [Merge] lp:~aaron-whitehouse/duplicity/fix_stat_errors into lp:duplicity

 


Diff comments:

> === modified file 'duplicity/selection.py'
> --- duplicity/selection.py	2016-06-06 12:36:01 +0000
> +++ duplicity/selection.py	2016-06-12 21:17:14 +0000
> @@ -143,20 +142,24 @@
>              for filename in robust.listpath(path):
>                  new_path = robust.check_common_error(
>                      error_handler, Path.append, (path, filename))
> -                # make sure file is read accessible
> -                if (new_path and new_path.type in ["reg", "dir"]
> -                        and not os.access(new_path.name, os.R_OK)):
> -                    log.Warn(_("Error accessing possibly locked file %s") % util.ufn(new_path.name),
> -                             log.WarningCode.cannot_read,
> -                             util.escape(new_path.name))
> -                    if diffdir.stats:
> -                        diffdir.stats.Errors += 1
> -                    new_path = None
> -                elif new_path:
> +                if new_path:
>                      s = self.Select(new_path)
> -                    if s == 1:
> +                    if (new_path.type in ["reg", "dir"] and

I'm not completely sure why this access test is restricted to just regular files and folders, but this is the behaviour that the test had before.

> +                        not os.access(new_path.name, os.R_OK)) and \
> +                            (s == 1 or s == 2):
> +                        # Path is a file or folder that cannot be read, but
> +                        # should be included or scanned.
> +                        log.Error(_("Error accessing possibly locked file %s") %
> +                                  util.ufn(new_path.name),
> +                                  log.WarningCode.cannot_read,
> +                                  util.escape(new_path.name))
> +                        if diffdir.stats:
> +                            diffdir.stats.Errors += 1
> +                    elif s == 1:
> +                        # Should be included
>                          yield (new_path, 0)
>                      elif s == 2 and new_path.isdir():
> +                        # Is a directory that should be scanned
>                          yield (new_path, 1)
>  
>          if not path.type:


-- 
https://code.launchpad.net/~aaron-whitehouse/duplicity/fix_stat_errors/+merge/297141
Your team duplicity-team is requested to review the proposed merge of lp:~aaron-whitehouse/duplicity/fix_stat_errors into lp:duplicity.


References