-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
401 Unauthorized on Python 3.3 #1
Comments
In case it wasn't clear, I'm supplying a valid API key in line 9. |
The issue lies with wordnik.swagger in the MethodRequest class. Only on Python 3.3, for any request where the method isn't specified, get_method returns the empty string. This was a defect I identified in Python 3.3 and which I patched for Python 3.4. |
In jaraco.net, I've developed a more robust MethodRequest that works on multiple Python versions, including 3.3:
Consider using that technique in Wordnik. |
Even that implementation has problems in some cases on some Pythons. I've put together a backports library: backports.method_request which is tested on Python 2.6+. Consider using that library or copying that code into Wordnik3. |
At this point, I'd just recommend dropping support for Python 3.3 and earlier. |
I tested the library on Python 3.4, and it seems to be working. I then deployed it on a system running Python 3.3 and I get 401 Unauthorized errors. Consider this test script:
If I have the wordnik-py3 2.1.2 eggs for Python 3.3 and Python 3.4 in the current directory, I can then run the above script for each. On Python 3.4, it passes without error. On Python 3.3, I get this traceback:
I'm using the exact same script, so the difference appears to be in how WordNik assembles the HTTP request on Python 3.3, somehow triggering the 401.
The text was updated successfully, but these errors were encountered: