Re: [SQLObject] Connection URI and Windows Paths...
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Nick <ni...@dd...> - 2004-05-25 02:13:33
|
Use os.path.sep Nick On Mon, 2004-05-24 at 16:34, Ian Sparks wrote: > >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(':') != -1: > start,rest = path.split(':') > start = start.replace('\\','') > start = start.replace('/','') > path = 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. > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id149&alloc_id66&op=click > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss |