diff --git a/backend/dropbox/dropbox.go b/backend/dropbox/dropbox.go index bce405ec2..1b647af08 100644 --- a/backend/dropbox/dropbox.go +++ b/backend/dropbox/dropbox.go @@ -946,7 +946,7 @@ func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) (err error) if root == "/" { return errors.New("can't remove root directory") } - root = f.opt.Enc.FromStandardPath(root) + encRoot := f.opt.Enc.FromStandardPath(root) if check { // check directory exists @@ -957,7 +957,7 @@ func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) (err error) // check directory empty arg := files.ListFolderArg{ - Path: root, + Path: encRoot, Recursive: false, } if root == "/" { @@ -978,7 +978,7 @@ func (f *Fs) purgeCheck(ctx context.Context, dir string, check bool) (err error) // remove it err = f.pacer.Call(func() (bool, error) { - _, err = f.srv.DeleteV2(&files.DeleteArg{Path: root}) + _, err = f.srv.DeleteV2(&files.DeleteArg{Path: encRoot}) return shouldRetry(ctx, err) }) return err