You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David James <ja...@gmail.com> on 2009/03/21 17:04:36 UTC

Requiring Python 2.6 (was: Re: svn commit: r35458 - in branches/python-3-compatibility: . build subversion/bindings/swig subversion/tests/cmdline subversion/tests/cmdline/svntest tools/hook-scripts)

On Sun, Jan 25, 2009 at 11:25 AM, Arfrever Frehtes Taifersar Arahesis
<Ar...@gmail.com> wrote:
> On the 'python-3-compatibility' branch:
> Require Python >=2.6.
> (Actually Python <2.6 wasn't supported earlier.)

Hi Arfrever,

Is it possible to support Python 3.0 without breaking compatibility
with Python 2.4? I know that a lot of people are still using Python
2.4, and I expect that this will still be the case when Subversion 1.7
comes out. (In particular, Python 2.4 compatibility is important for
the bindings, but I expect that folks will also want to be able to run
the test suite and build system.)

Many users of Subversion use Red Hat Enterprise Linux, and upgrade to
new versions of RHEL about once every four years (when their version
of RHEL exits its "Production 1" phase). If users follow this
schedule, they will still be using Python 2.4 until at least March 31,
2011 (see http://www.redhat.com/security/updates/errata/).

Cheers,

David

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1373939

Re: Requiring Python 2.6 (was: Re: svn commit: r35458 - in branches/python-3-compatibility: . build subversion/bindings/swig subversion/tests/cmdline subversion/tests/cmdline/svntest tools/hook-scripts)

Posted by Blair Zajac <bl...@orcaware.com>.
David James wrote:
> On Sat, Mar 21, 2009 at 10:08 AM, Mark Phippard <ma...@gmail.com> wrote:
>> On Sat, Mar 21, 2009 at 1:04 PM, David James <ja...@gmail.com> wrote:
>>> On Sun, Jan 25, 2009 at 11:25 AM, Arfrever Frehtes Taifersar Arahesis
>>> <Ar...@gmail.com> wrote:
>>>> On the 'python-3-compatibility' branch:
>>>> Require Python >=2.6.
>>>> (Actually Python <2.6 wasn't supported earlier.)
>>> Hi Arfrever,
>>>
>>> Is it possible to support Python 3.0 without breaking compatibility
>>> with Python 2.4? I know that a lot of people are still using Python
>>> 2.4, and I expect that this will still be the case when Subversion 1.7
>>> comes out. (In particular, Python 2.4 compatibility is important for
>>> the bindings, but I expect that folks will also want to be able to run
>>> the test suite and build system.)
>>>
>>> Many users of Subversion use Red Hat Enterprise Linux, and upgrade to
>>> new versions of RHEL about once every four years (when their version
>>> of RHEL exits its "Production 1" phase). If users follow this
>>> schedule, they will still be using Python 2.4 until at least March 31,
>>> 2011 (see http://www.redhat.com/security/updates/errata/).
>> I do not think RHEL 5 even has Python 2.4.  We had to apply a patch to
>> Subversion when we built 1.6 so that we could still support the Python
>> included in RHEL 4/5.
> 
> AFAIK, RHEL 4 uses Python 2.3, but RHEL 5 uses Python 2.4. See
> 
>   http://rpm.pbone.net/index.php3/stat/4/idpl/8965075/com/python-2.3.4-14.7.el4.x86_64.rpm.html
>   http://rpm.pbone.net/index.php3/stat/4/idpl/8081126/com/python-2.4.3-21.el5.x86_64.rpm.html

That's right.  Our Centos 5.x systems have Python 2.4.

And I agree we should maintain compatibility with Python 2.4, given we haven't 
even started migrating our 2,000 systems to Centos 5 from Centos 4.

Regards,
Blair

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1375045

Re: Requiring Python 2.6 (was: Re: svn commit: r35458 - in branches/python-3-compatibility: . build subversion/bindings/swig subversion/tests/cmdline subversion/tests/cmdline/svntest tools/hook-scripts)

Posted by David James <ja...@gmail.com>.
On Sat, Mar 21, 2009 at 10:08 AM, Mark Phippard <ma...@gmail.com> wrote:
> On Sat, Mar 21, 2009 at 1:04 PM, David James <ja...@gmail.com> wrote:
>> On Sun, Jan 25, 2009 at 11:25 AM, Arfrever Frehtes Taifersar Arahesis
>> <Ar...@gmail.com> wrote:
>>> On the 'python-3-compatibility' branch:
>>> Require Python >=2.6.
>>> (Actually Python <2.6 wasn't supported earlier.)
>>
>> Hi Arfrever,
>>
>> Is it possible to support Python 3.0 without breaking compatibility
>> with Python 2.4? I know that a lot of people are still using Python
>> 2.4, and I expect that this will still be the case when Subversion 1.7
>> comes out. (In particular, Python 2.4 compatibility is important for
>> the bindings, but I expect that folks will also want to be able to run
>> the test suite and build system.)
>>
>> Many users of Subversion use Red Hat Enterprise Linux, and upgrade to
>> new versions of RHEL about once every four years (when their version
>> of RHEL exits its "Production 1" phase). If users follow this
>> schedule, they will still be using Python 2.4 until at least March 31,
>> 2011 (see http://www.redhat.com/security/updates/errata/).
>
> I do not think RHEL 5 even has Python 2.4.  We had to apply a patch to
> Subversion when we built 1.6 so that we could still support the Python
> included in RHEL 4/5.

AFAIK, RHEL 4 uses Python 2.3, but RHEL 5 uses Python 2.4. See

  http://rpm.pbone.net/index.php3/stat/4/idpl/8965075/com/python-2.3.4-14.7.el4.x86_64.rpm.html
  http://rpm.pbone.net/index.php3/stat/4/idpl/8081126/com/python-2.4.3-21.el5.x86_64.rpm.html

I don't know what version of Python RHEL 6 will have.

Cheers,

David

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1374119


Re: Requiring Python 2.6 (was: Re: svn commit: r35458 - in branches/python-3-compatibility: . build subversion/bindings/swig subversion/tests/cmdline subversion/tests/cmdline/svntest tools/hook-scripts)

Posted by Mark Phippard <ma...@gmail.com>.
On Sat, Mar 21, 2009 at 1:04 PM, David James <ja...@gmail.com> wrote:
> On Sun, Jan 25, 2009 at 11:25 AM, Arfrever Frehtes Taifersar Arahesis
> <Ar...@gmail.com> wrote:
>> On the 'python-3-compatibility' branch:
>> Require Python >=2.6.
>> (Actually Python <2.6 wasn't supported earlier.)
>
> Hi Arfrever,
>
> Is it possible to support Python 3.0 without breaking compatibility
> with Python 2.4? I know that a lot of people are still using Python
> 2.4, and I expect that this will still be the case when Subversion 1.7
> comes out. (In particular, Python 2.4 compatibility is important for
> the bindings, but I expect that folks will also want to be able to run
> the test suite and build system.)
>
> Many users of Subversion use Red Hat Enterprise Linux, and upgrade to
> new versions of RHEL about once every four years (when their version
> of RHEL exits its "Production 1" phase). If users follow this
> schedule, they will still be using Python 2.4 until at least March 31,
> 2011 (see http://www.redhat.com/security/updates/errata/).

I do not think RHEL 5 even has Python 2.4.  We had to apply a patch to
Subversion when we built 1.6 so that we could still support the Python
included in RHEL 4/5.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1373960

Re: Requiring Python 2.6 (was: Re: svn commit: r35458 - in branches/python-3-compatibility: . build subversion/bindings/swig subversion/tests/cmdline subversion/tests/cmdline/svntest tools/hook-scripts)

Posted by Branko Cibej <br...@xbc.nu>.
David James wrote:
> On Sun, Jan 25, 2009 at 11:25 AM, Arfrever Frehtes Taifersar Arahesis
> <Ar...@gmail.com> wrote:
>   
>> On the 'python-3-compatibility' branch:
>> Require Python >=2.6.
>> (Actually Python <2.6 wasn't supported earlier.)
>>     
>
> Hi Arfrever,
>
> Is it possible to support Python 3.0 without breaking compatibility
> with Python 2.4? I know that a lot of people are still using Python
> 2.4, and I expect that this will still be the case when Subversion 1.7
> comes out. (In particular, Python 2.4 compatibility is important for
> the bindings, but I expect that folks will also want to be able to run
> the test suite and build system.)
>   

Seconded. Unless you intend to merge this branch to trunk at least five
years from now.

-- Brane

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1374299

Re: Requiring Python 2.6 (was: Re: svn commit: r35458 - in branches/python-3-compatibility: . build subversion/bindings/swig subversion/tests/cmdline subversion/tests/cmdline/svntest tools/hook-scripts)

Posted by Barry Scott <ba...@barrys-emacs.org>.
On 21 Mar 2009, at 20:10, David James wrote:

>  2. Convert their source code to use syntax that works in all
> versions of Python
>

PySVN code is 2.6/3.0 compatible and uses a command to
backport the code to earlier versions.

As you spotted the big problem is exception syntax.
The backport command simple changes the syntax
from as to ",".

Atleast for pysvn the other differnces can to handled at runtime
after the exception syntax has been fixed.

Barry

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1382574

Re: Requiring Python 2.6 (was: Re: svn commit: r35458 - in branches/python-3-compatibility: . build subversion/bindings/swig subversion/tests/cmdline subversion/tests/cmdline/svntest tools/hook-scripts)

Posted by David James <ja...@gmail.com>.
On Sat, Mar 21, 2009 at 12:13 PM, Arfrever Frehtes Taifersar Arahesis
<ar...@gmail.com> wrote:
> 2009-03-21 18:04:36 David James napisał(a):
>> On Sun, Jan 25, 2009 at 11:25 AM, Arfrever Frehtes Taifersar Arahesis
>> <Ar...@gmail.com> wrote:
>> > On the 'python-3-compatibility' branch:
>> > Require Python >=2.6.
>> > (Actually Python <2.6 wasn't supported earlier.)
>>
>> Hi Arfrever,
>>
>> Is it possible to support Python 3.0 without breaking compatibility
>> with Python 2.4?
>
> It is rather hard, because Python 2.5 doesn't support some syntax changes
> which were made in Python 3.

You're right -- it is hard. I think that converting Subversion to work
with Python 3 is a really hard task, because there are so many changes
in Python 3.0.

Reading up on the topic, I see that most people use one of two approaches:
  1. Leave your code as-is, but convert your code at build time to
work in Python 3.0 using 2to3
  2. Convert their source code to use syntax that works in all
versions of Python

Folks who use the 2to3 tool have reported that it doesn't work very
well -- a lot of files can't be parsed by the tool. I tried it on
ctypesgen and had little success. But maybe we should file bugs
against 2to3 and fix the bugs? Once 2to3 works well, we can actually
just teach autogen.sh to run 2to3 on our source files if you are using
Python 3.0

As for supporting Python 2.4 and 2.5 without using 2to3, here are a few ideas:

> 'except exception, variable:' => 'except exception as variable:'
> https://svn.collab.net/viewvc/svn?view=revision&revision=35001

According to < http://pythonology.blogspot.com/2009/02/making-code-run-on-python-20-through-30.html
>, you can support all versions by just doing "except exception:" and
then checking sys.exc_info(). Messy, but it works.

> 0123 => 0o123 or 0O123
> https://svn.collab.net/viewvc/svn?view=revision&revision=35608

It looks like most of the uses of octal numbers are for os.chmod. If
you want to write code that works in both Python 2 and 3, you can use
the constants in the stat module. E.g. "stat.S_IRWXU | stat.S_IRWXG |
stat.S_IRWXO"

Cheers,

David

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1374838


Re: Requiring Python 2.6 (was: Re: svn commit: r35458 - in branches/python-3-compatibility: . build subversion/bindings/swig subversion/tests/cmdline subversion/tests/cmdline/svntest tools/hook-scripts)

Posted by Arfrever Frehtes Taifersar Arahesis <Ar...@GMail.Com>.
2009-03-21 18:04:36 David James napisał(a):
> On Sun, Jan 25, 2009 at 11:25 AM, Arfrever Frehtes Taifersar Arahesis
> <Ar...@gmail.com> wrote:
> > On the 'python-3-compatibility' branch:
> > Require Python >=2.6.
> > (Actually Python <2.6 wasn't supported earlier.)
> 
> Hi Arfrever,
> 
> Is it possible to support Python 3.0 without breaking compatibility
> with Python 2.4?

It is rather hard, because Python 2.5 doesn't support some syntax changes
which were made in Python 3.

'except exception, variable:' => 'except exception as variable:'
https://svn.collab.net/viewvc/svn?view=revision&revision=35001

0123 => 0o123 or 0O123
https://svn.collab.net/viewvc/svn?view=revision&revision=35608

"bytes" => b"bytes"
http://docs.python.org/3.0/library/functions.html#bytes

Python 2.6 supports them.

-- 
Arfrever Frehtes Taifersar Arahesis