Skip to content

Commit 34d5e3f

Browse files
committed
Fixed error where slashes mess up the object name.
1 parent 3da8be7 commit 34d5e3f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gcloud/storage/key.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import mimetypes
44
import os
55
from StringIO import StringIO
6+
import urllib
67

78
from gcloud.storage.acl import ObjectACL
89
from gcloud.storage.iterator import KeyDataIterator
@@ -90,7 +91,8 @@ def path(self):
9091
elif not self.name:
9192
raise ValueError('Cannot determine path without a key name.')
9293

93-
return self.bucket.path + '/o/' + self.name
94+
# Slashes (/) aren't safe in this part of the URL.
95+
return self.bucket.path + '/o/' + urllib.quote(self.name, '')
9496

9597
@property
9698
def public_url(self):

0 commit comments

Comments
 (0)