[Freeswitch-dev] Error using gpgme in mod_python

mbo mbodbg at gmx.net
Tue Feb 8 22:36:42 MSK 2011


Hello NG,

we are launching a python script which is accessing the gpgme libary for encryption/decryption : 

import os
import gpgme
from freeswitch import *

ctx=gpgme.Context()
ctx.get_key(’B9F2747A’)


If we run this python script direcly in the command line (without "from freeswitch import *"), everything works fine. If we call the script within freeswitch using the mod_python module, we receive the following debug output, when the environment variable GPGME_DEBUG is set to „9:/tmp“:

...
gpgme_op_keylist_start: enter: ctx=0x7fcd8c2078c0, pattern=B9F2747A, secret_only=0
GPGME 2011-02-07 21:40:58 <0x3b06>      _gpgme_io_pipe: enter: filedes=0x7fcd8c1e5bc8, inherit_idx=1 (GPGME uses it for reading)
GPGME 2011-02-07 21:40:58 <0x3b06>      _gpgme_io_pipe: leave: read=0x1a5, write=0x1a6
GPGME 2011-02-07 21:40:58 <0x3b06>      _gpgme_io_set_close_notify: enter: fd=0x1a5, close_handler=0x7fcd84074420/0x7fcd8c1e5ba0
GPGME 2011-02-07 21:40:58 <0x3b06>      _gpgme_io_set_close_notify: error: Invalid argument
GPGME 2011-02-07 21:40:58 <0x3b06>      _gpgme_io_close: enter: fd=0x1a5
GPGME 2011-02-07 21:40:58 <0x3b06>      _gpgme_io_close: leave: result=0
GPGME 2011-02-07 21:40:58 <0x3b06>      _gpgme_io_close: enter: fd=0x1a6
GPGME 2011-02-07 21:40:58 <0x3b06>      _gpgme_io_close: leave: result=0
GPGME 2011-02-07 21:40:58 <0x3b06>    gpgme_op_keylist_start: error: General error <GPGME>
GPGME 2011-02-07 21:40:58 <0x3b06>    gpgme_release: call: ctx=0x7fcd8c2078c0
GPGME 2011-02-07 21:40:58 <0x3b06>  gpgme_get_key: error: General error <GPGME>
... 

Full trace can be seen here: http://pastebin.freeswitch.org/15285  

Here are the versions we are using:

Debian 5.5, Kernel 2.6.26-2-amd64 #1 SMP Tue Jan 25 05:59:43 UTC 2011 x86_64 GNU/Linux
FreeSWITCH Version 1.0.head (git-2ec2a9b 2011-02-04 09-40-04 -0600)
gpgme-1.3.0
libassuan-2.0.1
libgpg-error-1.10
pygpgme-0.1+bzr20090820




More information about the FreeSWITCH-dev mailing list