[SQLObject] Connection URI and Windows Paths...
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Ian S. <Ian...@et...> - 2004-05-24 21:34:53
|
From scouring the source (is connectionForURI documented anywhere?) I =
discover that the connectionForURI method takes an argument string =
something like :
connectionForURI("<DB_TYPE>://<USERID>:<password>@<HOST>/<PATH>)
so for a Firebird connection :
connectionForURI("firebird://SYSDBA:masterkey@localhost/data/somewhere/my=
_db.gdb")
but this seems broken on Windows if I want to connect to a DB on my D: =
drive :
connectionForURI("firebird://SYSDBA:masterkey@localhost/D:/my_db.gdb")
I get some error about an "undefined service d/tcp.." from kinterbasdb =
because its trying to open /D:/my_db.gdb and, naturally, gets confused
I believe that the following (naive) patch against dbconnection.py will =
fix if inserted at line 95 :
if path.find(':') !=3D -1:
start,rest =3D path.split(':')
start =3D start.replace('\\','')
start =3D start.replace('/','')
path =3D start + ':' + rest
There is probably a better way but this fixes it for me.
Be good if something with the same effect could make it into 0.6 SVN. =
Thank you.
|