Skip to content

import urlencode() from six.moves.urllib.parse instead of from urllib #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gitlab/v3/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
from __future__ import absolute_import
import base64
import json
import urllib
import warnings

import six
from six.moves import urllib

import gitlab
from gitlab.base import * # noqa
Expand Down Expand Up @@ -1841,7 +1841,7 @@ def repository_tree(self, path='', ref_name='', **kwargs):
url = "/projects/%s/repository/tree" % (self.id)
params = []
if path:
params.append(urllib.urlencode({'path': path}))
params.append(urllib.parse.urlencode({'path': path}))
if ref_name:
params.append("ref_name=%s" % ref_name)
if params:
Expand Down Expand Up @@ -1872,7 +1872,7 @@ def repository_blob(self, sha, filepath, streamed=False, action=None,
GitlabGetError: If the server fails to perform the request.
"""
url = "/projects/%s/repository/blobs/%s" % (self.id, sha)
url += '?%s' % (urllib.urlencode({'filepath': filepath}))
url += '?%s' % (urllib.parse.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)
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from __future__ import absolute_import
import base64
import json
import urllib

import six
from six.moves import urllib

import gitlab
from gitlab.base import * # noqa
Expand Down Expand Up @@ -1846,7 +1846,7 @@ def repository_tree(self, path='', ref='', **kwargs):
url = "/projects/%s/repository/tree" % (self.id)
params = []
if path:
params.append(urllib.urlencode({'path': path}))
params.append(urllib.parse.urlencode({'path': path}))
if ref:
params.append("ref=%s" % ref)
if params:
Expand Down