Make discogs_client python 2 & python 3 compatible #43
Conversation
provide a "if __main__ == '__main__'" at the bottom of each test module so they can be executed by themselves: $ python discogs_client/tests/test_module.py [optional Class.test_name]
Python 2 & 3 compatibility. Memory usage may slightly increase in python 2.
Introduce a new dependency: six
oauth2 package is python2-only while oauthlib is compatible with python 2 & 3.
parse_qs() result is non-detereministic → a different file might be requested, making the tests fail randomnly. This commit brings symlinks for all potential targets of the tests, thus fixing them.
It is required by the OAuth spec and it was missing.
That's one dirty solution. The real fix would be dropping support for python 2.6 though.
Nice! Thanks for the update, @brunal! 👍 from me. |
@brunal looks like there's an issue with Python 3:
Could you update |
utf8-decoding the (json) response happens right before parsing it. Adapt several fetch() implementations, update test data and improve fetch() docstring.
That issue is now fixed! I hoped there's not more of them lying hidden. I added python 3.{2,3,4} on travis. I took the decision of making |
Hey @brunal, I just tried walking through the OAuth process on the README (using Python 2), but I get an error on the Thanks, |
Done! |
Hi, Do you plan on merging it? Otherwise we might have to use my fork for beets |
Thanks @brunal I'll look over this one today! |
Following the steps on the README using Python 2.7.6, I get this error when trying to execute
The release was successfully added to my wantlist, but this error does not show on master. |
Even if it's json use application/x-www-form-urlencoded and never application/json.
Data shall only contain strings as per oauthlib request.
The error message was actually incorrect: the Content-type was |
Great, looks good so far! Although now you must pass |
That was not necessary, but preferable in case the verifier contains non-ascii characters - which is not the case. I removed it! |
@brunal Perfect! Unless any of the other Discogs devs find issues within the week, I'll merge this on Friday. I hope that's alright. Thanks again for the great work on this! 🍻 |
Make discogs_client python 2 & python 3 compatible
Cool :-) It's been my pleasure. |
This PR makes
discogs_client
python 2 and python 3 compatible.Notables changes include: