#108 win32: parsing of connection uri broken

closed-invalid
Oleg Broytman
SQLite (24)
5
2005-08-22
2005-08-21
Waldemar Osuch
No

On win32 when trying to specify a connection to an
sqlite db this format of uri:
sqlite:///c:/backend.db
gets resolved to:
/c:/backend.db

Note the forward slash before the drive letter.
This ends up being invalid path.

This diff fixes it for me.

Index: sqlobject/dbconnection.py

===================================================================

--- sqlobject/dbconnection.py (revision 931)

+++ sqlobject/dbconnection.py (working copy)

@@ -110,10 +110,12 @@

host = _host
else:
port = None
- path = '/' + rest
if os.name == 'nt':
+ path = rest
if (len(rest) > 1) and (rest[1] == '|'):
path = "%s:%s" % (rest[0], rest[2:])
+ else:
+ path = '/' + rest
args = {}
if path.find('?') != -1:
path, arglist = path.split('?', 1)

Discussion

  • Oleg Broytman
    Oleg Broytman
    2005-08-22

    Logged In: YES
    user_id=4799

    The correct syntax is sqlite:/c|/path/to/db

     
  • Oleg Broytman
    Oleg Broytman
    2005-08-22

    • assigned_to: nobody --> phd
    • status: open --> closed-invalid