Python2.5 compatibility 'str' object has no attribute 'format' #1514

Closed
pedrudehuere opened this Issue Oct 3, 2016 · 6 comments

Projects

None yet

3 participants

@pedrudehuere

file: network.py
line: 475
a .format() has been introduced, in commit 1ca512d,
which (IIRC) is not compatible with python2.5.

Using Python 2.5 I'm getting :

...Fabric-1.12.0-py2.5.egg/fabric/network.py", line 475, in connect
    name = 'gss_{0}'.format(suffix)
AttributeError: 'str' object has no attribute 'format'
@bitprophet
Member

Yup, added in 2.6. We have very few users on 2.5 nowadays (and CI platforms no longer support it, either) which is doubtless why this went uncaught. Thanks for the catch!

@bitprophet bitprophet added this to the 1.10.6 milestone Oct 3, 2016
@pedrudehuere

I really got depressed when I reckoned I had to use python2.5... I worked round it by doing some SSH tunnels, not very clean, but better than use python2.5 =P

@ploxiln
Contributor
ploxiln commented Oct 7, 2016

This bug was actually introduced in the 1.11 branch. It is not present in the 1.10 branch.

@ploxiln ploxiln added a commit to ploxiln/fabric that referenced this issue Oct 7, 2016
@ploxiln ploxiln avoid use of str.format() in network.py
fixes #1514
6faa4df
@ploxiln
Contributor
ploxiln commented Oct 7, 2016

It would make sense to "officially" drop support for python-2.5 in the next minor release, and probably python-2.6 as well in fabric-2.0. The last python-2.6 patch-update was a full 3 years ago, users stuck on that python can use fabric 1.12.x, which could continue to be maintained.

@bitprophet
Member

Fabric 2 (via Invoke/Paramiko's requirements) will support 2.6-2.7 and 3.3+; there are still a lot of people on 2.6 despite its EOLification. (Though I expect it'll get dropped in the subsequent major revisions of all of those libs, which will not be nearly as long as Fab 2 took...)

I don't think it makes sense to drop 2.5 support in Fab 1.x despite the small userbase, it's technically breaking backwards incompat, and given 1.x isn't Py3 compatible, the burden of supporting 2.5 isn't very high (basically, don't use .format).

@ploxiln
Contributor
ploxiln commented Oct 7, 2016

Sounds good. I'm sure you've thought about it more than I have :)

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