CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了centos上执行SVN的mailer.py时报错You need version 1.5.0 or better of the Subversion Python bindings.大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

在centos7上配置SVN的邮件提醒功能.使用post-commit的hooks函数,详细配置请随意谷歌百度.这里上一下post-commit的代码: REPOS="$1" REV="$2" /usr/share/doc/subversion-1.7.14/hook-scripts/mailer/mailer.py "$REPOS" "$REV" /var/svn/svnrepos/mailer
 

在centos7上配置SVN的邮件提醒功能.使用post-commit的hooks函数,详细配置请随意谷歌百度.这里上一下post-commit的代码:

REPOS="$1"

REV="$2"

/usr/share/doc/subversion-1.7.14/hook-scripts/mailer/mailer.py "$REPOS" "$REV" /var/svn/svnrepos/mailer.conf

很简单就是在提交的时候执行了@L_328_5@mailer.py的函数

可是当我测试时候,发现报错:You need version 1.5.0 or better of the Subversion Python bindings.

既然是和python有关的问题那么请大家看一下这个mailer.py函数关于这个报错的部分

import tempfile

# Minimal version of Subversion's bindings required

_MIN_SVN_VERSION = [1,5,0]

# Import the Subversion Python bindings,making sure they meet our

# minimum version requirements.

try:

import svn.fs

import svn.delta

import svn.repos

import svn.core

except ImportError:

sys.stderr.write(

"You need version %s or better of the Subversion Python bindings.\n" \

% ".".join([str(X) for x in _MIN_SVN_VERSION]))

sys.exit(1)

if _MIN_SVN_VERSION > [svn.core.SVN_VER_MAJOR,svn.core.SVN_VER_MINOR,svn.core.SVN_VER_PATCH]:

sys.stderr.write(

"You need version %s or better of the Subversion Python bindings.\n" \

% ".".join([str(X) for x in _MIN_SVN_VERSION]))

sys.exit(1)

stackoverflow上的大佬给的两种解释是1) svn.core cAnnot be imported,or 2) the version number in svn.core is too low.@H_262_34@这里的一种解决办法是:

yum install subversion-python

之后再测试.不再报错.发送成功!

作者:憨厚老实内裤君 链接https://www.jianshu.com/p/1f4113021e63 來源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

大佬总结

以上是大佬教程为你收集整理的centos上执行SVN的mailer.py时报错You need version 1.5.0 or better of the Subversion Python bindings.全部内容,希望文章能够帮你解决centos上执行SVN的mailer.py时报错You need version 1.5.0 or better of the Subversion Python bindings.所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。