]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
cli: use urllib.escape on all URIs
authorBrian Warner <warner@lothar.com>
Thu, 11 Oct 2007 08:34:44 +0000 (01:34 -0700)
committerBrian Warner <warner@lothar.com>
Thu, 11 Oct 2007 08:34:44 +0000 (01:34 -0700)
src/allmydata/scripts/tahoe_get.py
src/allmydata/scripts/tahoe_ls.py
src/allmydata/scripts/tahoe_put.py
src/allmydata/scripts/tahoe_rm.py

index ddc18d2101c67ebc53a085b799bd6bb99eae1e30..c3fb9fddc6796c08b7511393e64bbfa126d80bbe 100644 (file)
@@ -5,7 +5,7 @@ import sys, urllib
 def get(nodeurl, root_uri, vdrive_fname, local_file):
     if nodeurl[-1] != "/":
         nodeurl += "/"
-    url = nodeurl + "uri/%s/" % root_uri.replace("/","!")
+    url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
     if vdrive_fname:
         url += vdrive_fname
 
index 21ad101730e36ee4a1da7b90782db3eb3ca27789..f36883fc1fc0afca7bde08400761e21d61ea9736 100644 (file)
@@ -6,7 +6,7 @@ import simplejson
 def list(nodeurl, root_uri, vdrive_pathname):
     if nodeurl[-1] != "/":
         nodeurl += "/"
-    url = nodeurl + "uri/%s/" % root_uri.replace("/","!")
+    url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
     if vdrive_pathname:
         url += vdrive_pathname
     url += "?t=json"
index 8089078dc47b7576b55ce788a31556fbc438ae6d..f88aae0406acc3fc501894c93ce08da4639a3bfc 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-import re, socket
+import re, socket, urllib
 
 NODEURL_RE=re.compile("http://([^:]*)(:([1-9][0-9]*))?")
 
@@ -14,7 +14,7 @@ def put(nodeurl, root_uri, local_fname, vdrive_fname, verbosity):
     host = mo.group(1)
     port = int(mo.group(3))
 
-    url = "/uri/%s/" % root_uri.replace("/","!")
+    url = "/uri/%s/" % urllib.quote(root_uri.replace("/","!"))
     if vdrive_fname:
         url += vdrive_fname
 
index ebd1ced0de4eebe4866518c90f5a74709161d518..06a9927118543f005fdf1ee0773171d5a69a23a1 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-import re, socket
+import re, socket, urllib
 
 NODEURL_RE=re.compile("http://([^:]*)(:([1-9][0-9]*))?")
 
@@ -14,7 +14,7 @@ def rm(nodeurl, root_uri, vdrive_pathname, verbosity):
     host = mo.group(1)
     port = int(mo.group(3))
 
-    url = "/uri/%s/" % root_uri.replace("/","!")
+    url = "/uri/%s/" % urllib.quote(root_uri.replace("/","!"))
     if vdrive_pathname:
         url += vdrive_pathname