centos上执行SVN的mailer.py时报错You need version 1.5.0 or better of the Subversion Python bindings.

来源:互联网 发布:cdn网络节点 编辑:程序博客网 时间:2024/06/06 11:42

在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

很简单就是在提交的时候执行了一个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.fsimport svn.deltaimport svn.reposimport svn.coreexcept 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.
这里的一种解决办法是:

yum install subversion-python

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



作者:憨厚老实内裤君
链接:https://www.jianshu.com/p/1f4113021e63
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
阅读全文
'); })();
0 0
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 提名 金像奖提名 金笔提名什么生肖 金酸梅奖提名 诺贝尔奖提名 金笔提名什么意思 金鸡奖提名公布 金榜提名居第一猜一生肖 金笔提名打一生肖 金像奖提名名单 名人堂提名名单 金笔提名什么动物 第32届金鸡奖提名 2019诺贝尔化学奖提名 2019诺贝尔物理学奖提名 诺贝尔物理学奖提名 2019年诺贝尔物理学奖提名 提喻 提喻和转喻的区别 提奥 梵高与提奥 姓提 提子 提子功效 提子葡萄 葡萄提子 提子热量 提子皮 提子图片 提子上火吗 葡萄和提子 提子和葡萄 怎么洗提子 孕妇吃提子 青提子 红提子 狗吃提子 马奶提子 提子的热量 玫瑰香提子 玫瑰提子