From 668711e43213bc9464c0b25c88621cd987898f08 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 21 Nov 2023 12:18:49 +0000 Subject: [PATCH] dropbox: fix missing encoding for rclone purge again This commit fixed the problem but made the integration tests fail. 33376bf3999cb107 dropbox: fix missing encoding for rclone purge This fixes the problem properly by making sure we send the encoded or non encoded root to the right places. --- backend/dropbox/dropbox.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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