Subject Re: [firebird-python] fbclient.dll version conflict
Author Werner F. Bruhin
Pavel,

Pavel Cisar wrote:
> Werner F. Bruhin napsal(a):
>
>
>> That is strange, I am using Kinterbasdb 3.3 and when I put a
>> fbclient.dll into windows/system32 it is found and loaded, even so I
>> have one in my application folder which is also set as the cwd.
>>
>> BTW, my application is frozen using py2exe and therefore kinterbasdb is
>> in "whatever install folder/prog/lib/library.zip", where the frozen exe
>> is in "whatever install folder/prog/", and the later is the working folder.
>>
>> Could it be that the frozen folder structure is an issue?
>>
>> What would be your recommendation to deal with this?
>>
>
> I'm no expert in dealing with zipped packages (special import machinery
> is still a black magic for me), but yes, it's the prime suspect. You may
> try to put few debug messages into KInterbasDB __init__.py that imports
> the client library to see where it is actually searched in this special
> case. It might give us a clue how to "fix" that.
>
I added some print debug statements, the relevant ones are:
print 'found lib:'
print clientLibDir
if clientLibDir:
origOSPath = os.environ['PATH'].decode(_FS_ENCODING)
os.environ['PATH'] = (
origOSPath + os.pathsep + clientLibDir
).encode(_FS_ENCODING)

print 'path with found lib'
print os.environ['PATH']

# At least with FB 1.5.2, the FIREBIRD environment variable must
# also be set in order for all features to work properly.
os.environ['FIREBIRD'] = clientLibDir.encode(_FS_ENCODING)
print 'os env:'
print os.environ['FIREBIRD']

And I get this:

found lib:
C:\Program Files\TheWineCellarBook\prog
path with found lib
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
Files\QuickTi
me\QTSystem\;C:\Program Files\TheWineCellarBook\prog
os env:
C:\Program Files\TheWineCellarBook\prog

So, fbclient.dll is found in the right place, but I think the path is
not correctly set, should it not put the folder at the beginning of the
path?

I.e. change the code from:
os.environ['PATH'] = (
origOSPath + os.pathsep + clientLibDir
).encode(_FS_ENCODING)

to:
os.environ['PATH'] = (
clientLibDir + os.pathsep + origOSPath
).encode(_FS_ENCODING)

BTW, the version string for 3.3.0 which I just downloaded says:

(3, 3, 0, 'pre-alpha', 0)

should it not be final?

Werner