#83 revision 2150 firebird connectionFromURI *NIX db alias usage

closed-accepted
Oleg Broytman
None
5
2007-01-16
2007-01-08
No

when i try to use URI like "firebird://localhost/database" (database - database alias) in linux, i see error:
--- cut ---
File "/usr/lib/python2.4/site-packages/SQLObject-0.9dev_r2147-py2.4.egg/sqlobject/sresults.py", line 160, in __iter__
return iter(list(self.lazyIter()))
File "/usr/lib/python2.4/site-packages/SQLObject-0.9dev_r2147-py2.4.egg/sqlobject/sresults.py", line 168, in lazyIter
return conn.iterSelect(self)
File "/usr/lib/python2.4/site-packages/SQLObject-0.9dev_r2147-py2.4.egg/sqlobject/dbconnection.py", line 373, in iterSelect
return select.IterationClass(self, self.getConnection(),
File "/usr/lib/python2.4/site-packages/SQLObject-0.9dev_r2147-py2.4.egg/sqlobject/dbconnection.py", line 239, in getConnection
conn = self.makeConnection()
File "/usr/lib/python2.4/site-packages/SQLObject-0.9dev_r2147-py2.4.egg/sqlobject/firebird/firebirdconnection.py", line 87, in makeConnection
charset=self.charset,
File "/var/lib/python-support/python2.4/kinterbasdb/__init__.py", line 472, in connect
return Connection(*args, **keywords_args)
File "/var/lib/python-support/python2.4/kinterbasdb/__init__.py", line 610, in __init__
self._C_con = _k.attach_db(dsn, dpb, dialect)
OperationalError: (-902, 'isc_attach_database: I/O error for file "/database". Error while trying to open file. No such file or directory. ')

--- end cut ---

path fix this problem

Discussion

  • Patch for fixing problem with using firebird db aliases on unix systems

     
    Attachments
  • Logged In: YES
    user_id=1240394
    Originator: YES

    bug also present in revision 2175

     
  • Oleg Broytman
    Oleg Broytman
    2007-01-10

    Logged In: YES
    user_id=4799
    Originator: NO

    Can I change

    if path[-3:].lower() != 'fdb' and path[-3:].lower() != 'gdb':

    to

    if path[-3:].lower() not in ('fdb', 'gdb'):

    ?

     
  • Oleg Broytman
    Oleg Broytman
    2007-01-10

    • assigned_to: nobody --> phd
     
  • Logged In: YES
    user_id=1240394
    Originator: YES

    yes, your variant is better

     
  • Oleg Broytman
    Oleg Broytman
    2007-01-11

    Logged In: YES
    user_id=4799
    Originator: NO

    Also I think I can now remove the code

    if os.name == 'nt' and path[0] == '/':
    # strip the leading slash off of db name/alias
    path = path[1:]

    ?

     
  • Logged In: YES
    user_id=1240394
    Originator: YES

    yes

     
  • Oleg Broytman
    Oleg Broytman
    2007-01-16

    Logged In: YES
    user_id=4799
    Originator: NO

    Applied and committed to all branches (0.7, 0.8, trunk) in the revisions 2209-2212. Thank you!

     
  • Oleg Broytman
    Oleg Broytman
    2007-01-16

    • status: open --> closed-accepted