Python SVN binding on Windows Server 2008 x64

My goal is to use python scripts in subversion \ tools, in particular validate-extensions.py in this case. I am running VisualSVN Server 2.15, built on Subversion 1.6.15 and currently configured on a 32-bit Python 2.7.1 machine.

When I installed the hook, I received an error message that the svn module was not found. I installed the latest libsvn bindings that I could find ( http://trac.edgewall.org/attachment/wiki/TracSubversion/svn-win32-1.6.15_py_2.7.zip from http://trac.edgewall.org/wiki / TracSubversion ), but I still cannot load the svn module. If I run ' from svn import repos ' from the command line, I get:

File "C: \ python27 \ Lib \ site-packages \ libsvn \ core.py", line 21, in swig_import_helper _mod = imp.load_module ('_ core', fp, pathname, description) ImportError: Error loading DLL: specified procedure not found.

Am I missing something? I also tried the 64-bit version of Python27, but the precompiled svn bindings do not seem to be available to him, and I would prefer not to go through all that is required to create them.

Thank you in advance for your help.

+4
source share
2 answers

I found the answer to this question on the Subversion mailing list. The problem is that the Python 2.7 SVN bindings provided by Trac were built using an older version of Apache dll, namely libapr-1.dll, and reference a function called _apr_time_ansi_put @ 8. In later versions of Apache, including VisualSVN 2.1.5, libapr-1.dll is newer, and the function has been renamed to "_apr_time_ansi_put @ 12".

To fix this, I downloaded the old Apache bindings from http://subversion.tigris.org/files/documents/15/47914/svn-win32-1.6.6.zip , renamed VisualSVN \ bin \ libapr-1.dll to libapr -1.dll.bak, copied the old libapr-1.dll to the VisualSVN \ bin folder and restarted the service. No more problems, python from svn import core is working fine, and the validate-extensions.py hook file is working correctly.

+2
source

The integration of trac with svn on Windows seems chaotic.

0
source

Source: https://habr.com/ru/post/1339885/


All Articles