-
Notifications
You must be signed in to change notification settings - Fork 6
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 supported version #4
base: master
Are you sure you want to change the base?
Python3 supported version #4
Conversation
Hello Miral, I am from Paubox team and I have below feedback points after reviewing your PR:
Have you run test cases successfully for entire SDK after integrating PR changes on v2.7, v3.0 and v3.6? Please let us know your feedback on above questions. Regards, |
Hi Vighnesh, Thanks for the feedback.
Thanks, |
Hi Miral, I have run the SDK with your changes on Python v3.0 and v3.6 and I have not been able to successfully run the SDK unit tests. Would you please share your test results? Also, have you tried a scenario with attachment file? SDK breaks on v3.6 when attachment is added to the API request. Below is the error log:
|
I had also tried to setup python 3 with pip on my machine, but unable to install pip. How have you done setup for Python SDK for v3.0? |
For reference, I have forked your SDK and have it working in a python3 project. I used most of the changes in this PR except the requests library as I already had it as part of the project. The error you are seeing above Vighnesh is from helpers/mail.py lines 51-56. There is no need to encode the html in python3. I've removed those lines for my project, but if you want to keep python2/3 compatible you should probably put in a conditional. Hope that helps. |
The issue in helpers.mail is that python3 doesn't have an equivalent to basestring, and six.string_types is (basestring,) in py2, and (str,) in py3. Those are not equivalent. Py2 basestring will match bytes and text, Py3 str will not. Despite the difference in meaning, the 2to3 conversion code will blindly convert basestring to str and break things. And the maintainers have no interest whatsoever in fixing that The closest equivalent in py3 would be (bytes, str) (cherrypy uses that, among others). It would be better to just set basestring to (str, bytes) if in Py3, because six won't let you do what you want here. |
Hey folks, The @Paubox engineering team released a Python 3-specific SDK for the Paubox Email API, and that repository can be found here: |
No description provided.