Search code examples
pythonsvn

pysvn does not connect to SVN repo, even if password and username are correct


My goal is to connect to an SVN repo, go to a specific directory and extract the commit times of the files found there. I'm trying to do this with pysvn (a very simple example to try things) and the problem that I'm encountering is that the client object does not have the info2(...) method inside.

client = pysvn.Client()
client.set_default_username = "bar43"
client.set_default_password = "super22"
print(client.info2("C:\\Users\\gp443\\Documents\\repos\\README.txt"))

The error.

'Client' object has no attribute 'info2'

My question is, which step am I missing?


Solution

  • There are two projects which provide a module called pysvn:

    • pysvn which is available from pypi as pysvn
    • pySVN which is much more complete (including your info2 method!) and hosted on sourceforge.

    If you did pip install pysvn, you end up with the wrong project.

    Apparently you're not the first person to fall into this trap as evidenced by this issue.