You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Collin Winter <co...@gmail.com> on 2005/12/29 13:19:36 UTC

Bug in python bindings

Hello all,

Before posting a bug report, I thought I'd ask for some confirmation
of what I perceive to be a flaw in SVN's python bindings:

"""
$ python
Python 2.4.1 (#1, Sep 20 2005, 12:25:38)
[GCC 3.3.6] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import svn.client
>>> svn.client.import()
  File "<stdin>", line 1
    svn.client.import
                    ^
SyntaxError: invalid syntax
>>
"""
This is happening on Linux 2.6.13 with Subversion 1.2.3 and SWIG 1.3.25.

The reason for this is that "import" is a keyword in python. Note that
there's no compilation failure because svn.client.import is written in
C; you wouldn't notice this bug unless you needed the function.

Short of renaming the C function in libsvn_client/commit.c, the only
solution I see is special-casing this function in the SWIG-generated
bindings, perhaps renaming its python-side version to 'client_import'
or something.

Thanks,
Collin Winter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Bug in python bindings

Posted by Max Bowsher <ma...@ukf.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Collin Winter wrote:
> Before posting a bug report, I thought I'd ask for some confirmation
> of what I perceive to be a flaw in SVN's python bindings:
...
>>>>import svn.client
>>>>svn.client.import()
> 
>   File "<stdin>", line 1
>     svn.client.import
>                     ^
> SyntaxError: invalid syntax
...
> The reason for this is that "import" is a keyword in python.
...
> Short of renaming the C function in libsvn_client/commit.c, the only
> solution I see is special-casing this function in the SWIG-generated
> bindings, perhaps renaming its python-side version to 'client_import'
> or something.


>>> import svn.client
>>> svn.client.svn_client_import
<built-in function svn_client_import>


Max.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFDtBsLfFNSmcDyxYARAragAJ497yYLH4c+HiYXzE8XtKMZ425jWACgyBbS
drxMU1um1+IgwYBdRy4vWDA=
=0xDR
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org