ask/python-github2 — Issue #65: Problem of querystring encoding with username+api_token authentication
Author: twidi
Created: 2011-10-17 01:39:04+00:00
State: open

Hy

There is a problem when authenticating with username + api_token. I always have a authorization error from github.

It's a problem with the url

For example, with a print in `raw_request` i saw a url of the form

```
https://github.com/api/v2/json/repos/watched/twidi?login=twidi&token=my_api_token
```

I tried to simply replace `&` by `%26` and it's ok (with `url = url.replace(url, '&', '%26')`) :

```
https://github.com/api/v2/json/repos/watched/twidi?login=twidi%26token=my_api_token
```

I don't know too much about url encoding, but it seems that the `urlencode` in `encode_authentication_data` does not the wanted job :)

Do you know how to correct this ?

Thanks a lot for your help.