mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +00:00
cli: use urllib.escape on all URIs
This commit is contained in:
parent
5b28411b04
commit
a470947cc3
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user