martinp/pysnap — pull request #13 by ErasedMemories (2014-05-02 18:49:08+00:00)
Title: UnicodeDecodeError fix for Python 3.x

Fix for [issue #12](https://github.com/martinp/pysnap/issues/12).

I also changed `not xxx in yyy` to `xxx not in yyy` to remove a test error `E713 test for membership should be 'not in'`.

Note that both `test_login` and `test_logout` still fail with the following issue on Python 3.x, but I don't think this has anything to do with my modifications and is probably caused by an outdated `responses` package on my system :

======================================================================
ERROR: test_login (pysnap_tests.SnapchatTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/responses.py", line 106, in wrapped
return func(*args, **kwargs)
File "/home/username/pysnap/tests/pysnap_tests.py", line 50, in test_login
self.assertEqual({}, self.snapchat.login('eggs', 'spam'))
File "/home/username/pysnap/pysnap/__init__.py", line 100, in login
'password': password
File "/home/username/pysnap/pysnap/__init__.py", line 83, in _request
raise_for_status, req_type)
File "/home/username/pysnap/pysnap/utils.py", line 80, in request
headers=headers)
File "/usr/lib/python3.4/site-packages/requests/api.py", line 88, in post
return request('post', url, data=data, **kwargs)
File "/usr/lib/python3.4/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3.4/site-packages/requests/sessions.py", line 383, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.4/site-packages/responses.py", line 152, in _on_request
body=BufferIO(match['body']),
TypeError: 'str' does not support the buffer interface