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.
porting to py3k: fixed print statements
This pull request fails (merged e525429 into e005cb6).
better py3k porting mantaining 2.5 compatibility
This pull request fails (merged 18e5996 into e005cb6).
fixed 2.5 print backwards compatibility
This pull request passes (merged 082473b into e005cb6).
@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.
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.
@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.
Attribution re #704
Fix up actually-failing tests re #704
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").
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.
from __future__ import print_function