[Twisted-Python] Python 2.2 Support
![](https://secure.gravatar.com/avatar/1327ce755b24b956995d68accae3eab2.jpg?s=120&d=mm&r=g)
Should we drop Python 2.2 support in Subversion head for Twisted 2.2? - Debian stable now comes with Python 2.3 - Twisted 2.1 has been released with Python 2.2 support Dropping Python 2.2 support has some good consequences: - We get to delete code - An entire class of bugs gets eliminated - Disc space can be freed on the muon buildslave Some bad consequences: - People wanting to run Twisted 2.2 (or svn) on ancient versions of Python won't be able to. cheers, jml
![](https://secure.gravatar.com/avatar/3bef09da3292c944649ffc28673df870.jpg?s=120&d=mm&r=g)
So, the previous version of this thread came up with: On Tue, Oct 11, 2005, Jonathan Lange wrote: > Should we drop Python 2.2 support in Subversion head for Twisted 2.2? > > - Debian stable now comes with Python 2.3 > - Twisted 2.1 has been released with Python 2.2 support - the most commonly used version of Red Hat Enterprise still has Python 2.3 Therefore: > Some bad consequences: > - People wanting to run Twisted 2.2 (or svn) on ancient versions of > Python won't be able to. - in particular, people wanting to run Twisted 2.2 on RHE will need to upgrade to the very latest, less widely used, version -Mary -- <radix> So, I guess the reason you chose ftp as a discovery protocol is because it's a semi-ubiquitous anonymous protocol that allows people to communicate? <edsuom> No, because I was stupid
![](https://secure.gravatar.com/avatar/1327ce755b24b956995d68accae3eab2.jpg?s=120&d=mm&r=g)
On 11/10/05, Mary Gardiner <mary-twisted@puzzling.org> wrote: > So, the previous version of this thread came up with: > > On Tue, Oct 11, 2005, Jonathan Lange wrote: > > Should we drop Python 2.2 support in Subversion head for Twisted 2.2? > > > > - Debian stable now comes with Python 2.3 > > - Twisted 2.1 has been released with Python 2.2 support > - the most commonly used version of Red Hat Enterprise still has > Python 2.3 You mean Python 2.2, right?
![](https://secure.gravatar.com/avatar/3bef09da3292c944649ffc28673df870.jpg?s=120&d=mm&r=g)
On Tue, Oct 11, 2005, Jonathan Lange wrote: > On 11/10/05, Mary Gardiner <mary-twisted@puzzling.org> wrote: > > So, the previous version of this thread came up with: > > > > On Tue, Oct 11, 2005, Jonathan Lange wrote: > > > Should we drop Python 2.2 support in Subversion head for Twisted 2.2? > > > > > > - Debian stable now comes with Python 2.3 > > > - Twisted 2.1 has been released with Python 2.2 support > > - the most commonly used version of Red Hat Enterprise still has > > Python 2.3 > > You mean Python 2.2, right? Yes. In particular, I believe a *supported* version still has it. -Mary -- <dash> careful with that syntax, eugene
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 10/11/05, Mary Gardiner <mary-twisted@puzzling.org> wrote: > On Tue, Oct 11, 2005, Jonathan Lange wrote: > > Should we drop Python 2.2 support in Subversion head for Twisted 2.2? > > > > - Debian stable now comes with Python 2.3 > > - Twisted 2.1 has been released with Python 2.2 support > - the most commonly used version of Red Hat Enterprise still has > Python 2.3 > > Therefore: > > > Some bad consequences: > > - People wanting to run Twisted 2.2 (or svn) on ancient versions of > > Python won't be able to. > - in particular, people wanting to run Twisted 2.2 on RHE will need > to upgrade to the very latest, less widely used, version > > -Mary Huh? If RHE has Python 2.3 (as you say above), then they should still be able to run Twisted 2.2. We're talking about dropping Python 2.2 support, not Python 2.3. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/3bef09da3292c944649ffc28673df870.jpg?s=120&d=mm&r=g)
On Tue, Oct 11, 2005, Christopher Armstrong wrote:
That was a typo, I meant 2.2. What I intended to say was that the previous "dropping 2.2 support" discussion revealed that RHE 3, which is still supported, has Python *2.2*: http://twistedmatrix.com/pipermail/twisted-python/2005-September/011383.html Red Hat is not stopping full support of RHE 3 until April 30, 2006: http://www.redhat.com/security/updates/errata/ I'm not saying this because I personally have any barrow to push re RHE or Python 2.2 (I use latest Ubuntu) or even any personal opinion, just to remind everyone of a potentially relevant point from a previous thread on the same topic. -Mary
![](https://secure.gravatar.com/avatar/426d6dbf6554a9b3fca1fd04e6b75f38.jpg?s=120&d=mm&r=g)
Mary Gardiner wrote:
FWIW we use an enormous quantity of (Twisted- and not-)Python code here, of which I'm the prime maintainer. As a matter of course, I build a local copy of Python on RHEL3 boxes, because the extensive use of Python in Fedora/Redhat sysadmin tools makes me somewhat nervous about tooling around with the system copy. What I'm saying is that it's not a huge barrier to entry needing to build Python2.3/4/5 from source (in fact the big pain is getting various extension modules, pyOpenSSL in particular - and an egg-ified Python and Twisted would help that immensely). Though having fast server machines makes it less painful (which is solveable using a /usr/local-ified RPM). My suggestion would be to aim for the following - an egged Twisted, deprecate Python2.2, then a user installing Twisted has to do three things: wget Python2.3.tgz; tar xzf Python2.3.tgz; cd Python2.3 ./configure && make && make install ...then wget easyinstall.tgz; tar xzf easyinstall.tgz; cd easyinstall /usr/local/bin/python2.3 setup.py install ...then easy_install Twisted ...which ideally would pull down all the various modules and associated crap required to actually include the batteries in Python ;o)
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 10/11/05, Jonathan Lange <jml@mumak.net> wrote:
Should we drop Python 2.2 support in Subversion head for Twisted 2.2?
We should drop Python 2.2 support in Subversion head for Twisted 2.2. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 10/11/05, Jonathan Lange <jml@mumak.net> wrote:
Should we drop Python 2.2 support in Subversion head for Twisted 2.2?
I consider this issue resolved, given the lack of response for people wanting 2.2 support. The buildslave for 2.2 should be taken down and Twisted trunk should be considered fair for 2.3-only features. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/7ed9784cbb1ba1ef75454034b3a8e6a1.jpg?s=120&d=mm&r=g)
On Sat, 5 Nov 2005 17:00:14 +1100, Christopher Armstrong <radeex@gmail.com> wrote:
Lack of interest in a change doesn't dictate that the change be made. I didn't hear anyone come out against the change _or_ for it. If it will help, I'll throw in against dropping 2.2 support. Neither 2.3 nor 2.4 introduce any compelling new features. Jean-Paul
![](https://secure.gravatar.com/avatar/91332725097dfef3805c62175857f0b5.jpg?s=120&d=mm&r=g)
On Sat, Nov 05, 2005 at 02:05:54PM -0500, Jean-Paul Calderone wrote:
The obvious question is what will we lose if we drop 2.2 support and what will we gain? My understanding is that datetime for python < 2.3 isn't perfect, and I use datetime extensively. 2.3 lets you specify the a stride when you slice, universal readlines mode when opening files is nice, you can pop() dicts.. in fact just read this: http://www.aleax.it/Python/pythonian.html I thinkit would be nice to start using some of the features 2.3 and newer support.
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 11/6/05, Jean-Paul Calderone <exarkun@divmod.com> wrote:
You are confused. At least two people were *for* dropping 2.2 support in this thread, and nobody was against it. I'm pretty sure several others have been for dropping it on IRC, as well. I have seen people several times commit code that requires 2.3, realize that the buildbot failed, and replace the code with a more complicated version (didn't you do this recently yourself, Jp?). I personally find it harder and harder to test 2.2, as finding an installation of 2.2 is getting rarer these days. To unshamedly list features from the "What's new in Python 2.3" article: - Sets - Proper booleans (2.2.0 didn't even have the "True" and "False" constants) - enumerate - csv - generators without __future__ - sum - callable types - horrible obscure Python2.2-only bugs and semantics changes gone - str in str - arguments-to-strip These are all pretty minor (apart from the "horrible obscure" things), but the sum() of them adds up to a lot of annoyance in support when no users have actually thrown in for it. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/b6db41aca56d7549bb21230f8becf1ce.jpg?s=120&d=mm&r=g)
On Nov 5, 2005, at 8:14 PM, Christopher Armstrong wrote:
I can say that I do not particularly like having to support 2.2. =) RedHat EL3 (which is still supported by RedHat) still has python 2.2 though by default. I don't know what other "still supported" distributions might have it. When I forced "at least 2.3" on my PyAIM/PyICQ transport users, I got a fair number of complaints and a couple of "well then I can't use your transport". I'm not entirely sure why one can't just install python 2.3 or higher if that's a requirement, but hey. =) Anyway, I'd almost be happier if Twisted didn't support 2.2 anymore simply because I could use that as a catalist for dropping support for it on my end as well. I actually have to implement my own bool class to get real booleans in 2.2.. and that file is there only for 2.2. =/ I can't put any real facts behind this, but it "seems" like unicode support isn't as good in 2.2 either. That might just be my imagination though. =D Daniel
![](https://secure.gravatar.com/avatar/7ed9784cbb1ba1ef75454034b3a8e6a1.jpg?s=120&d=mm&r=g)
On Sun, 6 Nov 2005 12:14:08 +1100, Christopher Armstrong <radeex@gmail.com> wrote:
Confused, perhaps. Or perhaps their positions were voiced with such limited enthusiasm I just forgot about them :)
Yea, I've probably done this, and I've seen a few other people do it too. Fortunately, buildbot's new "build a branch" feature should help resolve this problem. Anyone can try out their code on any of Twisted's supported platforms before merging it into trunk.
It's a pretty good list, I must admit. But I wonder what the specific gains to Twisted will be. Just having a list of things Python 2.3 can do that Python 2.2 cannot does not seem compelling to me. Jean-Paul
![](https://secure.gravatar.com/avatar/1327ce755b24b956995d68accae3eab2.jpg?s=120&d=mm&r=g)
On 06/11/05, Jean-Paul Calderone <exarkun@divmod.com> wrote:
My apologies. I often try to restrain my enthusiasm for fear that excess emotion will sidetrack rational discussion. I am very keen to ditch Python 2.2 support.
It's a pretty good list, I must admit. But I wonder what the specific gains to Twisted will be. Just having a list of things Python 2.3 can do that Python 2.2 cannot does not seem compelling to me.
One specific gain already mentioned is that we get to remove a bunch of code. Less code means fewer bugs and less work. It might even improve our test coverage. Here's a list of stuff (shamelessly grepped) that could probably be simplified if we dropped 2.2 support: twisted/conch/test/test_filetransfer.py: # XXX: Remove 'uid' and 'gid', because python 2.2 doesn't have os.lchown, so we just skip that bit (dodgy!) twisted/conch/unix.py: # XXX: Python 2.2 doesn't have os.lchown! twisted/internet/error.py: # only works in 2.2 twisted/python/dist.py: Python 2.2's distutils. Pretty similar arguments to getDataFiles, twisted/python/dist.py:# Apple distributes a nasty version of Python 2.2 w/ all release builds of twisted/python/dist.py: Changes behavior in Python 2.2 to support simultaneous specification twisted/python/reflect.py: This is a 2.2-only alternative to the Accessor mixin - just set in your twisted/python/zshcomp.py:# in case of python2.2 ... twisted/test/test_compat.py: # without replacing isinstance on 2.2 as well :( twisted/topfiles/setup.py:# 2.2 doesn't have __file__ in main-scripts. twisted/trial/unittest.py: # only overriding this because Python 2.2's unittest has a broken twisted/trial/unittest.py: """a python2.2 friendly test to assert that substring is found in astring twisted/trial/unittest.py: """a python2.2 friendly test to assert that substring is not found in twisted/trial/unittest.py: # FIXME: when we drop support for python 2.2 and start to require 2.3, twisted/conch/ssh/filetransfer.py: isFile, name = self.wasAFile[d] # replace with get when we're at 2.3 twisted/lore/lint.py:# parser.suite in Python 2.3 raises SyntaxError, <2.3 raises parser.ParserError twisted/scripts/trial.py: (relative to _trial_temp). Requires Python 2.3.3.""" twisted/spread/jelly.py: raise NotImplementedError("Datetime unserializing not supported in Python < 2.3") twisted/trial/runner.py: "python 2.3 or later, not running doctests") twisted/trial/runner.py: "python 2.3 or later, not running doctests") twisted/trial/test/test_doctest.py: skip = 'doctest support only works on 2.3 or later' twisted/trial/test/test_doctest.py: # doctest reports failures as errors in 2.3 twisted/trial/test/test_failure_formatting.py: 'doctest support only works in Python 2.3 or later') twisted/words/protocols/jabber/xmpp_stringprep.py: "recommended you upgrade to Python 2.3.2 or newer if you " Plus the modules in twisted/python/pymodules. As you can see, Trial carries a fair part of the 2.2 support burden. I'm eager to be rid of it. cheers, jml
![](https://secure.gravatar.com/avatar/3eaacd20213c065e92c80e78b586d687.jpg?s=120&d=mm&r=g)
Out of interest: Why would someone still running python 2.2 be trying to use the *latest* twisted? Given they are not interested in running the latest and greatest python surely they would be happy with an older version of twisted. Having a "last version compatible with 2.2" available for download would solve this problem no? mark On 7 Nov 2005, at 13:47, Jonathan Lange wrote:
![](https://secure.gravatar.com/avatar/fb3faf87d0fc6286f13f89433946f4cb.jpg?s=120&d=mm&r=g)
markw wrote:
Out of interest: Why would someone still running python 2.2 be trying to use the *latest* twisted?
Someone running Python 2.2 might still need a bug fixed in Twisted.
This is a good idea, even if it doesn't solve the whole problem! (Personally I'm a bit torn. We use Twisted on RH EL3 boxes, but I'd rather see that we upgraded to a newer Python. That Twisted requires 2.3 could help... :)
![](https://secure.gravatar.com/avatar/15fa47f2847592672210af8a25cd1f34.jpg?s=120&d=mm&r=g)
I'm going to vote for dropping Python 2.2 support in Twisted trunk now. Twisted 2.1 is a fine release to use if you want to use an ancient version of python. Keeping compat is a pain in the ass. And lest exarkun complain about lack of enthusiasm: I'll declare myself quite enthusiastic about the concept. :) James
![](https://secure.gravatar.com/avatar/d6328babd9f9a98ecc905e1ccac2495e.jpg?s=120&d=mm&r=g)
On Thu, 22 Dec 2005 17:54:54 -0500, James Y Knight <foom@fuhm.net> wrote:
I don't think you can "vote" yet since that violates parliamentary procedure, maybe. I will assume you are making a motion. I will second this motion! Since I am also the chair, I can say that the motion carries! Anybody want to filibuster?
![](https://secure.gravatar.com/avatar/caacb731f9d4a5850385428ee0a5f954.jpg?s=120&d=mm&r=g)
James Y Knight wrote:
+1 Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
![](https://secure.gravatar.com/avatar/d6328babd9f9a98ecc905e1ccac2495e.jpg?s=120&d=mm&r=g)
On Fri, 23 Dec 2005 10:01:22 -0500, Jim Fulton <jim@zope.com> wrote:
+1
As of some time yesterday, JP has taken the Python buildbot offline. That means that 2.2 is no longer officially supported, and the next release will not run on any 2.2-only platforms. Merry christmas, I guess :).
![](https://secure.gravatar.com/avatar/79b398e90ee81bd64ec95da03c16f36c.jpg?s=120&d=mm&r=g)
Quoting glyph@divmod.com:
Great news ! We may finally enjoy 2.3 optimizations in Twisted : I think about string module, list comprehensions, optparse, new style classes... without introducing changes (just syntaxic/optimization changes). Would it be the good moment to open a topic in the bug tracker to hold these patches ? Or it's better to wait for a sprint, when all these changes could be made ? Thanks for everything, -- Thomas
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 12/28/05, Thomas HERVE <therve@free.fr> wrote:
Wow man, where have you been? The string module has been mostly obsolete since (I think) 2.0, and the list comps and new style classes were already in Python 2.2. I can't remember about optparse; all Twisted code uses twisted.python.usage. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/79b398e90ee81bd64ec95da03c16f36c.jpg?s=120&d=mm&r=g)
Quoting Christopher Armstrong <radeex@gmail.com>:
Well I do know that, but what's the reason why I see so many "import string" in the trunk ? Why I see so many classes that don't subclass object ? I know it's a lot of work, so I was just asking if it's in the roadmap or not.
I can't remember about optparse; all Twisted code uses twisted.python.usage.
Wouldn't it be better to subclass OptParse ? I have the feeling usage.Options does nearly the same things. -- Thomas
![](https://secure.gravatar.com/avatar/7ed9784cbb1ba1ef75454034b3a8e6a1.jpg?s=120&d=mm&r=g)
On Tue, 27 Dec 2005 14:59:00 +0100, Thomas HERVE <therve@free.fr> wrote:
Patches that remove usage of the string module will surely be accepted. :) Patches that introduce object as a base class may not be. Classic classes behave differently than new-style classes. It is not always possible to replace the former with the latter while maintaining API compatibility.
Perhaps OptParse should subclass usage.Options. Seriously. We looked at switching to optparse a while ago. t.p.u is better. Nothing stops you from using optparse with Twisted, though. Jean-Paul
![](https://secure.gravatar.com/avatar/79b398e90ee81bd64ec95da03c16f36c.jpg?s=120&d=mm&r=g)
Quoting Jean-Paul Calderone <exarkun@divmod.com>:
Patches that remove usage of the string module will surely be accepted. :)
It would be good : I count 94 occurences of string import in the trunk. I'll open a topic.
Ok, thanks for your answer. I miss new-style class for mainly one thing : the automatic __init__, great for subclasses. -- Thomas
![](https://secure.gravatar.com/avatar/d6328babd9f9a98ecc905e1ccac2495e.jpg?s=120&d=mm&r=g)
On Tue, 27 Dec 2005 15:45:48 +0100, Thomas HERVE <therve@free.fr> wrote:
This is a worthwhile goal since we made the decision to stop importing the string module several years ago, however: Just because Python2.2 support has been dropped does not mean that we should waste time crawling all over the codebase to update "old" code to the new standard. 1) Somebody might still have to backport it one day. We aren't going to support that, but neither should we make it unnecessarily difficult. 2) If you're that enthused to do work on Twisted, there are lots of other, more worthwhile projects you could be engaging in. I'm tempted to write a list, but you know where the bugtracker is. Let's not make any unnecessary work. If you're interested in stylistic improvements, one thing you might want to look at is removing uses of deprecated trial APIs such as wait() from the unit tests.
How is __init__ more automatic in new-style classes? Do you mean super()? At any rate, when we do start a new-style push, we should probably have a 'from twisted import __metaclass__' at the top of each file, to make updating the codebase to incorporate object-model and/or debugging enhancements easier.
![](https://secure.gravatar.com/avatar/79b398e90ee81bd64ec95da03c16f36c.jpg?s=120&d=mm&r=g)
Quoting glyph@divmod.com:
[Issue created here : http://twistedmatrix.com/bugs/issue1381].
Ok I understand that. Hopefully it doesn't apply to the string module :).
Great. I'm willing to work on Twisted, and I have time for that. I work full-time on Twisted-based applications, and my employer is well-disposed to give a bit of this time to Twisted itself. Indeed taking tasks in the bts is a good way to help Twisted.
Well I mean like that: class MyClass(TwistedClass): def __init__(self, myargs): super(TwistedClass, self).__init__() # doesn't work TwistedClass.__init__(self) # doesn't work either
I remember seeing this in Nevow, without understanding it at first. It seeems to solve the super problem, but looks a bit like black magic :). Thanks a lot for your patience, I'll try to bit less noisy and more useful. -- Thomas
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 12/28/05, Thomas HERVE <therve@free.fr> wrote:
Don't rock the boat. Don't fix what ain't broken. etc. New classes often subclass object, and new code always uses str methods. I do seem to remember that there was a big str-method change to Twisted a while back, for the sake of optimisation. I don't see any similar improvement to having a big festival for switching everything to object.
I'm pretty sure that debate has been had, although I don't know if it was on the mailing list. I suggest searching the archives. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/3bef09da3292c944649ffc28673df870.jpg?s=120&d=mm&r=g)
So, the previous version of this thread came up with: On Tue, Oct 11, 2005, Jonathan Lange wrote: > Should we drop Python 2.2 support in Subversion head for Twisted 2.2? > > - Debian stable now comes with Python 2.3 > - Twisted 2.1 has been released with Python 2.2 support - the most commonly used version of Red Hat Enterprise still has Python 2.3 Therefore: > Some bad consequences: > - People wanting to run Twisted 2.2 (or svn) on ancient versions of > Python won't be able to. - in particular, people wanting to run Twisted 2.2 on RHE will need to upgrade to the very latest, less widely used, version -Mary -- <radix> So, I guess the reason you chose ftp as a discovery protocol is because it's a semi-ubiquitous anonymous protocol that allows people to communicate? <edsuom> No, because I was stupid
![](https://secure.gravatar.com/avatar/1327ce755b24b956995d68accae3eab2.jpg?s=120&d=mm&r=g)
On 11/10/05, Mary Gardiner <mary-twisted@puzzling.org> wrote: > So, the previous version of this thread came up with: > > On Tue, Oct 11, 2005, Jonathan Lange wrote: > > Should we drop Python 2.2 support in Subversion head for Twisted 2.2? > > > > - Debian stable now comes with Python 2.3 > > - Twisted 2.1 has been released with Python 2.2 support > - the most commonly used version of Red Hat Enterprise still has > Python 2.3 You mean Python 2.2, right?
![](https://secure.gravatar.com/avatar/3bef09da3292c944649ffc28673df870.jpg?s=120&d=mm&r=g)
On Tue, Oct 11, 2005, Jonathan Lange wrote: > On 11/10/05, Mary Gardiner <mary-twisted@puzzling.org> wrote: > > So, the previous version of this thread came up with: > > > > On Tue, Oct 11, 2005, Jonathan Lange wrote: > > > Should we drop Python 2.2 support in Subversion head for Twisted 2.2? > > > > > > - Debian stable now comes with Python 2.3 > > > - Twisted 2.1 has been released with Python 2.2 support > > - the most commonly used version of Red Hat Enterprise still has > > Python 2.3 > > You mean Python 2.2, right? Yes. In particular, I believe a *supported* version still has it. -Mary -- <dash> careful with that syntax, eugene
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 10/11/05, Mary Gardiner <mary-twisted@puzzling.org> wrote: > On Tue, Oct 11, 2005, Jonathan Lange wrote: > > Should we drop Python 2.2 support in Subversion head for Twisted 2.2? > > > > - Debian stable now comes with Python 2.3 > > - Twisted 2.1 has been released with Python 2.2 support > - the most commonly used version of Red Hat Enterprise still has > Python 2.3 > > Therefore: > > > Some bad consequences: > > - People wanting to run Twisted 2.2 (or svn) on ancient versions of > > Python won't be able to. > - in particular, people wanting to run Twisted 2.2 on RHE will need > to upgrade to the very latest, less widely used, version > > -Mary Huh? If RHE has Python 2.3 (as you say above), then they should still be able to run Twisted 2.2. We're talking about dropping Python 2.2 support, not Python 2.3. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/3bef09da3292c944649ffc28673df870.jpg?s=120&d=mm&r=g)
On Tue, Oct 11, 2005, Christopher Armstrong wrote:
That was a typo, I meant 2.2. What I intended to say was that the previous "dropping 2.2 support" discussion revealed that RHE 3, which is still supported, has Python *2.2*: http://twistedmatrix.com/pipermail/twisted-python/2005-September/011383.html Red Hat is not stopping full support of RHE 3 until April 30, 2006: http://www.redhat.com/security/updates/errata/ I'm not saying this because I personally have any barrow to push re RHE or Python 2.2 (I use latest Ubuntu) or even any personal opinion, just to remind everyone of a potentially relevant point from a previous thread on the same topic. -Mary
![](https://secure.gravatar.com/avatar/426d6dbf6554a9b3fca1fd04e6b75f38.jpg?s=120&d=mm&r=g)
Mary Gardiner wrote:
FWIW we use an enormous quantity of (Twisted- and not-)Python code here, of which I'm the prime maintainer. As a matter of course, I build a local copy of Python on RHEL3 boxes, because the extensive use of Python in Fedora/Redhat sysadmin tools makes me somewhat nervous about tooling around with the system copy. What I'm saying is that it's not a huge barrier to entry needing to build Python2.3/4/5 from source (in fact the big pain is getting various extension modules, pyOpenSSL in particular - and an egg-ified Python and Twisted would help that immensely). Though having fast server machines makes it less painful (which is solveable using a /usr/local-ified RPM). My suggestion would be to aim for the following - an egged Twisted, deprecate Python2.2, then a user installing Twisted has to do three things: wget Python2.3.tgz; tar xzf Python2.3.tgz; cd Python2.3 ./configure && make && make install ...then wget easyinstall.tgz; tar xzf easyinstall.tgz; cd easyinstall /usr/local/bin/python2.3 setup.py install ...then easy_install Twisted ...which ideally would pull down all the various modules and associated crap required to actually include the batteries in Python ;o)
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 10/11/05, Jonathan Lange <jml@mumak.net> wrote:
Should we drop Python 2.2 support in Subversion head for Twisted 2.2?
We should drop Python 2.2 support in Subversion head for Twisted 2.2. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 10/11/05, Jonathan Lange <jml@mumak.net> wrote:
Should we drop Python 2.2 support in Subversion head for Twisted 2.2?
I consider this issue resolved, given the lack of response for people wanting 2.2 support. The buildslave for 2.2 should be taken down and Twisted trunk should be considered fair for 2.3-only features. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/7ed9784cbb1ba1ef75454034b3a8e6a1.jpg?s=120&d=mm&r=g)
On Sat, 5 Nov 2005 17:00:14 +1100, Christopher Armstrong <radeex@gmail.com> wrote:
Lack of interest in a change doesn't dictate that the change be made. I didn't hear anyone come out against the change _or_ for it. If it will help, I'll throw in against dropping 2.2 support. Neither 2.3 nor 2.4 introduce any compelling new features. Jean-Paul
![](https://secure.gravatar.com/avatar/91332725097dfef3805c62175857f0b5.jpg?s=120&d=mm&r=g)
On Sat, Nov 05, 2005 at 02:05:54PM -0500, Jean-Paul Calderone wrote:
The obvious question is what will we lose if we drop 2.2 support and what will we gain? My understanding is that datetime for python < 2.3 isn't perfect, and I use datetime extensively. 2.3 lets you specify the a stride when you slice, universal readlines mode when opening files is nice, you can pop() dicts.. in fact just read this: http://www.aleax.it/Python/pythonian.html I thinkit would be nice to start using some of the features 2.3 and newer support.
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 11/6/05, Jean-Paul Calderone <exarkun@divmod.com> wrote:
You are confused. At least two people were *for* dropping 2.2 support in this thread, and nobody was against it. I'm pretty sure several others have been for dropping it on IRC, as well. I have seen people several times commit code that requires 2.3, realize that the buildbot failed, and replace the code with a more complicated version (didn't you do this recently yourself, Jp?). I personally find it harder and harder to test 2.2, as finding an installation of 2.2 is getting rarer these days. To unshamedly list features from the "What's new in Python 2.3" article: - Sets - Proper booleans (2.2.0 didn't even have the "True" and "False" constants) - enumerate - csv - generators without __future__ - sum - callable types - horrible obscure Python2.2-only bugs and semantics changes gone - str in str - arguments-to-strip These are all pretty minor (apart from the "horrible obscure" things), but the sum() of them adds up to a lot of annoyance in support when no users have actually thrown in for it. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/b6db41aca56d7549bb21230f8becf1ce.jpg?s=120&d=mm&r=g)
On Nov 5, 2005, at 8:14 PM, Christopher Armstrong wrote:
I can say that I do not particularly like having to support 2.2. =) RedHat EL3 (which is still supported by RedHat) still has python 2.2 though by default. I don't know what other "still supported" distributions might have it. When I forced "at least 2.3" on my PyAIM/PyICQ transport users, I got a fair number of complaints and a couple of "well then I can't use your transport". I'm not entirely sure why one can't just install python 2.3 or higher if that's a requirement, but hey. =) Anyway, I'd almost be happier if Twisted didn't support 2.2 anymore simply because I could use that as a catalist for dropping support for it on my end as well. I actually have to implement my own bool class to get real booleans in 2.2.. and that file is there only for 2.2. =/ I can't put any real facts behind this, but it "seems" like unicode support isn't as good in 2.2 either. That might just be my imagination though. =D Daniel
![](https://secure.gravatar.com/avatar/7ed9784cbb1ba1ef75454034b3a8e6a1.jpg?s=120&d=mm&r=g)
On Sun, 6 Nov 2005 12:14:08 +1100, Christopher Armstrong <radeex@gmail.com> wrote:
Confused, perhaps. Or perhaps their positions were voiced with such limited enthusiasm I just forgot about them :)
Yea, I've probably done this, and I've seen a few other people do it too. Fortunately, buildbot's new "build a branch" feature should help resolve this problem. Anyone can try out their code on any of Twisted's supported platforms before merging it into trunk.
It's a pretty good list, I must admit. But I wonder what the specific gains to Twisted will be. Just having a list of things Python 2.3 can do that Python 2.2 cannot does not seem compelling to me. Jean-Paul
![](https://secure.gravatar.com/avatar/1327ce755b24b956995d68accae3eab2.jpg?s=120&d=mm&r=g)
On 06/11/05, Jean-Paul Calderone <exarkun@divmod.com> wrote:
My apologies. I often try to restrain my enthusiasm for fear that excess emotion will sidetrack rational discussion. I am very keen to ditch Python 2.2 support.
It's a pretty good list, I must admit. But I wonder what the specific gains to Twisted will be. Just having a list of things Python 2.3 can do that Python 2.2 cannot does not seem compelling to me.
One specific gain already mentioned is that we get to remove a bunch of code. Less code means fewer bugs and less work. It might even improve our test coverage. Here's a list of stuff (shamelessly grepped) that could probably be simplified if we dropped 2.2 support: twisted/conch/test/test_filetransfer.py: # XXX: Remove 'uid' and 'gid', because python 2.2 doesn't have os.lchown, so we just skip that bit (dodgy!) twisted/conch/unix.py: # XXX: Python 2.2 doesn't have os.lchown! twisted/internet/error.py: # only works in 2.2 twisted/python/dist.py: Python 2.2's distutils. Pretty similar arguments to getDataFiles, twisted/python/dist.py:# Apple distributes a nasty version of Python 2.2 w/ all release builds of twisted/python/dist.py: Changes behavior in Python 2.2 to support simultaneous specification twisted/python/reflect.py: This is a 2.2-only alternative to the Accessor mixin - just set in your twisted/python/zshcomp.py:# in case of python2.2 ... twisted/test/test_compat.py: # without replacing isinstance on 2.2 as well :( twisted/topfiles/setup.py:# 2.2 doesn't have __file__ in main-scripts. twisted/trial/unittest.py: # only overriding this because Python 2.2's unittest has a broken twisted/trial/unittest.py: """a python2.2 friendly test to assert that substring is found in astring twisted/trial/unittest.py: """a python2.2 friendly test to assert that substring is not found in twisted/trial/unittest.py: # FIXME: when we drop support for python 2.2 and start to require 2.3, twisted/conch/ssh/filetransfer.py: isFile, name = self.wasAFile[d] # replace with get when we're at 2.3 twisted/lore/lint.py:# parser.suite in Python 2.3 raises SyntaxError, <2.3 raises parser.ParserError twisted/scripts/trial.py: (relative to _trial_temp). Requires Python 2.3.3.""" twisted/spread/jelly.py: raise NotImplementedError("Datetime unserializing not supported in Python < 2.3") twisted/trial/runner.py: "python 2.3 or later, not running doctests") twisted/trial/runner.py: "python 2.3 or later, not running doctests") twisted/trial/test/test_doctest.py: skip = 'doctest support only works on 2.3 or later' twisted/trial/test/test_doctest.py: # doctest reports failures as errors in 2.3 twisted/trial/test/test_failure_formatting.py: 'doctest support only works in Python 2.3 or later') twisted/words/protocols/jabber/xmpp_stringprep.py: "recommended you upgrade to Python 2.3.2 or newer if you " Plus the modules in twisted/python/pymodules. As you can see, Trial carries a fair part of the 2.2 support burden. I'm eager to be rid of it. cheers, jml
![](https://secure.gravatar.com/avatar/3eaacd20213c065e92c80e78b586d687.jpg?s=120&d=mm&r=g)
Out of interest: Why would someone still running python 2.2 be trying to use the *latest* twisted? Given they are not interested in running the latest and greatest python surely they would be happy with an older version of twisted. Having a "last version compatible with 2.2" available for download would solve this problem no? mark On 7 Nov 2005, at 13:47, Jonathan Lange wrote:
![](https://secure.gravatar.com/avatar/fb3faf87d0fc6286f13f89433946f4cb.jpg?s=120&d=mm&r=g)
markw wrote:
Out of interest: Why would someone still running python 2.2 be trying to use the *latest* twisted?
Someone running Python 2.2 might still need a bug fixed in Twisted.
This is a good idea, even if it doesn't solve the whole problem! (Personally I'm a bit torn. We use Twisted on RH EL3 boxes, but I'd rather see that we upgraded to a newer Python. That Twisted requires 2.3 could help... :)
![](https://secure.gravatar.com/avatar/15fa47f2847592672210af8a25cd1f34.jpg?s=120&d=mm&r=g)
I'm going to vote for dropping Python 2.2 support in Twisted trunk now. Twisted 2.1 is a fine release to use if you want to use an ancient version of python. Keeping compat is a pain in the ass. And lest exarkun complain about lack of enthusiasm: I'll declare myself quite enthusiastic about the concept. :) James
![](https://secure.gravatar.com/avatar/d6328babd9f9a98ecc905e1ccac2495e.jpg?s=120&d=mm&r=g)
On Thu, 22 Dec 2005 17:54:54 -0500, James Y Knight <foom@fuhm.net> wrote:
I don't think you can "vote" yet since that violates parliamentary procedure, maybe. I will assume you are making a motion. I will second this motion! Since I am also the chair, I can say that the motion carries! Anybody want to filibuster?
![](https://secure.gravatar.com/avatar/caacb731f9d4a5850385428ee0a5f954.jpg?s=120&d=mm&r=g)
James Y Knight wrote:
+1 Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
![](https://secure.gravatar.com/avatar/d6328babd9f9a98ecc905e1ccac2495e.jpg?s=120&d=mm&r=g)
On Fri, 23 Dec 2005 10:01:22 -0500, Jim Fulton <jim@zope.com> wrote:
+1
As of some time yesterday, JP has taken the Python buildbot offline. That means that 2.2 is no longer officially supported, and the next release will not run on any 2.2-only platforms. Merry christmas, I guess :).
![](https://secure.gravatar.com/avatar/79b398e90ee81bd64ec95da03c16f36c.jpg?s=120&d=mm&r=g)
Quoting glyph@divmod.com:
Great news ! We may finally enjoy 2.3 optimizations in Twisted : I think about string module, list comprehensions, optparse, new style classes... without introducing changes (just syntaxic/optimization changes). Would it be the good moment to open a topic in the bug tracker to hold these patches ? Or it's better to wait for a sprint, when all these changes could be made ? Thanks for everything, -- Thomas
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 12/28/05, Thomas HERVE <therve@free.fr> wrote:
Wow man, where have you been? The string module has been mostly obsolete since (I think) 2.0, and the list comps and new style classes were already in Python 2.2. I can't remember about optparse; all Twisted code uses twisted.python.usage. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
![](https://secure.gravatar.com/avatar/79b398e90ee81bd64ec95da03c16f36c.jpg?s=120&d=mm&r=g)
Quoting Christopher Armstrong <radeex@gmail.com>:
Well I do know that, but what's the reason why I see so many "import string" in the trunk ? Why I see so many classes that don't subclass object ? I know it's a lot of work, so I was just asking if it's in the roadmap or not.
I can't remember about optparse; all Twisted code uses twisted.python.usage.
Wouldn't it be better to subclass OptParse ? I have the feeling usage.Options does nearly the same things. -- Thomas
![](https://secure.gravatar.com/avatar/7ed9784cbb1ba1ef75454034b3a8e6a1.jpg?s=120&d=mm&r=g)
On Tue, 27 Dec 2005 14:59:00 +0100, Thomas HERVE <therve@free.fr> wrote:
Patches that remove usage of the string module will surely be accepted. :) Patches that introduce object as a base class may not be. Classic classes behave differently than new-style classes. It is not always possible to replace the former with the latter while maintaining API compatibility.
Perhaps OptParse should subclass usage.Options. Seriously. We looked at switching to optparse a while ago. t.p.u is better. Nothing stops you from using optparse with Twisted, though. Jean-Paul
![](https://secure.gravatar.com/avatar/79b398e90ee81bd64ec95da03c16f36c.jpg?s=120&d=mm&r=g)
Quoting Jean-Paul Calderone <exarkun@divmod.com>:
Patches that remove usage of the string module will surely be accepted. :)
It would be good : I count 94 occurences of string import in the trunk. I'll open a topic.
Ok, thanks for your answer. I miss new-style class for mainly one thing : the automatic __init__, great for subclasses. -- Thomas
![](https://secure.gravatar.com/avatar/d6328babd9f9a98ecc905e1ccac2495e.jpg?s=120&d=mm&r=g)
On Tue, 27 Dec 2005 15:45:48 +0100, Thomas HERVE <therve@free.fr> wrote:
This is a worthwhile goal since we made the decision to stop importing the string module several years ago, however: Just because Python2.2 support has been dropped does not mean that we should waste time crawling all over the codebase to update "old" code to the new standard. 1) Somebody might still have to backport it one day. We aren't going to support that, but neither should we make it unnecessarily difficult. 2) If you're that enthused to do work on Twisted, there are lots of other, more worthwhile projects you could be engaging in. I'm tempted to write a list, but you know where the bugtracker is. Let's not make any unnecessary work. If you're interested in stylistic improvements, one thing you might want to look at is removing uses of deprecated trial APIs such as wait() from the unit tests.
How is __init__ more automatic in new-style classes? Do you mean super()? At any rate, when we do start a new-style push, we should probably have a 'from twisted import __metaclass__' at the top of each file, to make updating the codebase to incorporate object-model and/or debugging enhancements easier.
![](https://secure.gravatar.com/avatar/79b398e90ee81bd64ec95da03c16f36c.jpg?s=120&d=mm&r=g)
Quoting glyph@divmod.com:
[Issue created here : http://twistedmatrix.com/bugs/issue1381].
Ok I understand that. Hopefully it doesn't apply to the string module :).
Great. I'm willing to work on Twisted, and I have time for that. I work full-time on Twisted-based applications, and my employer is well-disposed to give a bit of this time to Twisted itself. Indeed taking tasks in the bts is a good way to help Twisted.
Well I mean like that: class MyClass(TwistedClass): def __init__(self, myargs): super(TwistedClass, self).__init__() # doesn't work TwistedClass.__init__(self) # doesn't work either
I remember seeing this in Nevow, without understanding it at first. It seeems to solve the super problem, but looks a bit like black magic :). Thanks a lot for your patience, I'll try to bit less noisy and more useful. -- Thomas
![](https://secure.gravatar.com/avatar/46f609c9bea026767ebae519e0656656.jpg?s=120&d=mm&r=g)
On 12/28/05, Thomas HERVE <therve@free.fr> wrote:
Don't rock the boat. Don't fix what ain't broken. etc. New classes often subclass object, and new code always uses str methods. I do seem to remember that there was a big str-method change to Twisted a while back, for the sake of optimisation. I don't see any similar improvement to having a big festival for switching everything to object.
I'm pretty sure that debate has been had, although I don't know if it was on the mailing list. I suggest searching the archives. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | -- http://radix.twistedmatrix.com | Release Manager, Twisted Project \\\V/// | -- http://twistedmatrix.com |o O| | w----v----w-+
participants (13)
-
Avleen Vig
-
Christopher Armstrong
-
Daniel Henninger
-
glyph@divmod.com
-
James Y Knight
-
Jean-Paul Calderone
-
Jim Fulton
-
Jonathan Lange
-
Magnus Lycka
-
markw
-
Mary Gardiner
-
Phil Mayers
-
Thomas HERVE