Problem with informixdb and python1.5.2

Stephen J. Turner sjturner at ix.netcom.com
Fri Jul 23 09:08:53 EDT 1999


Dominic Binks wrote:
> 
> Ken Liu wrote:
>>
>> Python 1.5.2 (#8, Jul  1 1999, 20:22:25)  [GCC 2.7.2.3] on linux2
>> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>> >>> import informixdb
>> >>> con = informixdb.informixdb('acme_online_demo')
>> Traceback (innermost last):
>>   File "<stdin>", line 1, in ?
>>   File "informixdb.py", line 47, in __init__
>>     self.conn = _informixdb.informixdb(logon)
>> InformixdbError: Error -922 performing LOGON: Cannot get name of current
>> working directory.
>> >>>
> 
> Can informix read your current working directory?  I've certainly seen
> this cause problems with dbaccess, so I don't see why the ESQL/C
> libraries should be much different.

As it happens, Ken's problem turned out to be not with the informixdb
module nor the Informix ESQL/C runtime, but with the Python interpreter
-- or more precisely, the C runtime library(ies) with which Python was
linked.  All calls to the getcwd C function were failing with an errno
of ENOENT, as seen below in the exception raised by the os.getcwd Python
function:

>>> import os
>>> os.getcwd()
Traceback (innermost last):
  File "<stdin>", line 1, in ?
OSError: [Errno 2] No such file or directory
>>>

Using ldd to check the list of shared objects loaded for the python
executable revealed the problem's root cause.  Ken explained in an
email:
> thanks, this allowed me to track down the problem.  In order to get readline
> support, I had to link against libtermcap, which linked against libc.so.5,
> so my python was linked against both libc.so.6 and libc.so.5, and chaos
> ensued.  So now I changed it to link against libncurses and everything is
> working great.

Don't you just love a story with a happy ending? :-)

--
Stephen J. Turner <sjturner at ix.netcom.com>




More information about the Python-list mailing list