1

I am experiencing issues with my SVN post-commit hook and the fact that it is executed with an empty environment. Everything was working fine till about two weeks ago when my systems administrator upgraded a few things on the server.

My post-commit hook executes a Python script that uses a SVN module to email information about the commit to me. After the recent upgrades, however, Python cannot find the SVN module when executed via the hook. When executed by hand (ie with all environment variables intact) everything works fine.

I have tried setting the PYTHONPATH variable in my post-commit hook directly (PYTHONPATH=/usr/local/lib/svn-python), but that makes no difference.

How can I tell Python where the module is located?

2 Answers 2

1

Your system administrator might have forgotten to execute this command.

echo /usr/local/lib/svn-python \
> /usr/local/lib/python2.x/site-packages/subversion.pth

This is written in subversion/bindings/swig/INSTALL in the source distribution.

Sign up to request clarification or add additional context in comments.

Comments

1

Got it! I missed the export in my post-commit hook script! It should have been:

export PYTHONPATH=/usr/local/lib/svn-python

Problem solved :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.