On Mon, 19 Feb 2001, Bob Vastine-Parker wrote:
> Hi All,
>
> Please bear with me - I'm totally new to Python, but experienced with C and
> Perl.
>
> I have been tasked with creating a method of accessing an API written in
> Python from Perl. So far, so good - Inline::Python has been able to do
> everthing that I need, except for one thing: the python scripts I am using
> are written to use the zlibmodule.so. Unfortunately, every time I try to use
> Inline::Python with any code that uses .so modules, I get an error like
> this:
>
> [bob@my1]:~/python$ perl t.pl
> Traceback (innermost last):
> File "<string>", line 12, in ?
> File "summitapi_bob.py", line 22, in ?
> import zlib
> ImportError: /usr/lib/python1.5/lib-dynload/zlibmodule.so: undefined symbol:
> PyExc_ValueError
> Couldn't parse your Python code.
> at t.pl line 3
> BEGIN failed--compilation aborted at t.pl line 3.
>
> Does anyone know of a way to get around this error, or as an alternative,
> does anyone know of a way to do a zlib.decompress in python w/o the .so
> module?
There's an easy fix. You can either apply this patch to Inline::Python
(attached) or you can download Inline-Python-0.12 from CPAN. Be patient, I
just finished uploading it now.
Later,
Neil
--- /usr/lib/perl5/site_perl/5.005/i386-linux/Inline/Python.pm Mon Jan 29 09:29:37
2001
+++ Python.pm Mon Feb 19 14:05:09 2001
@@ -8,13 +8,14 @@
use vars qw(@ISA $VERSION @EXPORT_OK);
@ISA = qw(Inline DynaLoader Exporter);
-$VERSION = '0.11';
+$VERSION = '0.12';
@EXPORT_OK = qw(eval_python);
#==============================================================================
# Load (and initialize) the Python Interpreter
#==============================================================================
+sub dl_load_flags { 0x01 }
Inline::Python->bootstrap($VERSION);
#==============================================================================