we no longer use global name space in our shared objects which seems to have a side effect on modules who in turn try to load it's own shared objects because they too inherit the non-global namespace param. you can either add an attribute to the modues.conf to ask it to load with global name space <load module="mod_foo" global="true"/> or you can edit the code to request global loading every time. by adding the param SMODF_GLOBAL_SYMBOLS to the SWITCH_MODULE_DEFINITION macro (See mod_cepstral at the top) On Mon, Dec 1, 2008 at 2:31 AM, Traun Leyden <tleyden@branchcut.com> wrote:
Message: 9 Date: Sun, 30 Nov 2008 18:42:30 -0800 (PST) From: Marc Orenberg <marc@kasteris.com> Subject: [Freeswitch-users] Problem importing modules in mod_python To: freeswitch-users@lists.freeswitch.org Message-ID: <195670.44941.qm@web50805.mail.re2.yahoo.com> Content-Type: text/plain; charset="iso-8859-1"
In the latter versions of mod_python, I'm unable to import standard python modules such as time and MySQLdb.? For example, the following script works fine in version 1.0.1:
??? ??? import time ??? ??? import os ??? ??? from freeswitch import * ??? ??? def handler(session, args): ??? ??? ??? session.answer() ??? ??? ??? session.execute("sleep", "2000") ??? ??? ??? session.streamFile("/usr/local/freeswitch/prompts/01Welcome.wav") ??? ??? ??? return(session)
But in freeswitch-1.0.latest.tar.gz, and svn versions 10556-10558, I get the following error:
??? ??? 2008-11-30 21:13:09 [ERR] mod_python.c:129 eval_some_python() Error reloading module ??? ??? Traceback (most recent call last): ??????? File "/usr/lib/python2.4/site-packages/scripts/test.py", line 1, in ? ??? ??? import time ??? ??? ImportError: /usr/lib/python2.4/lib-dynload/timemodule.so: undefined symbol: PyExc_ValueError
Thanks for your help!
I have run into the same problem and put some documentation on the wiki:
http://wiki.freeswitch.org/wiki/Mod_python#ImportError:_.2F...2Fdatetime.so:...
I think something changed in freeswitch in the way it is loading modules, or at least the way it is loading mod_python. This behavior appeared all of the sudden in recent freeswitch versions.
HTH
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400