Open tobiasge opened 5 years ago
This would be a useful fix for us as well.
Another issue has popped up and I have been wondering if you have it as well since you are adding support to Python 3:
File "lib/python3.7/site-packages/rtkit/authenticators.py", line 127, in _login
urllib2.Request(self.url, urlencode(data))
File "lib/python3.7/urllib/request.py", line 523, in open
req = meth(req)
File "lib/python3.7/urllib/request.py", line 1247, in do_request_
raise TypeError(msg)
TypeError: POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str.
This can be solved by changing
urllib2.Request(self.url, urlencode(data))
to
urllib2.Request(self.url, urlencode(data).encode('utf-8'))
Oh and there is also a problem with unicode checks in rtkit/forms.py that can be solved by doing a check on Python version.
(perhaps, I should just make a pull request once I get rtkit working)
This changes fixes the import for cStringIO and ifilterfalse as intended by pull request #60. In this old pull request the import for ifilterfalse is tried in the wrong direction for Python 2 and 3.