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

Small changes to print statement function in order to work with py3k. #704

Merged
merged 3 commits into from Sep 9, 2012

Conversation

Projects
None yet
4 participants
@pr0gg3d

pr0gg3d commented Aug 14, 2012

Installing fabric with python3 (via pip) fails because some old print statements.

I have changed the code in order to port all print as functions and using future import for backwards compatibility.

Hope this helps to port fabric to py3k.

Thanks.

@travisbot

This comment has been minimized.

travisbot commented Aug 14, 2012

This pull request fails (merged e525429 into e005cb6).

@travisbot

This comment has been minimized.

travisbot commented Aug 14, 2012

This pull request fails (merged 18e5996 into e005cb6).

@travisbot

This comment has been minimized.

travisbot commented Aug 14, 2012

This pull request passes (merged 082473b into e005cb6).

@pr0gg3d pr0gg3d closed this Aug 14, 2012

@bitprophet

This comment has been minimized.

Member

bitprophet commented Aug 15, 2012

@pr0gg3d did you mean to close this? Please don't let @travisbot scare you off, he's pretty awesome.

Thanks for submitting it, we haven't been perfectly rigorous re: the forward compat.

Do you know offhand if py3k print() is capable of talking stderr? I'd prefer something like print(xxx, sys.stderr) instead of having to do sys.stderr.write() and add extra \n's and such. Not a big deal, just a stylistic thing.

Final note: while Fabric itself can probably run on py3k without a huge amount of pain, and the C-ext we depend on (pyCrypto) is py3k compat in recent versions, I don't think Paramiko/ssh run on 3k well yet. So getting Fab on py3k may not be possible until we have time to make that happen / check out peoples' forks.

@bitprophet bitprophet reopened this Aug 15, 2012

@travisbot

This comment has been minimized.

travisbot commented Aug 15, 2012

This pull request passes (merged 082473b into e005cb6).

@underrun

This comment has been minimized.

underrun commented Aug 31, 2012

print takes a key work only argument file so you can print(something, file=sys.stderr). it seems like there is a paramiko fork that has py3k support ... that be some awesome stuff.

@bitprophet

This comment has been minimized.

Member

bitprophet commented Sep 8, 2012

@underrun Thanks, that's great to know (re: print).

Re: Paramiko forks, yea, there's a few out there (both of paramiko and of ssh which is itself a fork of Paramiko) but AFAIK none of them are 100% there yet. I'll be looking deeper into them at some point.

bitprophet added a commit that referenced this pull request Sep 9, 2012

@bitprophet bitprophet merged commit 082473b into fabric:master Sep 9, 2012

1 check passed

default The Travis build passed
Details

bitprophet added a commit that referenced this pull request Sep 9, 2012

@bitprophet

This comment has been minimized.

Member

bitprophet commented Sep 9, 2012

Final note-to-self, print(msg, stream) doesn't appear to be valid for Python 2.5, and needs a __future__ import in 2.6 (which I think I saw the OP reverting somewhere in the commit list). So for now we do need to leave it as sys.stderr.write(xxx + "\n").

Fab 2 will be 2.6+ and will be able to use from __future__ import print_function or whatever it is.

@bitprophet bitprophet added the Python 3 label Aug 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment