You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Docker to run Jupyter Notebook on Mac OS Mojave 10.14.13 and "Appendix B - OAuth Primer" section "Example 2. Facebook OAuth 2.0 Flow" can't compile and generate the following error:
urllib has been split up in Python 3. The urllib.urlencode() function is now urllib.parse.urlencode(), and the urllib.urlopen() function is now urllib.request.urlopen().
By changing line 64 oauth_url = 'https://facebook.com/dialog/oauth?' + urllib.urlencode(args) to oauth_url = 'https://facebook.com/dialog/oauth?' + urllib.parse.urlencode(args) the error goes away.
The text was updated successfully, but these errors were encountered:
Hi @uzabumuhire -- Thanks for catching these holdovers from Python 2. I've now changed
urllib.urlencode() to urllib.parse.urlencode(), which is the correct way to call it in Python 3.
I've removed firends_likes from the EXTENDED_PERMS list. Facebook has removed that permission from the API, so we can't make use of it anymore.
I've tested the code on my end and got it to run successfully. Please let me know if you have any other problems with it. I will close this issue for now.
why i cant use urllib2 ? i use import urllib.request as urllib2 ........ but when i want to use , it gaves me lots of error , for example it gaves me some attribute errors !!!
I am using Docker to run Jupyter Notebook on Mac OS Mojave 10.14.13 and "Appendix B - OAuth Primer" section "Example 2. Facebook OAuth 2.0 Flow" can't compile and generate the following error:
To resolve the issue I have found help on this Stack Overflow link https://stackoverflow.com/questions/28906859/module-has-no-attribute-urlencode and their proposed solution is :
By changing line 64
oauth_url = 'https://facebook.com/dialog/oauth?' + urllib.urlencode(args)
tooauth_url = 'https://facebook.com/dialog/oauth?' + urllib.parse.urlencode(args)
the error goes away.The text was updated successfully, but these errors were encountered: