FirebirdSQL / fdb

Firebird Driver for Python
https://www.firebirdsql.org/en/devel-python-driver/
Other
60 stars 26 forks source link

fbclient.dll is sometimes not found [PYFB27] #49

Closed firebird-automations closed 11 years ago

firebird-automations commented 11 years ago

Submitted by: Virgo Pärna (virgo)

fbclient.dll is not found by _dlopen.

Traceback (most recent call last): File "test_fb.py", line 4, in <module> import fdb File "D:\Python33\lib\site-packages\fdb-1.0-py3.3.egg\fdb\__init__.py", line 23, in <module> from fdb.fbcore import * File "D:\Python33\lib\site-packages\fdb-1.0-py3.3.egg\fdb\http://fbcore.py", line 26, in <module> from . import ibase File "D:\Python33\lib\site-packages\fdb-1.0-py3.3.egg\fdb\http://ibase.py", line 41, in <module> fb_library = WinDLL(fb_library_name) File "D:\Python33\lib\ctypes\__init__.py", line 353, in __init__ self._handle = _dlopen(self._name, mode) TypeError: bad argument type for built-in operation

I fixed it for myselt by adding: elif sys.platform in ['win32']: fb_library_name = find_library('fbclient.dll')

into http://ibase.py. But i don't know, if it's needed for every Python versions/Windows version. I don't have 64 bit python installed, so I don't know, if it is issue there do. In that case probably 64 bit Windows should probably have special behavior also.

Commits: FirebirdSQL/fdb@23357120aa0a2099885b159f2c388676285b9ccf

firebird-automations commented 11 years ago

Commented by: @pcisar

This is a bug in ctypes find_library, see http://bugs.python.org/issue16283 As only stars know when it would be fixed, I'll apply your patch as it appears as good enough workaround that doesn't have any unwanted side effects on other platforms nor Windows in general.

firebird-automations commented 11 years ago
Modified by: @pcisar status: Open \[ 1 \] =\> Closed \[ 6 \] resolution: Fixed \[ 1 \] Fix Version: 1\.1 \[ 10520 \]