From: Brian Warner Date: Thu, 11 Oct 2007 08:34:44 +0000 (-0700) Subject: cli: use urllib.escape on all URIs X-Git-Tag: allmydata-tahoe-0.6.1~50 X-Git-Url: https://git.rkrishnan.org/quickstart.html?a=commitdiff_plain;h=a470947cc3bf00b5a9c08e8c93a078969815f27f;p=tahoe-lafs%2Ftahoe-lafs.git cli: use urllib.escape on all URIs --- diff --git a/src/allmydata/scripts/tahoe_get.py b/src/allmydata/scripts/tahoe_get.py index ddc18d21..c3fb9fdd 100644 --- a/src/allmydata/scripts/tahoe_get.py +++ b/src/allmydata/scripts/tahoe_get.py @@ -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 diff --git a/src/allmydata/scripts/tahoe_ls.py b/src/allmydata/scripts/tahoe_ls.py index 21ad1017..f36883fc 100644 --- a/src/allmydata/scripts/tahoe_ls.py +++ b/src/allmydata/scripts/tahoe_ls.py @@ -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" diff --git a/src/allmydata/scripts/tahoe_put.py b/src/allmydata/scripts/tahoe_put.py index 8089078d..f88aae04 100644 --- a/src/allmydata/scripts/tahoe_put.py +++ b/src/allmydata/scripts/tahoe_put.py @@ -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 diff --git a/src/allmydata/scripts/tahoe_rm.py b/src/allmydata/scripts/tahoe_rm.py index ebd1ced0..06a99271 100644 --- a/src/allmydata/scripts/tahoe_rm.py +++ b/src/allmydata/scripts/tahoe_rm.py @@ -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