Itxaka/pyapi-gitlab — pull request #70 by stefan-it (2014-04-05 11:18:01+00:00)
Title: Fixes TypeError on Python 3.x when project limit is set to 0.

I tested the *createproject* function on the public GitLab instance from demo.gitlab.com. The project limit there is set to 0.

Using Python 2.7 with this sample code:

```python
import gitlab
host = "http://demo.gitlab.com"
git = gitlab.Gitlab(host)
git.login("user", "password") # see login info here: http://demo.gitlab.com/users/sign_in
git.createproject("pyapi-gitlab", "Tests for GitLab API")
```

It returns: ```{"error":["Your own projects limit is 0! Please contact administrator to increase it"]}```

But when using Python 3.x (I tested it with Python 3.3 and 3.4) the following error message is returned:

```bash
if "Your own projects limit is 0" in request.content:
TypeError: Type str doesn't support the buffer API
```

For fixing that issue, see patch below :) It works both under Python 2.7 and Python 3.3/3.4 (and the corresponding *requests* module, on openSUSE 13.1 + Arch).