Get SVN commit revision number in Python 3, "Client.info" from pysvn does not work

1.1k Views Asked by At

This code worked for me in Python 2.7:

client = pysvn.Client()
entry = client.info(file_path)
commit_revision = entry.data.get('commit_revision').number

But in Python 3.8 after installing pysvn 0.1.0 using pip I get the error

'Client' object has no attribute 'info'

What can I use for commit revision in Python 3.8?

1

There are 1 best solutions below

0
mkrieger1 On

I'm assuming that you were using the library PySVN from here before, which according to the documentation does have a Client.info method returning an Entry object.

But by using pip install pysvn, you got pysvn, which is a different library, although it has a similar name.

If you want to use the library you were used to, uninstall the one from pip again and follow the installation instructions on https://pysvn.sourceforge.io/downloads.html instead.