Revision cf215a96
b/kamaki/clients/__init__.py | ||
---|---|---|
194 | 194 |
sendlog.info('perform a %s @ %s', method, self.base_url) |
195 | 195 |
|
196 | 196 |
self.http_client.url = self.base_url |
197 |
self.http_client.path = quote(path) |
|
197 |
self.http_client.path = quote(path.encode('utf8'))
|
|
198 | 198 |
r = self.http_client.perform_request( |
199 | 199 |
method, |
200 | 200 |
data, |
b/kamaki/clients/utils.py | ||
---|---|---|
87 | 87 |
:returns: (str) a path in the form /args[0]/args[1]/... |
88 | 88 |
""" |
89 | 89 |
|
90 |
path = '' |
|
91 |
for arg in args: |
|
92 |
suffix = '%s' % arg |
|
93 |
try: |
|
94 |
while suffix[0] == '/': |
|
95 |
suffix = suffix[1:] |
|
96 |
except IndexError: |
|
97 |
continue |
|
98 |
if len(path) > 0 and path[-1] == '/': |
|
99 |
path += suffix |
|
100 |
else: |
|
101 |
path += '/' + suffix |
|
102 |
return path |
|
90 |
return '/'.join([''] + [arg.decode('utf-8') if ( |
|
91 |
isinstance(arg, str)) else '%s' % arg for arg in args]) |
|
103 | 92 |
|
104 | 93 |
|
105 | 94 |
def params4url(params): |
Also available in: Unified diff