Closed pcara closed 4 years ago
Thanks. I was unaware that spaces in remote names was supported by rclone. May be simple fix, but... there are some corner cases that need to be checked.
Fixed in V3.2
Thank you very much Chris!!
On Tue, 01 Dec 2020 23:03:37 -0800 Chris notifications@github.com wrote:
Fixed in V3.2
Thank you for rclonesync! It is a great and very useful addition to rclone.
rclone allows one to use spaces in names of remotes.
However when one uses these with rclonesync you get a strange error like in
rclonesync-V2/rclonesync "Dropbox Vertigo":myfiles ~/Vertigo Traceback (most recent call last): File "rclonesync-V2/rclonesync", line 864, in <module> path1_base = pathparse(args.Path1) File "rclonesync-V2/rclonesync", line 858, in pathparse if not os.path.exists(path_base): UnboundLocalError: local variable 'path_base' referenced before assignment
It took me some time to find out what exactly was going wrong.This specific error could be fixed by also allwoing spaces in the regular expression
path_FORMAT = re.compile(r'([\w-]+):(.*)')
Moreover: The rclonesync script does not recognise rclone remotes with spaces in their name, it splits them at the spaces into different remotes. Seeclouds = subprocess.check_output([rclone, "listremotes", "--config", rcconfig]).decode("utf8").split()
I think split() also uses spaces as separators.The short fix for this is of course to make sure you don't use spaces when naming rclone remotes. A warning could be issued when one attempts rclonesync with a remote containing a space and one could include this in the documentation.