How to apply python patch for issue9729

Chris Angelico rosuav at gmail.com
Mon Feb 23 19:12:02 EST 2015


On Tue, Feb 24, 2015 at 8:09 AM, Sada Shirol <get2sada at gmail.com> wrote:
> Upon some research found that I need to apply below patch:
>
> http://bugs.python.org/issue9729
>
> How do I apply a patch to python 2.6.6 on Linux?

Hmm. You have a bit of a problem there: The patch wasn't designed to
apply to 2.6. So you may find that it doesn't apply at all, or needs
some tweaking. But the basic plan would be: Grab the source code for
either 2.6.9 or the exact 2.6.6 that was built for your system, build
it and run the test suite (just to make sure), then apply the patch,
compile again, and rerun the test suite. However, that's going to be a
lot of hassle, and may well break stuff on your system.

What I'd recommend is this: Don't try to patch your existing 2.6.6,
but instead, grab yourself a Python 2.7 as a secondary. See if you can
simply install a package named python2.7 (apt-get install python2.7,
or yum install python2.7), or if that fails, grab the source code
(either the 2.7.8 release or the latest from the 2.7 branch in
Mercurial) and compile it. Either way, it'd be an *alternate* Python;
when you simply run "python", you'll continue to run the unpatched
2.6.6, but if you explicitly run "python2.7", you'll get the newer
version. That way, you can't break anything that, wittingly or
unwittingly, depends on the behaviour of 2.6; but if you want the
patch, you can easily call it up.

And then, of course, test. Test test test. But you knew that part already. :)

ChrisA



More information about the Python-list mailing list