summaryrefslogtreecommitdiff
path: root/gitlab/objects.py
diff options
context:
space:
mode:
authorYosi Zelensky <yosyos04@gmail.com>2017-05-22 08:25:17 +0300
committerGauvain Pocentek <gauvain@pocentek.net>2017-05-22 07:25:17 +0200
commitf3dfa6abcc0c6fba305072d368b223b102eb379f (patch)
tree33f373047c1b12f5c3775615a3a0f0ee10f6ed4a /gitlab/objects.py
parent324f81b0869ffb8f75a0c207d12138201d01b097 (diff)
downloadgitlab-f3dfa6abcc0c6fba305072d368b223b102eb379f.tar.gz
Fixed repository_tree and repository_blob path encoding (#265)
Diffstat (limited to 'gitlab/objects.py')
-rw-r--r--gitlab/objects.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 58eb867..0c3d30d 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -23,6 +23,7 @@ import copy
import itertools
import json
import sys
+import urllib
import warnings
import six
@@ -2348,7 +2349,7 @@ class Project(GitlabObject):
url = "/projects/%s/repository/tree" % (self.id)
params = []
if path:
- params.append("path=%s" % path)
+ params.append(urllib.urlencode({'path': path}))
if ref_name:
params.append("ref_name=%s" % ref_name)
if params:
@@ -2379,7 +2380,7 @@ class Project(GitlabObject):
GitlabGetError: If the server fails to perform the request.
"""
url = "/projects/%s/repository/blobs/%s" % (self.id, sha)
- url += '?filepath=%s' % (filepath)
+ url += '?%s' % (urllib.urlencode({'filepath': filepath}))
r = self.gitlab._raw_get(url, streamed=streamed, **kwargs)
raise_error_from_response(r, GitlabGetError)
return utils.response_content(r, streamed, action, chunk_size)