<unloaded module =“”'sslcontext'=“”>对象在Mercurial钩子上不可调用

时间:2015-06-25 20:12:35

标签: python post mercurial hook

我有一个运行apache的Ubuntu服务器和一个用hgweb.cgi脚本设置的mercurial。

我想要做的是设置一个传入的挂钩,通过一个post请求将一些数据发送到我的另一台服务器,所以,在我的hgweb.config中我有:

[hooks]
incoming=python:/var/hg/testing_hook.py:my_hook

和我的testing_hook.py

import requests                                                                                                                                                                           

def my_hook(ui,repo,**kwargs):    
    params = {'dest':'user1','subject':'incoming','message':'new incoming hook'}
    response = requests.post("https://my-url.net/my_api",data=params)

问题是我收到以下错误:

remoto: adding changesets
remoto: adding manifests
remoto: adding file changes
remoto: added 1 changesets with 1 changes to 1 files
error: incoming hook raised an exception: <unloaded module 'SSLContext'> object is not callable

奇怪的是,如果我只是通过命令shell调用脚本,它可以正常工作。

由于正在调用钩子,它看起来不像是一个权限问题......

任何sugestions?

0 个答案:

没有答案