You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Brad Lemings <br...@rebit.com> on 2012/03/22 17:14:30 UTC

getversion.py invalid syntax

Hello all,

I get the following error with Python 2.x, 3.1.x, and 3.2.x:

T:\src\subversion-1.7.4>win-tests.py
Traceback (most recent call last):
  File "T:\src\subversion-1.7.4\win-tests.py", line 109, in <module>
    import gen_win
  File "build\generator\gen_win.py", line 38, in <module>
    import generator.swig.header_wrappers
  File "build\generator\swig\__init__.py", line 29, in <module>
    from generator.gen_base import _collect_paths
  File "build\generator\gen_base.py", line 39, in <module>
    import getversion
  File "build\getversion.py", line 67
    except IOError, e:
                  ^
SyntaxError: invalid syntax

T:\src\subversion-1.7.4>python --version
Python 2.7.2

T:\src\subversion-1.7.4>python --version
Python 3.1.4

T:\src\subversion-1.7.4>python --version
Python 3.2.2

Is this a known bug?

Thanks.


Re: getversion.py invalid syntax

Posted by Brian Neal <bg...@gmail.com>.
The syntax

except IOError, e:

is perfectly valid in Python 2.7. Are you sure you are getting that
particular error under 2.7?

You'd have to change it to this for Python 3.x:

except IOError as e:

But that would not be backwards compatible with 2.x. Using a tool like
2to3.py may help produce a version of the script that could run under
Python 3.x.

Best,
BN

RE: getversion.py invalid syntax

Posted by Brad Lemings <br...@rebit.com>.
Hi Daniel,

Don't know about 2.5 but 2.6 is still actively maintained so I can't argue with that.  :)  Guess it is just easier to install Python 2.6 than make the scripts backwards-compatible with newer Python versions.

Thanks.

-----Original Message-----
From: Daniel Shahaf [mailto:danielsh@elego.de] 
Sent: Thursday, March 22, 2012 11:10 AM
To: Brad Lemings
Cc: users@subversion.apache.org
Subject: Re: getversion.py invalid syntax

No, it's not a known bug.  We require 2.5 or newer, so we'll be happy to accept patches here as long as they don't break compat with those older versions.

Daniel
(I'm assuming there are other except: statements affected by this)

Brad Lemings wrote on Thu, Mar 22, 2012 at 09:14:30 -0700:
> Hello all,
> 
> I get the following error with Python 2.x, 3.1.x, and 3.2.x:
> 
> T:\src\subversion-1.7.4>win-tests.py
> Traceback (most recent call last):
>   File "T:\src\subversion-1.7.4\win-tests.py", line 109, in <module>
>     import gen_win
>   File "build\generator\gen_win.py", line 38, in <module>
>     import generator.swig.header_wrappers
>   File "build\generator\swig\__init__.py", line 29, in <module>
>     from generator.gen_base import _collect_paths
>   File "build\generator\gen_base.py", line 39, in <module>
>     import getversion
>   File "build\getversion.py", line 67
>     except IOError, e:
>                   ^
> SyntaxError: invalid syntax
> 
> T:\src\subversion-1.7.4>python --version Python 2.7.2
> 
> T:\src\subversion-1.7.4>python --version Python 3.1.4
> 
> T:\src\subversion-1.7.4>python --version Python 3.2.2
> 
> Is this a known bug?
> 
> Thanks.
> 

Re: getversion.py invalid syntax

Posted by Daniel Shahaf <da...@elego.de>.
No, it's not a known bug.  We require 2.5 or newer, so we'll be happy to
accept patches here as long as they don't break compat with those older
versions.

Daniel
(I'm assuming there are other except: statements affected by this)

Brad Lemings wrote on Thu, Mar 22, 2012 at 09:14:30 -0700:
> Hello all,
> 
> I get the following error with Python 2.x, 3.1.x, and 3.2.x:
> 
> T:\src\subversion-1.7.4>win-tests.py
> Traceback (most recent call last):
>   File "T:\src\subversion-1.7.4\win-tests.py", line 109, in <module>
>     import gen_win
>   File "build\generator\gen_win.py", line 38, in <module>
>     import generator.swig.header_wrappers
>   File "build\generator\swig\__init__.py", line 29, in <module>
>     from generator.gen_base import _collect_paths
>   File "build\generator\gen_base.py", line 39, in <module>
>     import getversion
>   File "build\getversion.py", line 67
>     except IOError, e:
>                   ^
> SyntaxError: invalid syntax
> 
> T:\src\subversion-1.7.4>python --version
> Python 2.7.2
> 
> T:\src\subversion-1.7.4>python --version
> Python 3.1.4
> 
> T:\src\subversion-1.7.4>python --version
> Python 3.2.2
> 
> Is this a known bug?
> 
> Thanks.
>