doctormo / python-gitlab3

Python wrapper for the entire GitLab API
GNU Lesser General Public License v3.0
46 stars 25 forks source link

Does not work with GitLab 6.4.3 #10

Closed samrocketman closed 10 years ago

samrocketman commented 10 years ago
>>> import gitlab3
>>> git=gitlab.GitLab('https://gitlab.example.com/','abcdefg_token')
>>> git.find_user(username="sag47")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/gitlab3-0.5.2-py2.7.egg/gitlab3/__init__.py", line 145, in fn
    return _find_matches(objects, kwargs, find_all)
  File "/usr/local/lib/python2.7/dist-packages/gitlab3-0.5.2-py2.7.egg/gitlab3/__init__.py", line 103, in _find_matches
    for obj in objects:
  File "/usr/local/lib/python2.7/dist-packages/gitlab3-0.5.2-py2.7.egg/gitlab3/__init__.py", line 57, in _query_list
    yield api_cls(parent, obj)
  File "/usr/local/lib/python2.7/dist-packages/gitlab3-0.5.2-py2.7.egg/gitlab3/__init__.py", line 316, in __init__
    self._convert_dates(json_data)
  File "/usr/local/lib/python2.7/dist-packages/gitlab3-0.5.2-py2.7.egg/gitlab3/__init__.py", line 343, in _convert_dates
    data[key] = self._convert_gitlab_date(val)
  File "/usr/local/lib/python2.7/dist-packages/gitlab3-0.5.2-py2.7.egg/gitlab3/__init__.py", line 354, in _convert_gitlab_date
    dt = datetime.strptime(datetime_str, fmt)
  File "/usr/lib/python2.7/_strptime.py", line 328, in _strptime
    data_string[found.end():])
ValueError: unconverted data remains: .000

I get that for functions which previously worked. It's been a while since I've picked this up so I can only assume the API has changed enough that your lib no longer works.

samrocketman commented 10 years ago

The returned object after you finish stripping is... 2013-09-03T17:02:57.000.

samrocketman commented 10 years ago

I have tested f0c4da4f3d18e15f52de28decfb0eefb82f9508c and it works! Thanks @alexvh.