You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <be...@qqmail.nl> on 2016/05/02 09:55:52 UTC

Requiring python 2.7 (Was: RE: svn commit: r1741742 - in /subversion/trunk:contrib/client-side/svn-merge-vendor.py contrib/server-side/fsfsverify.pytools/server-side/svn-backup-dumps.py)

I haven’t reviewed the entire series yet, but where did we discuss requiring python 2.7 for everything?

I remember that we required a newer python for the test suite and some of the release scripts, but we explicitly didn’t include other parts then.

I’m pretty sure we break some legacy platforms if we change things for swig, and some of the installed python scripts.


Bert

Sent from Mail for Windows 10

From: Stefan Fuhrmann
Sent: maandag 2 mei 2016 07:02
To: dev@subversion.apache.org
Subject: Re: svn commit: r1741742 - in /subversion/trunk:contrib/client-side/svn-merge-vendor.py contrib/server-side/fsfsverify.pytools/server-side/svn-backup-dumps.py

On 30.04.2016 14:49, James McCoy wrote:
> On Sat, Apr 30, 2016 at 10:41:59AM -0000, stefan2@apache.org wrote:
>> Work towards Python 3 compatibility.  Since we already require Python 2.7+,
>> we can use the new syntax without further limiting our Python 2 support.
>>
>> Fix leftovers to complete the replacement of print statements with function
>> calls.
>
> You didn't actually change the code to use the print function.  The
> syntax just happens to work on Python 2.x because the () group the
> expression (like parens in math) but it's still a single expression
> provide to the print keyword.
>
> If you actually want to use the print function then you need to add:
>
> [[[
> from __future__ import print_function
> ]]]
>
> to the top of the Python files.  That would also let you use print() for
> the writes to specific files.

You are right but for now, I'm fine with syntactic
compatibility.

My goal is to simply being able to run our build
and test scripts with Python 3.  I don't plan on
switching over or even make it mandatory.

I expect the code to become "cleaner" by e.g.
using centralized functions and symbolic constants
instead of octals.

>> Modified: subversion/trunk/contrib/server-side/fsfsverify.py
>> URL: http://svn.apache.org/viewvc/subversion/trunk/contrib/server-side/fsfsverify.py?rev=1741742&r1=1741741&r2=1741742&view=diff
>> ==============================================================================
>> --- subversion/trunk/contrib/server-side/fsfsverify.py (original)
>> +++ subversion/trunk/contrib/server-side/fsfsverify.py Sat Apr 30 10:41:59 2016
>> @@ -1136,7 +1136,7 @@ if __name__ == '__main__':
>>     (options, args) = parser.parse_args()
>>
>>     if len(args) != 1:
>> -    print >>sys.stderr, "Please specify exactly one rev file."
>> +    sys.stderr.write("Please specify exactly one rev file.\n")
>
> For example, this would change to:
>
> [[[
> from __future__ import print_function
> print('Please specify exactly one rev file.', file=sys.stderr)
> ]]]
>
> This also maintains the behavior of an automatic newline.

I went for the stream write because that's what we
already use in various places.

-- Stefan^2.


RE: Requiring python 2.7 (Was: RE: svn commit: r1741742 - in /subversion/trunk:contrib/client-side/svn-merge-vendor.py contrib/server-side/fsfsverify.pytools/server-side/svn-backup-dumps.py)

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Daniel Shahaf [mailto:d.s@daniel.shahaf.name]
> Sent: maandag 2 mei 2016 14:05
> To: Bert Huijben <be...@qqmail.nl>
> Cc: Stefan Fuhrmann <st...@apache.org>; dev@subversion.apache.org
> Subject: Re: Requiring python 2.7 (Was: RE: svn commit: r1741742 - in
> /subversion/trunk:contrib/client-side/svn-merge-vendor.py contrib/server-
> side/fsfsverify.pytools/server-side/svn-backup-dumps.py)
> 
> Bert Huijben wrote on Mon, May 02, 2016 at 09:55:52 +0200:
> > I haven’t reviewed the entire series yet, but where did we discuss
> requiring python 2.7 for everything?
> 
> Thread: http://mid.gmane.org/55B0AD6B.5050703@wandisco.com
> 
> Docs: https://subversion.apache.org/docs/release-notes/1.9#python-2.7
> 
> My understanding is that this covers build/ and tools/ too, not just
> subversion/tests/.

Thanks for these pointers. These documented decisions answer my questions.

	Bert


Re: Requiring python 2.7 (Was: RE: svn commit: r1741742 - in /subversion/trunk:contrib/client-side/svn-merge-vendor.py contrib/server-side/fsfsverify.pytools/server-side/svn-backup-dumps.py)

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Bert Huijben wrote on Mon, May 02, 2016 at 09:55:52 +0200:
> I haven\u2019t reviewed the entire series yet, but where did we discuss requiring python 2.7 for everything?

Thread: http://mid.gmane.org/55B0AD6B.5050703@wandisco.com

Docs: https://subversion.apache.org/docs/release-notes/1.9#python-2.7

My understanding is that this covers build/ and tools/ too, not just
subversion/tests/.

Cheers,

Daniel