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

Fix tests for python3 using decode() on pipe output #27

Merged
merged 6 commits into from
Jun 22, 2015

Conversation

eliasdorneles
Copy link
Contributor

Hey folks,

So, this needs more testing, it just adds some tricks to fix the current tests for Python 3, I'm not sure how much this means for Python 3 compatibility yet.

This basically just adds .decode() to the places where are expected bytes in Python 3 (pipe outputs) -- plus some minor refactorings.

The encoding should be ascii for all outputs, not sure if I should be explicit about it.

@kmike any advice here? :)

@kmike
Copy link
Member

kmike commented Jun 16, 2015

.decode() and .encode() use sys.getdefaultencoding() encoding, which is usually ASCII. For pipes it may be better to use sys.stdout.encoding / sys.stdin.encoding with some fallback for the cases these encodings are not set (utf8?).

@pablohoffman
Copy link
Contributor

who should merge this?

@eliasdorneles
Copy link
Contributor Author

@pablohoffman Ahm, allow me to apply Mike's advice first, and then you or @josericardo can review & merge.

You'd have to run the tests locally with tox, which will run them for python 3.
Travis is only running them for Python 2, perhaps I should enable python 3 tests as part of this PR?

@eliasdorneles eliasdorneles force-pushed the fixing-tests-for-python3 branch from 4a05b9e to 485ddd7 Compare June 21, 2015 04:51
@eliasdorneles
Copy link
Contributor Author

updated and rebased!

pablohoffman added a commit that referenced this pull request Jun 22, 2015
Fix tests for python3 using decode() on pipe output
@pablohoffman pablohoffman merged commit 7e45965 into master Jun 22, 2015
@josericardo josericardo deleted the fixing-tests-for-python3 branch November 30, 2015 18:55
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.

3 participants