Skip to content
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

Python3 AfricasTalkingGateway.py Changes #6

Closed
mkn2016 opened this issue Mar 17, 2017 · 2 comments
Closed

Python3 AfricasTalkingGateway.py Changes #6

mkn2016 opened this issue Mar 17, 2017 · 2 comments

Comments

@mkn2016
Copy link

mkn2016 commented Mar 17, 2017

AfricastalkingGateway.py Fixes

  • line 227 of AfricasTalkingGateway.py - changed print(response) instead of print response.

  • import urllib2 is depracted in python3. The urllib2 and urllib in python2.x were combined and split across various modules in python3. Instead of:
    import urllib2
    import urllib
    `

For python3:
from urllib.request import Request, urlopen from urllib.parse import urlencode

You can try wrapping it in a try-except block to check for both. e.g
try: from urllib.request import urlopen except: from urllib2 import urlopen
After doing this, it works. Danke!

@ianjuma
Copy link
Contributor

ianjuma commented Mar 17, 2017

submit a PR maybe?

@ianjuma ianjuma closed this as completed Mar 17, 2017
@ianjuma
Copy link
Contributor

ianjuma commented Mar 31, 2017

Hi @mkn2016 the library has moved to requests; it's updated on PyPI as 1.7

Please update.

@ianjuma ianjuma reopened this Mar 31, 2017
@ianjuma ianjuma closed this as completed Apr 10, 2017
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

No branches or pull requests

2 participants