-
Notifications
You must be signed in to change notification settings - Fork 166
Open
Labels
api: storageIssues related to the googleapis/python-storage API.Issues related to the googleapis/python-storage API.
Description
bucket.move_blob not working with url encoded chars in blob name
getting NotFound: 404 POST https://storage.googleapis.com/storage/v1/b/[*bucket_name*]/o/test%2Fblob.csv/moveTo/o/test/blob2.csv?prettyPrint=false: Not Found
Base on the docs (https://cloud.google.com/storage/docs/copying-renaming-moving-objects#move-by-copying), the URL is not correctly encoded:
DESTINATION_OBJECT_NAME is the URL-encoded name you want to use. For example, pets/cat.png, URL-encoded as pets%2Fcat.png.
Environment details
- OS type and version: macOS Sequoia 15.6
- Python version: 3.12.9
- pip version: 24.0
google-cloud-storageversion: 3.3.0
Steps to reproduce
- Create a blob with "/" in the name
- try to move it with bucket.move_blob
Code example
from google.cloud import storage
gcs = storage.Client()
bucket = gcs.bucket("")
blob = bucket.get_blob("test/blob.csv")
bucket.move_blob(
blob,
new_name="test/blob2.csv"
)Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
thomasleveil, ComePICARD-MVG, gpaugam-mvg, mdesbois-mvg, ytigero-mvg and 1 more
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the googleapis/python-storage API.Issues related to the googleapis/python-storage API.