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

Broken in Python 3.4 (rasbian latest) #1

Open
ryanhunt opened this issue Mar 6, 2017 · 2 comments
Open

Broken in Python 3.4 (rasbian latest) #1

ryanhunt opened this issue Mar 6, 2017 · 2 comments

Comments

@ryanhunt
Copy link

ryanhunt commented Mar 6, 2017

HI there.

I've got the lastest Rasbian (Debian for Raspberry Pi) build which includes Python 3.4.2. The packages I have install via pip3 are:

  • requests-2.13.0
  • telstra-sms-sdk-0.0.7

When using the sample code I get this error:

Traceback (most recent call last): File "./sendsms.py", line 3, in <module> from telstra_sms_sdk.sms import TelstraSMS File "/usr/local/lib/python3.4/dist-packages/telstra_sms_sdk/sms.py", line 56 print str(e) ^ SyntaxError: invalid syntax

@ryanhunt
Copy link
Author

ryanhunt commented Mar 7, 2017

Ok I figured out how to fix it.

Two changes required:

  1. Change all references of print str(e) to print(str(e))
  2. Change all references of json.loads(r.content) to json.loads(r.text)

@ryanhunt
Copy link
Author

ryanhunt commented Mar 7, 2017

Ok, I created a fork - fixed the bugs and extended it to support checking the status of sent messages, receiving replies and also checking user quota. I'd advise you review my code and merge with yours.

https://github.com/ryanhunt/telstra-sms-sdk

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

1 participant