Skip to content

Conversation

tobiasge
Copy link

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.

This changes fixes the import for cStringIO and ifilterfalse as intended
by pull request z4r#60. In this old pull request the import for
ifilterfalse is tried in the wrong direction for Python 2 and 3.
@andreyyudin
Copy link

This would be a useful fix for us as well.

@andreyyudin
Copy link

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'))

@andreyyudin
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants