Thread: [SQL-CVS] [ sqlobject-Patches-1613369 ] Fix bug that breaks "tg-admin sql status"
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: SourceForge.net <no...@so...> - 2006-12-11 17:44:23
|
Patches item #1613369, was opened at 2006-12-11 17:44 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1613369&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: Open Resolution: None Priority: 5 Private: No Submitted By: Paul Johnston (paj28) Assigned to: Nobody/Anonymous (nobody) Summary: Fix bug that breaks "tg-admin sql status" Initial Comment: I was unable to get "tg-admin sql status" to work; I've attached the exception at the bottom. The problem is that in sqlbuilder.py, in the function sqlIdentifier, it does a check like 'type(obj) is type("")'. In this case the object in unicode, which incorrectly causes a failure. The fix is to replace the check with isinstance(obj, basestring). C:\tsrweb>tg-admin sql status Using database URI mssql://pythonweb:mdi*2mdO1@./giitr Traceback (most recent call last): File "c:\python24\scripts\tg-admin-script.py", line 7, in ? sys.exit( File "c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\comm and\base.py", line 358, in main command.run() File "c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\comm and\base.py", line 144, in run command.the_runner.run(sys.argv) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\manage r\command.py", line 102, in run runner.run() File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\manage r\command.py", line 233, in run self.command() File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\manage r\command.py", line 663, in command col = col.withClass(soClass) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 410, in withClass extra_vars=self._extra_vars, File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 558, in __init__ super(SOUnicodeCol, self).__init__(**kw) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 439, in __init__ super(SOStringLikeCol, self).__init__(**kw) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 143, in __init__ assert sqlbuilder.sqlIdentifier(name), 'Name must be SQL-safe (letters, numb ers, underscores): %s (or use forceDBName=True)' \ AssertionError: Name must be SQL-safe (letters, numbers, underscores): u'capword ' (or use forceDBName=True) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1613369&group_id=74338 |
From: SourceForge.net <no...@so...> - 2006-12-12 19:36:55
|
Patches item #1613369, was opened at 2006-12-11 17:44 Message generated for change (Comment added) made by paj28 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1613369&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: Open Resolution: None Priority: 5 Private: No Submitted By: Paul Johnston (paj28) Assigned to: Nobody/Anonymous (nobody) Summary: Fix bug that breaks "tg-admin sql status" Initial Comment: I was unable to get "tg-admin sql status" to work; I've attached the exception at the bottom. The problem is that in sqlbuilder.py, in the function sqlIdentifier, it does a check like 'type(obj) is type("")'. In this case the object in unicode, which incorrectly causes a failure. The fix is to replace the check with isinstance(obj, basestring). C:\tsrweb>tg-admin sql status Using database URI mssql://pythonweb:mdi*2mdO1@./giitr Traceback (most recent call last): File "c:\python24\scripts\tg-admin-script.py", line 7, in ? sys.exit( File "c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\comm and\base.py", line 358, in main command.run() File "c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\comm and\base.py", line 144, in run command.the_runner.run(sys.argv) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\manage r\command.py", line 102, in run runner.run() File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\manage r\command.py", line 233, in run self.command() File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\manage r\command.py", line 663, in command col = col.withClass(soClass) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 410, in withClass extra_vars=self._extra_vars, File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 558, in __init__ super(SOUnicodeCol, self).__init__(**kw) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 439, in __init__ super(SOStringLikeCol, self).__init__(**kw) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 143, in __init__ assert sqlbuilder.sqlIdentifier(name), 'Name must be SQL-safe (letters, numb ers, underscores): %s (or use forceDBName=True)' \ AssertionError: Name must be SQL-safe (letters, numbers, underscores): u'capword ' (or use forceDBName=True) ---------------------------------------------------------------------- >Comment By: Paul Johnston (paj28) Date: 2006-12-12 19:36 Message: Logged In: YES user_id=1051055 Originator: YES After discussion on the list, here's an alternative patch. File Added: mssqlconnection.py.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1613369&group_id=74338 |
From: SourceForge.net <no...@so...> - 2007-01-10 13:40:18
|
Patches item #1613369, was opened at 2006-12-11 20:44 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1613369&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: Accepted Priority: 5 Private: No Submitted By: Paul Johnston (paj28) >Assigned to: Oleg Broytmann (phd) Summary: Fix bug that breaks "tg-admin sql status" Initial Comment: I was unable to get "tg-admin sql status" to work; I've attached the exception at the bottom. The problem is that in sqlbuilder.py, in the function sqlIdentifier, it does a check like 'type(obj) is type("")'. In this case the object in unicode, which incorrectly causes a failure. The fix is to replace the check with isinstance(obj, basestring). C:\tsrweb>tg-admin sql status Using database URI mssql://pythonweb:mdi*2mdO1@./giitr Traceback (most recent call last): File "c:\python24\scripts\tg-admin-script.py", line 7, in ? sys.exit( File "c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\comm and\base.py", line 358, in main command.run() File "c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\comm and\base.py", line 144, in run command.the_runner.run(sys.argv) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\manage r\command.py", line 102, in run runner.run() File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\manage r\command.py", line 233, in run self.command() File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\manage r\command.py", line 663, in command col = col.withClass(soClass) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 410, in withClass extra_vars=self._extra_vars, File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 558, in __init__ super(SOUnicodeCol, self).__init__(**kw) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 439, in __init__ super(SOStringLikeCol, self).__init__(**kw) File "c:\python24\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\col.py ", line 143, in __init__ assert sqlbuilder.sqlIdentifier(name), 'Name must be SQL-safe (letters, numb ers, underscores): %s (or use forceDBName=True)' \ AssertionError: Name must be SQL-safe (letters, numbers, underscores): u'capword ' (or use forceDBName=True) ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2007-01-10 16:40 Message: Logged In: YES user_id=4799 Originator: NO Applied to all branches (0.7, 0.8, trunk) in the revisions 2183-2186. Thank you! ---------------------------------------------------------------------- Comment By: Paul Johnston (paj28) Date: 2006-12-12 22:36 Message: Logged In: YES user_id=1051055 Originator: YES After discussion on the list, here's an alternative patch. File Added: mssqlconnection.py.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1613369&group_id=74338 |