[SQL-CVS] [ sqlobject-Patches-1904874 ] connectionForURI fails for mssql on Cygwin
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: SourceForge.net <no...@so...> - 2008-03-03 14:43:01
|
Patches item #1904874, was opened at 2008-02-29 21:15 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904874&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Oleg Broytmann (phd) Summary: connectionForURI fails for mssql on Cygwin Initial Comment: when running connectionForURI on connection_string='mssql://user:password@host:port/database' the pymssql.connect is called with "host" (port is stripped) however, the called _mssql.connect() (pymssql:line 329) doesn't work unless the port is also specified. Here's the trace: Traceback (most recent call last): File "<stdin>", line 28, in <module> File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/main.py", line 880, in get val._init(id, connection, selectResults) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/main.py", line 919, in _init selectResults = self._connection._SO_selectOne(self, dbNames) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 514, in _SO_selectOne return self._SO_selectOneAlt(so, columnNames, so.q.id==so.id) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 524, in _SO_selectOneAlt clause=condition))) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 380, in queryOne return self._runWithConnection(self._queryOne, s) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 248, in _runWithConnection conn = self.getConnection() File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/dbconnection.py", line 259, in getConnection conn = self.makeConnection() File "/usr/lib/python2.5/site-packages/SQLObject-0.10.0b3-py2.5.egg/sqlobject/mssql/mssqlconnection.py", line 83, in makeConnection con = self.dbconnection( *self.make_conn_str(self) ) File "/usr/lib/python2.5/site-packages/pymssql.py", line 328, in connect con = _mssql.connect(dbhost, dbuser, dbpasswd) _mssql.error: DB-Lib error message 20009, severity 9: Server is unavailable or does not exist. my quick correction replaces con = _mssql.connect(dbhost, dbuser, dbpasswd) to con = _mssql.connect(dbhost+":1433", dbuser, dbpasswd) Thank you. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:02 Message: Logged In: YES user_id=4799 Originator: NO You've patched pymssql which is not a part of SQLObject. I think you should report the problem to pymssql authors, no? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1904874&group_id=74338 |