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

use proper print() and except syntax to support python 3 #59

Merged
merged 4 commits into from
Aug 23, 2015

Conversation

MorrisJobke
Copy link
Contributor

This allows the usage in Python 3. I didn't tested everything, but this solved a lot of problems. It only contains two types of changes:

@MorrisJobke
Copy link
Contributor Author

cc @svanoort

From https://docs.python.org/3.0/whatsnew/3.0.html

The StringIO and cStringIO modules are gone. Instead, import the io module and use io.StringIO or io.BytesIO for text and data respectively.
@MorrisJobke
Copy link
Contributor Author

The tests run fine on python2.7: CodeforChemnitz/SensorAPI#1

I currently debug why they fail on python3.4+

@svanoort
Copy link
Owner

Thank you for taking the time to offer this!
It would be helpful (especially since python3 support is a necessary and helpful feature) and useful.
However, I do see it has merge conflicts at this time. Would it be possible to fix those, for the moment in order to allow a clean integration of changes?

Thanks,
Sam

@svanoort svanoort merged commit 4fb0e30 into svanoort:master Aug 23, 2015
@svanoort
Copy link
Owner

@MorrisJobke Note that there was a small bug with HTTP headers not being handled in a case-insensitive fashion before this, which I have fixed. Also I have resolved the merge conflict.

I'm holding off advertising full Python3 compatibility until I have automated test coverage included (it's on my to-do list with Jenkins testing of pyresttest). However this will be going out along with my next release!

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

Successfully merging this pull request may close these issues.

2 participants