GoogleCloudPlatform / GoogleCloudPlatform/gsutil

rsync "Error opening file" exception when filename or directory has a + (plus sign) in it

Open
#851 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

My rsync command fails with:

`"CommandException: Error opening file "file:///Volumes/Drive/Docs/1 1.doc": [Errno 2] No such file or directory: u'/Volumes/Drive/Docs/1 1.doc'"`

The actual filename of the file referred to in the exception is:
`/Volumes/Drive/Docs/1 + 1.doc`

Here's the exact command I'm running:
`gsutil -m rsync -d -r /Volumes/Drive/ gs://my-bucket/`

It looks like the plus sign is being substituted with a space character whenever gsutil builds its sync list. My guess is that this has something to do with the fact that the plus sign is a special character in regex?

I would be happy to put together a PR and test if someone could at least point me in the general right direction in the code. My guess is that it's sub

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported gsutil -m rsync command with a filename containing a plus sign, then trace how the local sync list is built. Done means the plus sign remains part of the filename and the rsync operation completes without the file-opening exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.