Make it work on python3

This would be nicer with a `try…except`:

```python
try:
    from urllib.parse import urlencode
except ImportError:
    from urllib import urlencode
```