Skip to content

Commit b815f3a

Browse files
author
Gauvain Pocentek
committed
'path' is an existing gitlab attr, don't use it
Use path_ instead of path as parameter name for methods using it. Otherwise it might conflict with GitlabObject attributes.
1 parent c08c913 commit b815f3a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

gitlab/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,11 @@ def enable_debug(self):
338338
requests_log.setLevel(logging.DEBUG)
339339
requests_log.propagate = True
340340

341-
def _raw_get(self, path, content_type=None, streamed=False, **kwargs):
342-
if path.startswith('http://') or path.startswith('https://'):
343-
url = path
341+
def _raw_get(self, path_, content_type=None, streamed=False, **kwargs):
342+
if path_.startswith('http://') or path_.startswith('https://'):
343+
url = path_
344344
else:
345-
url = '%s%s' % (self._url, path)
345+
url = '%s%s' % (self._url, path_)
346346

347347
headers = self._create_headers(content_type)
348348
try:
@@ -359,13 +359,13 @@ def _raw_get(self, path, content_type=None, streamed=False, **kwargs):
359359
raise GitlabConnectionError(
360360
"Can't connect to GitLab server (%s)" % e)
361361

362-
def _raw_list(self, path, cls, extra_attrs={}, **kwargs):
362+
def _raw_list(self, path_, cls, extra_attrs={}, **kwargs):
363363
params = extra_attrs.copy()
364364
params.update(kwargs.copy())
365365

366366
get_all_results = kwargs.get('all', False)
367367

368-
r = self._raw_get(path, **params)
368+
r = self._raw_get(path_, **params)
369369
raise_error_from_response(r, GitlabListError)
370370

371371
# Remove parameters from kwargs before passing it to constructor
@@ -374,7 +374,7 @@ def _raw_list(self, path, cls, extra_attrs={}, **kwargs):
374374
del params[key]
375375

376376
# Add _from_api manually, because we are not creating objects
377-
# through normal path
377+
# through normal path_
378378
params['_from_api'] = True
379379

380380
results = [cls(self, item, **params) for item in r.json()
@@ -386,8 +386,8 @@ def _raw_list(self, path, cls, extra_attrs={}, **kwargs):
386386
results.extend(self.list(cls, **args))
387387
return results
388388

389-
def _raw_post(self, path, data=None, content_type=None, **kwargs):
390-
url = '%s%s' % (self._url, path)
389+
def _raw_post(self, path_, data=None, content_type=None, **kwargs):
390+
url = '%s%s' % (self._url, path_)
391391
headers = self._create_headers(content_type)
392392
try:
393393
return self.session.post(url, params=kwargs, data=data,
@@ -401,8 +401,8 @@ def _raw_post(self, path, data=None, content_type=None, **kwargs):
401401
raise GitlabConnectionError(
402402
"Can't connect to GitLab server (%s)" % e)
403403

404-
def _raw_put(self, path, data=None, content_type=None, **kwargs):
405-
url = '%s%s' % (self._url, path)
404+
def _raw_put(self, path_, data=None, content_type=None, **kwargs):
405+
url = '%s%s' % (self._url, path_)
406406
headers = self._create_headers(content_type)
407407

408408
try:
@@ -417,8 +417,8 @@ def _raw_put(self, path, data=None, content_type=None, **kwargs):
417417
raise GitlabConnectionError(
418418
"Can't connect to GitLab server (%s)" % e)
419419

420-
def _raw_delete(self, path, content_type=None, **kwargs):
421-
url = '%s%s' % (self._url, path)
420+
def _raw_delete(self, path_, content_type=None, **kwargs):
421+
url = '%s%s' % (self._url, path_)
422422
headers = self._create_headers(content_type)
423423

424424
try:

0 commit comments

Comments
 (0)