sqlobject-cvs Mailing List for SQLObject (Page 54)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <sub...@co...> - 2009-09-30 12:54:21
|
Author: phd Date: 2009-09-30 06:24:16 -0600 (Wed, 30 Sep 2009) New Revision: 4011 Modified: SQLObject/branches/0.11/docs/News.txt Log: SQLObject 0.11.2 and 0.10.8 were released 30 Sep 2009. Modified: SQLObject/branches/0.11/docs/News.txt =================================================================== --- SQLObject/branches/0.11/docs/News.txt 2009-09-30 12:23:07 UTC (rev 4010) +++ SQLObject/branches/0.11/docs/News.txt 2009-09-30 12:24:16 UTC (rev 4011) @@ -10,6 +10,8 @@ SQLObject 0.11.2 ================ +Released 30 Sep 2009 + * A number of changes ported from `SQLObject 0.10.8`_. SQLObject 0.11.1 @@ -70,6 +72,8 @@ SQLObject 0.10.8 ================ +Released 30 Sep 2009 + * Fixed a bug in logging to console - convert unicode to str. * Fixed an obscure bug in ConnectionHub triggered by an SQLObject class |
From: <sub...@co...> - 2009-09-30 12:54:07
|
Author: phd Date: 2009-09-30 06:25:33 -0600 (Wed, 30 Sep 2009) New Revision: 4012 Modified: SQLObject/trunk/docs/News.txt Log: SQLObject 0.11.2 and 0.10.8 were released 30 Sep 2009. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2009-09-30 12:24:16 UTC (rev 4011) +++ SQLObject/trunk/docs/News.txt 2009-09-30 12:25:33 UTC (rev 4012) @@ -56,6 +56,8 @@ SQLObject 0.11.2 ================ +Released 30 Sep 2009 + * A number of changes ported from `SQLObject 0.10.8`_. SQLObject 0.11.1 @@ -116,6 +118,8 @@ SQLObject 0.10.8 ================ +Released 30 Sep 2009 + * Fixed a bug in logging to console - convert unicode to str. * Fixed an obscure bug in ConnectionHub triggered by an SQLObject class |
From: <sub...@co...> - 2009-09-30 12:53:52
|
Author: phd Date: 2009-09-30 06:27:01 -0600 (Wed, 30 Sep 2009) New Revision: 4013 Added: SQLObject/tags/0.10.8/ Log: Tagging 0.10.8 Copied: SQLObject/tags/0.10.8 (from rev 4012, SQLObject/branches/0.10) |
From: <sub...@co...> - 2009-09-30 12:53:42
|
Author: phd Date: 2009-09-30 06:28:58 -0600 (Wed, 30 Sep 2009) New Revision: 4014 Modified: SQLObject/tags/0.10.8/setup.cfg SQLObject/tags/0.10.8/setup.py SQLObject/tags/0.10.8/sqlobject/__init__.py SQLObject/tags/0.10.8/sqlobject/main.py Log: Stable version 0.10.8. Modified: SQLObject/tags/0.10.8/setup.cfg =================================================================== --- SQLObject/tags/0.10.8/setup.cfg 2009-09-30 12:27:01 UTC (rev 4013) +++ SQLObject/tags/0.10.8/setup.cfg 2009-09-30 12:28:58 UTC (rev 4014) @@ -2,13 +2,6 @@ command_packages = buildutils.pudge_command, buildutils.publish_command -[easy_install] -#find_links = http://svn.pythonpaste.org/package_index.html - -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt Modified: SQLObject/tags/0.10.8/setup.py =================================================================== --- SQLObject/tags/0.10.8/setup.py 2009-09-30 12:27:01 UTC (rev 4013) +++ SQLObject/tags/0.10.8/setup.py 2009-09-30 12:28:58 UTC (rev 4014) @@ -21,7 +21,7 @@ """ setup(name="SQLObject", - version="0.10", + version="0.10.8", description="Object-Relational Manager, aka database wrapper", long_description="""\ SQLObject is a popular *Object Relational Manager* for providing an @@ -49,7 +49,7 @@ author="Ian Bicking", author_email="ia...@co...", url="http://sqlobject.org/", - download_url="http://cheeseshop.python.org/pypi/SQLObject/0.10", + download_url="http://cheeseshop.python.org/pypi/SQLObject/0.10.8", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], Modified: SQLObject/tags/0.10.8/sqlobject/__init__.py =================================================================== --- SQLObject/tags/0.10.8/sqlobject/__init__.py 2009-09-30 12:27:01 UTC (rev 4013) +++ SQLObject/tags/0.10.8/sqlobject/__init__.py 2009-09-30 12:28:58 UTC (rev 4014) @@ -1,5 +1,5 @@ """ -SQLObject 0.10 +SQLObject 0.10.8 """ from main import * Modified: SQLObject/tags/0.10.8/sqlobject/main.py =================================================================== --- SQLObject/tags/0.10.8/sqlobject/main.py 2009-09-30 12:27:01 UTC (rev 4013) +++ SQLObject/tags/0.10.8/sqlobject/main.py 2009-09-30 12:28:58 UTC (rev 4014) @@ -1,6 +1,6 @@ """ -SQLObject 0.10 --------------- +SQLObject 0.10.8 +---------------- :author: Ian Bicking <ia...@co...> |
From: <sub...@co...> - 2009-09-30 12:53:31
|
Author: phd Date: 2009-09-30 06:32:17 -0600 (Wed, 30 Sep 2009) New Revision: 4015 Added: SQLObject/tags/0.11.2/ Log: Tagging 0.11.2 Copied: SQLObject/tags/0.11.2 (from rev 4014, SQLObject/branches/0.11) |
From: <sub...@co...> - 2009-09-30 12:53:19
|
Author: phd Date: 2009-09-30 06:33:33 -0600 (Wed, 30 Sep 2009) New Revision: 4016 Modified: SQLObject/tags/0.11.2/setup.cfg SQLObject/tags/0.11.2/setup.py SQLObject/tags/0.11.2/sqlobject/__init__.py SQLObject/tags/0.11.2/sqlobject/main.py Log: Stable version 0.11.2. Modified: SQLObject/tags/0.11.2/setup.cfg =================================================================== --- SQLObject/tags/0.11.2/setup.cfg 2009-09-30 12:32:17 UTC (rev 4015) +++ SQLObject/tags/0.11.2/setup.cfg 2009-09-30 12:33:33 UTC (rev 4016) @@ -2,13 +2,6 @@ command_packages = buildutils.pudge_command, buildutils.publish_command -[easy_install] -#find_links = http://svn.pythonpaste.org/package_index.html - -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt Modified: SQLObject/tags/0.11.2/setup.py =================================================================== --- SQLObject/tags/0.11.2/setup.py 2009-09-30 12:32:17 UTC (rev 4015) +++ SQLObject/tags/0.11.2/setup.py 2009-09-30 12:33:33 UTC (rev 4016) @@ -21,7 +21,7 @@ """ setup(name="SQLObject", - version="0.11", + version="0.11.2", description="Object-Relational Manager, aka database wrapper", long_description="""\ SQLObject is a popular *Object Relational Manager* for providing an @@ -49,7 +49,7 @@ author="Ian Bicking", author_email="ia...@co...", url="http://sqlobject.org/devel/", - download_url="http://cheeseshop.python.org/pypi/SQLObject/0.11", + download_url="http://cheeseshop.python.org/pypi/SQLObject/0.11.2", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], Modified: SQLObject/tags/0.11.2/sqlobject/__init__.py =================================================================== --- SQLObject/tags/0.11.2/sqlobject/__init__.py 2009-09-30 12:32:17 UTC (rev 4015) +++ SQLObject/tags/0.11.2/sqlobject/__init__.py 2009-09-30 12:33:33 UTC (rev 4016) @@ -1,5 +1,5 @@ """ -SQLObject 0.11 +SQLObject 0.11.2 """ from main import * Modified: SQLObject/tags/0.11.2/sqlobject/main.py =================================================================== --- SQLObject/tags/0.11.2/sqlobject/main.py 2009-09-30 12:32:17 UTC (rev 4015) +++ SQLObject/tags/0.11.2/sqlobject/main.py 2009-09-30 12:33:33 UTC (rev 4016) @@ -1,6 +1,6 @@ """ -SQLObject 0.11 --------------- +SQLObject 0.11.2 +---------------- :author: Ian Bicking <ia...@co...> |
From: <sub...@co...> - 2009-09-28 15:40:13
|
Author: phd Date: 2009-09-28 09:39:54 -0600 (Mon, 28 Sep 2009) New Revision: 4007 Modified: SQLObject/trunk/docs/News.txt SQLObject/trunk/sqlobject/col.py Log: TimestampCol() can be instantiated without any defaults, in this case default will be None (good default for TIMESTAMP columns in MySQL). Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2009-09-28 15:18:51 UTC (rev 4006) +++ SQLObject/trunk/docs/News.txt 2009-09-28 15:39:54 UTC (rev 4007) @@ -50,6 +50,9 @@ * Removed all deprecated attribute and functions. +* TimestampCol() can be instantiated without any defaults, in this case + default will be None (good default for TIMESTAMP columns in MySQL). + SQLObject 0.11.2 ================ Modified: SQLObject/trunk/sqlobject/col.py =================================================================== --- SQLObject/trunk/sqlobject/col.py 2009-09-28 15:18:51 UTC (rev 4006) +++ SQLObject/trunk/sqlobject/col.py 2009-09-28 15:39:54 UTC (rev 4007) @@ -1271,6 +1271,8 @@ """ def __init__(self, **kw): + if 'default' not in kw: + kw['default'] = None SOCol.__init__(self, **kw) def _mysqlType(self): |
From: <sub...@co...> - 2009-09-28 15:19:04
|
Author: phd Date: 2009-09-28 09:18:51 -0600 (Mon, 28 Sep 2009) New Revision: 4006 Modified: SQLObject/trunk/docs/News.txt SQLObject/trunk/docs/SQLObject.txt SQLObject/trunk/sqlobject/mssql/mssqlconnection.py SQLObject/trunk/sqlobject/postgres/pgconnection.py SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py Log: The "backend" parameter can be a comma-separated list of backend names. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2009-09-28 14:25:16 UTC (rev 4005) +++ SQLObject/trunk/docs/News.txt 2009-09-28 15:18:51 UTC (rev 4006) @@ -17,21 +17,23 @@ .from_python(), not only unicode. * The user can choose a DB API driver for SQLite by using a "backend" - parameter in DB URI or SQLiteConnection. Possible backends are: - "pysqlite2" (alias "sqlite2"), "sqlite3", "sqlite" (alias "sqlite1"). - Default is to test pysqlite2, sqlite3 and sqlite in that order. + parameter in DB URI or SQLiteConnection that can be a comma-separated + list of backend names. Possible backends are: "pysqlite2" (alias + "sqlite2"), "sqlite3", "sqlite" (alias "sqlite1"). Default is to test + pysqlite2, sqlite3 and sqlite in that order. * The user can choose a DB API driver for PostgreSQL by using a "backend" - parameter in DB URI or PostgresConnection. Possible backends are: - "psycopg2", "psycopg1", "psycopg" (tries psycopg2 and psycopg1), - "pygresql". Default is "psycopg". - WARNING: API change! PostgresConnection's parameter "usePygresql" is now - replaced with "backend=pygresql". + parameter in DB URI or PostgresConnection that can be a comma-separated + list of backend names. Possible backends are: "psycopg2", "psycopg1", + "psycopg" (tries psycopg2 and psycopg1), "pygresql". Default is + "psycopg". + WARNING: API change! PostgresConnection's parameter + "usePygresql" is now replaced with "backend=pygresql". * The user can choose a DB API driver for MSSQL by using a "backend" - parameter in DB URI or MSSQLConnection. Possible backends are: "adodb" - (alias "adodbapi") and "pymssql". Default is to test adodbapi and pymssql - in that order. + parameter in DB URI or MSSQLConnection that can be a comma-separated list + of backend names. Possible backends are: "adodb" (alias "adodbapi") and + "pymssql". Default is to test adodbapi and pymssql in that order. * alternateMethodName is defined for all unique fields, not only alternateID; this makes SQLObject create .by*() methods for all unique fields. Modified: SQLObject/trunk/docs/SQLObject.txt =================================================================== --- SQLObject/trunk/docs/SQLObject.txt 2009-09-28 14:25:16 UTC (rev 4005) +++ SQLObject/trunk/docs/SQLObject.txt 2009-09-28 15:18:51 UTC (rev 4006) @@ -1734,9 +1734,9 @@ PostgresConnection supports transactions and all other features. The user can choose a DB API driver for PostgreSQL by using a "backend" -parameter in DB URI or PostgresConnection. Possible backends are: -"psycopg2", "psycopg1", "psycopg" (tries psycopg2 and psycopg1), -"pygresql". Default is "psycopg". +parameter in DB URI or PostgresConnection that can be a comma-separated +list of backend names. Possible backends are: "psycopg2", "psycopg1", +"psycopg" (tries psycopg2 and psycopg1), "pygresql". Default is "psycopg". SQLite ------ @@ -1753,9 +1753,10 @@ multi-threaded environment. The user can choose a DB API driver for SQLite by using a "backend" -parameter in DB URI or SQLiteConnection. Possible backends are: "pysqlite2" -(alias "sqlite2"), "sqlite3", "sqlite" (alias "sqlite1"). Default is to -test pysqlite2, sqlite3 and sqlite in that order. +parameter in DB URI or SQLiteConnection that can be a comma-separated list +of backend names. Possible backends are: "pysqlite2" (alias "sqlite2"), +"sqlite3", "sqlite" (alias "sqlite1"). Default is to test pysqlite2, +sqlite3 and sqlite in that order. Firebird -------- @@ -1846,9 +1847,9 @@ .. _adodbapi: http://adodbapi.sourceforge.net/ The user can choose a DB API driver for MSSQL by using a "backend" -parameter in DB URI or MSSQLConnection. Possible backends are: "adodb" -(alias "adodbapi") and "pymssql". Default is to test adodbapi and pymssql -in that order. +parameter in DB URI or MSSQLConnection that can be a comma-separated list +of backend names. Possible backends are: "adodb" (alias "adodbapi") and +"pymssql". Default is to test adodbapi and pymssql in that order. Events (signals) ================ Modified: SQLObject/trunk/sqlobject/mssql/mssqlconnection.py =================================================================== --- SQLObject/trunk/sqlobject/mssql/mssqlconnection.py 2009-09-28 14:25:16 UTC (rev 4005) +++ SQLObject/trunk/sqlobject/mssql/mssqlconnection.py 2009-09-28 15:18:51 UTC (rev 4006) @@ -10,18 +10,24 @@ def __init__(self, db, user, password='', host='localhost', autoCommit=0, **kw): - backend = kw.pop('backend', None) - if backend is None: + backends = kw.pop('backend', None) or 'adodb,pymssql' + for backend in backends.split(','): + backend = backend.strip() + if not backend: + continue try: - import adodbapi as sqlmodule + if backend in ('adodb', 'adodbapi'): + import adodbapi as sqlmodule + elif backend == 'pymssql': + import pymssql as sqlmodule + else: + raise ValueError('Unknown MSSQL backend "%s", expected adodb or pymssql' % backend) except ImportError: - import pymssql as sqlmodule - elif backend in ('adodb', 'adodbapi'): - import adodbapi as sqlmodule - elif backend == 'pymssql ': - import pymssql as sqlmodule + pass + else: + break else: - raise ValueError('Unknown MSSQL backend "%s", expected adodb or pymssql' % backend) + raise ImportError('Cannot find an MSSQL backend, tried %s' % backends) self.module = sqlmodule if sqlmodule.__name__ == 'adodbapi': Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py =================================================================== --- SQLObject/trunk/sqlobject/postgres/pgconnection.py 2009-09-28 14:25:16 UTC (rev 4005) +++ SQLObject/trunk/sqlobject/postgres/pgconnection.py 2009-09-28 15:18:51 UTC (rev 4006) @@ -13,21 +13,32 @@ def __init__(self, dsn=None, host=None, port=None, db=None, user=None, password=None, backend='psycopg', unicodeCols=False, **kw): - self.backend = backend - if backend == 'psycopg2': - import psycopg2 as psycopg - elif backend == 'psycopg1': - import psycopg - elif backend == 'psycopg': + backends = kw.pop('backend', None) or 'psycopg' + for backend in backends.split(','): + backend = backend.strip() + if not backend: + continue try: - import psycopg2 as psycopg + if backend == 'psycopg2': + import psycopg2 as psycopg + elif backend == 'psycopg1': + import psycopg + elif backend == 'psycopg': + try: + import psycopg2 as psycopg + except ImportError: + import psycopg + elif backend == 'pygresql': + import pgdb + self.module = pgdb + else: + raise ValueError('Unknown PostgreSQL backend "%s", expected psycopg2, psycopg1 or pygresql' % backend) except ImportError: - import psycopg - elif backend == 'pygresql': - import pgdb - self.module = pgdb + pass + else: + break else: - raise ValueError('Unknown PostgreSQL backend "%s", expected psycopg2, psycopg1 or pygresql' % backend) + raise ImportError('Cannot find a PostgreSQL backend, tried %s' % backends) if backend.startswith('psycopg'): self.module = psycopg # Register a converter for psycopg Binary type. Modified: SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py =================================================================== --- SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2009-09-28 14:25:16 UTC (rev 4005) +++ SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2009-09-28 15:18:51 UTC (rev 4006) @@ -22,29 +22,29 @@ schemes = [dbName] def __init__(self, filename, autoCommit=1, **kw): - backend = kw.pop('backend', None) - if backend is None: + backends = kw.pop('backend', None) or 'pysqlite2,sqlite3,sqlite' + for backend in backends.split(','): + backend = backend.strip() + if not backend: + continue try: - from pysqlite2 import dbapi2 as sqlite - self.using_sqlite2 = True + if backend in ('sqlite2', 'pysqlite2'): + from pysqlite2 import dbapi2 as sqlite + self.using_sqlite2 = True + elif backend == 'sqlite3': + import sqlite3 as sqlite + self.using_sqlite2 = True + elif backend in ('sqlite', 'sqlite1'): + import sqlite + self.using_sqlite2 = False + else: + raise ValueError('Unknown SQLite backend "%s", expected pysqlite2, sqlite3 or sqlite' % backend) except ImportError: - try: - import sqlite3 as sqlite - self.using_sqlite2 = True - except ImportError: - import sqlite - self.using_sqlite2 = False - elif backend in ('sqlite2', 'pysqlite2'): - from pysqlite2 import dbapi2 as sqlite - self.using_sqlite2 = True - elif backend == 'sqlite3': - import sqlite3 as sqlite - self.using_sqlite2 = True - elif backend in ('sqlite', 'sqlite1'): - import sqlite - self.using_sqlite2 = False + pass + else: + break else: - raise ValueError('Unknown SQLite backend "%s", expected pysqlite2, sqlite3 or sqlite' % backend) + raise ImportError('Cannot find an SQLite backend, tried %s' % backends) if self.using_sqlite2: sqlite.encode = base64.encodestring sqlite.decode = base64.decodestring |
From: SourceForge.net <no...@so...> - 2009-09-28 14:33:30
|
Patches item #2866300, was opened at 2009-09-25 08:08 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2866300&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: Geoff Kassel (gkassel) Assigned to: Oleg Broytman (phd) Summary: ConnectionHub.__get__ TypeError and patch Initial Comment: Hi, Found a TypeError raised from ConnectionHub.__get__ that seems to happen when overriding the SQLObject.__init__ method. Here's the associated trace: Traceback (most recent call last): File "<console>", line 1, in <module> File "/lvm/var/www/localhost/webapp/product/product/model/dbfile.py", line 220, in __init__ SQLObject.__init__(self, contentType = contentType, _data = data) File "//usr/lib/python2.5/site-packages/sqlobject/main.py", line 1223, in __init__ self._create(id, **kw) File "//usr/lib/python2.5/site-packages/sqlobject/main.py", line 1271, in _create self._SO_finishCreate(id) File "//usr/lib/python2.5/site-packages/sqlobject/main.py", line 1294, in _SO_finishCreate id = self._connection.queryInsertID(self, File "//usr/lib/python2.5/site-packages/turbogears/database.py", line 273, in __get__ return self.hub.__get__(obj, type) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 826, in __get__ if obj and obj.__dict__.has_key('_connection'): TypeError: an integer is required The object 'obj' in question is an uninitialized SQLObject (an object of a database-backed file class named DBFile), and the error is raised from the 'if obj' condition. I've fixed this with the attached patch. ---------------------------------------------------------------------- >Comment By: Oleg Broytman (phd) Date: 2009-09-28 18:33 Message: Now I see. 'obj' there can be either None for SQLObject classes (TestClass._connection) or an instance for SQLObject instances (test_instance._connection). For an SQLObject class whose instances can be coerced to boolean False the test 'if obj' fails where it must succeed. I fixed that by testing 'if (obj is not None)'; there is no need to do hasattr - if obj is not None it must be an SQLObject instance, and they always have __dict__. Committed in the revisions 4001-4003 (branches 0.10, 0.11 and the trunk). Will be in the next round of releases. Thank you! ---------------------------------------------------------------------- Comment By: Geoff Kassel (gkassel) Date: 2009-09-27 07:45 Message: The point of the 'obj is not None' condition (and I believe the original 'if obj') is to ensure that there is a valid object to extract the attribute __dict__ from. All I've done here is changed the test from one that Python seems to want an Integer-coercible value for - which seems to fail with uninitialized SQLObjects - to one that makes a little more explicit the requirement that the object is one that can have attributes extracted from it. I haven't actually come across a case where this object is None, so I don't think I can come up with a test program that demonstrates this. I presume the original intent of the code is something like insurance against an AttributeError during object destruction. On second thought, perhaps a better condition would be "if hasattr(obj, '__dict__')'"? ---------------------------------------------------------------------- Comment By: Oleg Broytman (phd) Date: 2009-09-25 18:02 Message: I cannot get how 'obj' can be None there. Can you provide a short test program that demonstrates the problem? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2866300&group_id=74338 |
From: <sub...@co...> - 2009-09-28 14:25:26
|
Author: phd Date: 2009-09-28 08:25:16 -0600 (Mon, 28 Sep 2009) New Revision: 4005 Modified: SQLObject/trunk/docs/News.txt Log: Merged r4004 from branch 0.11: minor documentation update. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2009-09-28 14:24:21 UTC (rev 4004) +++ SQLObject/trunk/docs/News.txt 2009-09-28 14:25:16 UTC (rev 4005) @@ -51,7 +51,7 @@ SQLObject 0.11.2 ================ -* A change ported from `SQLObject 0.10.8`_. +* A number of changes ported from `SQLObject 0.10.8`_. SQLObject 0.11.1 ================ |
From: <sub...@co...> - 2009-09-28 14:24:34
|
Author: phd Date: 2009-09-28 08:24:21 -0600 (Mon, 28 Sep 2009) New Revision: 4004 Modified: SQLObject/branches/0.11/docs/News.txt Log: A *number of changes*. Modified: SQLObject/branches/0.11/docs/News.txt =================================================================== --- SQLObject/branches/0.11/docs/News.txt 2009-09-28 14:22:51 UTC (rev 4003) +++ SQLObject/branches/0.11/docs/News.txt 2009-09-28 14:24:21 UTC (rev 4004) @@ -10,7 +10,7 @@ SQLObject 0.11.2 ================ -* A change ported from `SQLObject 0.10.8`_. +* A number of changes ported from `SQLObject 0.10.8`_. SQLObject 0.11.1 ================ |
From: <sub...@co...> - 2009-09-28 14:23:02
|
Author: phd Date: 2009-09-28 08:22:51 -0600 (Mon, 28 Sep 2009) New Revision: 4003 Modified: SQLObject/trunk/docs/News.txt SQLObject/trunk/sqlobject/dbconnection.py Log: Merged r4002 from branch 0.11: fixed an obscure bug in ConnectionHub triggered by an SQLObject class whose instances can be coerced to boolean False (bug 2866300). Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2009-09-28 14:22:02 UTC (rev 4002) +++ SQLObject/trunk/docs/News.txt 2009-09-28 14:22:51 UTC (rev 4003) @@ -113,6 +113,9 @@ * Fixed a bug in logging to console - convert unicode to str. +* Fixed an obscure bug in ConnectionHub triggered by an SQLObject class + whose instances can be coerced to boolean False. + SQLObject 0.10.7 ================ Modified: SQLObject/trunk/sqlobject/dbconnection.py =================================================================== --- SQLObject/trunk/sqlobject/dbconnection.py 2009-09-28 14:22:02 UTC (rev 4002) +++ SQLObject/trunk/sqlobject/dbconnection.py 2009-09-28 14:22:51 UTC (rev 4003) @@ -832,7 +832,7 @@ # I'm a little surprised we have to do this, but apparently # the object's private dictionary of attributes doesn't # override this descriptor. - if obj and obj.__dict__.has_key('_connection'): + if (obj is not None) and obj.__dict__.has_key('_connection'): return obj.__dict__['_connection'] return self.getConnection() |
From: <sub...@co...> - 2009-09-28 14:22:11
|
Author: phd Date: 2009-09-28 08:22:02 -0600 (Mon, 28 Sep 2009) New Revision: 4002 Modified: SQLObject/branches/0.11/docs/News.txt SQLObject/branches/0.11/sqlobject/dbconnection.py Log: Merged r4001 from branch 0.10: fixed an obscure bug in ConnectionHub triggered by an SQLObject class whose instances can be coerced to boolean False (bug 2866300). Modified: SQLObject/branches/0.11/docs/News.txt =================================================================== --- SQLObject/branches/0.11/docs/News.txt 2009-09-28 14:20:15 UTC (rev 4001) +++ SQLObject/branches/0.11/docs/News.txt 2009-09-28 14:22:02 UTC (rev 4002) @@ -72,6 +72,9 @@ * Fixed a bug in logging to console - convert unicode to str. +* Fixed an obscure bug in ConnectionHub triggered by an SQLObject class + whose instances can be coerced to boolean False. + SQLObject 0.10.7 ================ Modified: SQLObject/branches/0.11/sqlobject/dbconnection.py =================================================================== --- SQLObject/branches/0.11/sqlobject/dbconnection.py 2009-09-28 14:20:15 UTC (rev 4001) +++ SQLObject/branches/0.11/sqlobject/dbconnection.py 2009-09-28 14:22:02 UTC (rev 4002) @@ -829,7 +829,7 @@ # I'm a little surprised we have to do this, but apparently # the object's private dictionary of attributes doesn't # override this descriptor. - if obj and obj.__dict__.has_key('_connection'): + if (obj is not None) and obj.__dict__.has_key('_connection'): return obj.__dict__['_connection'] return self.getConnection() |
From: <sub...@co...> - 2009-09-28 14:20:27
|
Author: phd Date: 2009-09-28 08:20:15 -0600 (Mon, 28 Sep 2009) New Revision: 4001 Modified: SQLObject/branches/0.10/docs/News.txt SQLObject/branches/0.10/sqlobject/dbconnection.py Log: Fixed an obscure bug in ConnectionHub triggered by an SQLObject class whose instances can be coerced to boolean False (bug 2866300). Modified: SQLObject/branches/0.10/docs/News.txt =================================================================== --- SQLObject/branches/0.10/docs/News.txt 2009-09-27 15:50:19 UTC (rev 4000) +++ SQLObject/branches/0.10/docs/News.txt 2009-09-28 14:20:15 UTC (rev 4001) @@ -12,6 +12,9 @@ * Fixed a bug in logging to console - convert unicode to str. +* Fixed an obscure bug in ConnectionHub triggered by an SQLObject class + whose instances can be coerced to boolean False. + SQLObject 0.10.7 ================ Modified: SQLObject/branches/0.10/sqlobject/dbconnection.py =================================================================== --- SQLObject/branches/0.10/sqlobject/dbconnection.py 2009-09-27 15:50:19 UTC (rev 4000) +++ SQLObject/branches/0.10/sqlobject/dbconnection.py 2009-09-28 14:20:15 UTC (rev 4001) @@ -833,7 +833,7 @@ # I'm a little surprised we have to do this, but apparently # the object's private dictionary of attributes doesn't # override this descriptor. - if obj and obj.__dict__.has_key('_connection'): + if (obj is not None) and obj.__dict__.has_key('_connection'): return obj.__dict__['_connection'] return self.getConnection() |
From: <sub...@co...> - 2009-09-27 15:50:32
|
Author: phd Date: 2009-09-27 09:50:19 -0600 (Sun, 27 Sep 2009) New Revision: 4000 Modified: SQLObject/trunk/sqlobject/main.py Log: "BroytMann" => "Broytman". Modified: SQLObject/trunk/sqlobject/main.py =================================================================== --- SQLObject/trunk/sqlobject/main.py 2009-09-27 15:49:00 UTC (rev 3999) +++ SQLObject/trunk/sqlobject/main.py 2009-09-27 15:50:19 UTC (rev 4000) @@ -7,7 +7,7 @@ SQLObject is a object-relational mapper. See SQLObject.html or SQLObject.txt for more. -With the help by Oleg Broytmann <ph...@ph...> and many other contributors. +With the help by Oleg Broytman <ph...@ph...> and many other contributors. See Authors.txt. This program is free software; you can redistribute it and/or modify |
From: <sub...@co...> - 2009-09-27 15:49:16
|
Author: phd Date: 2009-09-27 09:49:00 -0600 (Sun, 27 Sep 2009) New Revision: 3999 Modified: SQLObject/branches/0.11/sqlobject/main.py Log: "BroytMann" => "Broytman". Modified: SQLObject/branches/0.11/sqlobject/main.py =================================================================== --- SQLObject/branches/0.11/sqlobject/main.py 2009-09-27 15:48:21 UTC (rev 3998) +++ SQLObject/branches/0.11/sqlobject/main.py 2009-09-27 15:49:00 UTC (rev 3999) @@ -7,7 +7,7 @@ SQLObject is a object-relational mapper. See SQLObject.html or SQLObject.txt for more. -With the help by Oleg Broytmann <ph...@ph...> and many other contributors. +With the help by Oleg Broytman <ph...@ph...> and many other contributors. See Authors.txt. This program is free software; you can redistribute it and/or modify |
From: <sub...@co...> - 2009-09-27 15:48:32
|
Author: phd Date: 2009-09-27 09:48:21 -0600 (Sun, 27 Sep 2009) New Revision: 3998 Modified: SQLObject/branches/0.10/sqlobject/main.py Log: "BroytMann" => "Broytman". Modified: SQLObject/branches/0.10/sqlobject/main.py =================================================================== --- SQLObject/branches/0.10/sqlobject/main.py 2009-09-27 15:46:29 UTC (rev 3997) +++ SQLObject/branches/0.10/sqlobject/main.py 2009-09-27 15:48:21 UTC (rev 3998) @@ -7,7 +7,7 @@ SQLObject is a object-relational mapper. See SQLObject.html or SQLObject.txt for more. -With the help by Oleg Broytmann <ph...@ph...> and many other contributors. +With the help by Oleg Broytman <ph...@ph...> and many other contributors. See Authors.txt. This program is free software; you can redistribute it and/or modify |
From: <sub...@co...> - 2009-09-27 15:46:44
|
Author: phd Date: 2009-09-27 09:46:29 -0600 (Sun, 27 Sep 2009) New Revision: 3997 Modified: SQLObject/trunk/docs/Authors.txt Log: "BroytMann" => "Broytman". Modified: SQLObject/trunk/docs/Authors.txt =================================================================== --- SQLObject/trunk/docs/Authors.txt 2009-09-27 15:45:55 UTC (rev 3996) +++ SQLObject/trunk/docs/Authors.txt 2009-09-27 15:46:29 UTC (rev 3997) @@ -22,7 +22,7 @@ * Dan Pascu <dan at ag-projects.com> * Diez B. Roggisch <deets at web.de> * Christopher Singley <csingley at gmail.com> -* Oleg Broytmann <ph...@ph...> +* Oleg Broytman <ph...@ph...> .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject |
From: <sub...@co...> - 2009-09-27 15:46:01
|
Author: phd Date: 2009-09-27 09:45:55 -0600 (Sun, 27 Sep 2009) New Revision: 3996 Modified: SQLObject/branches/0.11/docs/Authors.txt Log: "BroytMann" => "Broytman". Modified: SQLObject/branches/0.11/docs/Authors.txt =================================================================== --- SQLObject/branches/0.11/docs/Authors.txt 2009-09-27 15:44:36 UTC (rev 3995) +++ SQLObject/branches/0.11/docs/Authors.txt 2009-09-27 15:45:55 UTC (rev 3996) @@ -22,7 +22,7 @@ * Dan Pascu <dan at ag-projects.com> * Diez B. Roggisch <deets at web.de> * Christopher Singley <csingley at gmail.com> -* Oleg Broytmann <ph...@ph...> +* Oleg Broytman <ph...@ph...> .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject |
From: <sub...@co...> - 2009-09-27 15:44:48
|
Author: phd Date: 2009-09-27 09:44:36 -0600 (Sun, 27 Sep 2009) New Revision: 3995 Modified: SQLObject/branches/0.10/docs/Authors.txt Log: "BroytMann" => "Broytman". Modified: SQLObject/branches/0.10/docs/Authors.txt =================================================================== --- SQLObject/branches/0.10/docs/Authors.txt 2009-09-25 14:50:07 UTC (rev 3994) +++ SQLObject/branches/0.10/docs/Authors.txt 2009-09-27 15:44:36 UTC (rev 3995) @@ -21,7 +21,7 @@ * David Turner, The Open Planning Project * Dan Pascu <dan at ag-projects.com> * Diez B. Roggisch <deets at web.de> -* Oleg Broytmann <ph...@ph...> +* Oleg Broytman <ph...@ph...> .. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10 :target: http://sourceforge.net/projects/sqlobject |
From: SourceForge.net <no...@so...> - 2009-09-27 03:45:51
|
Patches item #2866300, was opened at 2009-09-25 14:08 Message generated for change (Comment added) made by gkassel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2866300&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: Geoff Kassel (gkassel) Assigned to: Oleg Broytmann (phd) Summary: ConnectionHub.__get__ TypeError and patch Initial Comment: Hi, Found a TypeError raised from ConnectionHub.__get__ that seems to happen when overriding the SQLObject.__init__ method. Here's the associated trace: Traceback (most recent call last): File "<console>", line 1, in <module> File "/lvm/var/www/localhost/webapp/product/product/model/dbfile.py", line 220, in __init__ SQLObject.__init__(self, contentType = contentType, _data = data) File "//usr/lib/python2.5/site-packages/sqlobject/main.py", line 1223, in __init__ self._create(id, **kw) File "//usr/lib/python2.5/site-packages/sqlobject/main.py", line 1271, in _create self._SO_finishCreate(id) File "//usr/lib/python2.5/site-packages/sqlobject/main.py", line 1294, in _SO_finishCreate id = self._connection.queryInsertID(self, File "//usr/lib/python2.5/site-packages/turbogears/database.py", line 273, in __get__ return self.hub.__get__(obj, type) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 826, in __get__ if obj and obj.__dict__.has_key('_connection'): TypeError: an integer is required The object 'obj' in question is an uninitialized SQLObject (an object of a database-backed file class named DBFile), and the error is raised from the 'if obj' condition. I've fixed this with the attached patch. ---------------------------------------------------------------------- >Comment By: Geoff Kassel (gkassel) Date: 2009-09-27 13:45 Message: The point of the 'obj is not None' condition (and I believe the original 'if obj') is to ensure that there is a valid object to extract the attribute __dict__ from. All I've done here is changed the test from one that Python seems to want an Integer-coercible value for - which seems to fail with uninitialized SQLObjects - to one that makes a little more explicit the requirement that the object is one that can have attributes extracted from it. I haven't actually come across a case where this object is None, so I don't think I can come up with a test program that demonstrates this. I presume the original intent of the code is something like insurance against an AttributeError during object destruction. On second thought, perhaps a better condition would be "if hasattr(obj, '__dict__')'"? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2009-09-26 00:02 Message: I cannot get how 'obj' can be None there. Can you provide a short test program that demonstrates the problem? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2866300&group_id=74338 |
From: SourceForge.net <no...@so...> - 2009-09-25 21:25:24
|
Bugs item #2865410, was opened at 2009-09-23 20:45 Message generated for change (Comment added) made by bdoms You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2865410&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: SQLObject release (specify) Status: Closed Resolution: Invalid Priority: 5 Private: No Submitted By: Brendan Doms (bdoms) Assigned to: Oleg Broytmann (phd) Summary: createTable Fails When Table is Named "Transaction" Initial Comment: Bare bones, just try this (I'm working off of the easy_install version on Ubuntu, which is currently 0.11.0): from sqlobject import SQLObject, connectionForURI, sqlhub db_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'finance.db') connection = connectionForURI('sqlite:' + db_file) sqlhub.processConnection = connection class Transaction(SQLObject): pass Transaction.createTable() If the table is named anything else (as far as I can find), then it works fine. But as it is, this generates the following error: File "/usr/local/lib/python2.6/dist-packages/SQLObject-0.11.0-py2.6.egg/sqlobject/sqlite/sqliteconnection.py", line 183, in _executeRetry raise OperationalError(ErrorMessage(e)) sqlobject.dberrors.OperationalError: near "transaction": syntax error Not very helpful right? Either this error should be changed to point out the fact that "Transaction" is invalid as a table name, or the preferred solution would be to eliminate the error altogether and allow this table name. Considering that the import list contains no * and nothing called "Transaction" I see no reason why SQLObject's name space should interfere here. ---------------------------------------------------------------------- Comment By: Brendan Doms (bdoms) Date: 2009-09-25 17:25 Message: Ah, nice job getting to the root of the issue. I guess I just assumed that because SQLObject is an abstraction layer it would take the pain away from dealing with databases and so none of SQLite's (or any other database) reserved keywords would be in conflict. My bad. Since that's not the case, I would still recommend making the error message more clear here if possible. Specifically mentioning the reserved keyword thing would have helped me track down the bug faster. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2009-09-25 11:04 Message: If you add '?debug=1' to DB URI you find the following SQLObject debugging output: 1/QueryR : CREATE TABLE transaction ( id INTEGER PRIMARY KEY ) This is where the error came from - from SQLite, not from SQLObject! SQLObject's namespace has nothing to do here. Traceback (most recent call last): [skip] raise OperationalError(ErrorMessage(e)) sqlobject.dberrors.OperationalError: near "transaction": syntax error Let's test it without SQLObject: $ sqlite3 test SQLite version 3.5.9 Enter ".help" for instructions sqlite> CREATE TABLE transaction (id INTEGER PRIMARY KEY); SQL error: near "transaction": syntax error SQLite (like any other DB) doesn't allow keywords to be used as names. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2865410&group_id=74338 |
From: SourceForge.net <no...@so...> - 2009-09-25 15:04:05
|
Bugs item #2865410, was opened at 2009-09-24 04:45 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2865410&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: SQLObject release (specify) >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Brendan Doms (bdoms) >Assigned to: Oleg Broytmann (phd) Summary: createTable Fails When Table is Named "Transaction" Initial Comment: Bare bones, just try this (I'm working off of the easy_install version on Ubuntu, which is currently 0.11.0): from sqlobject import SQLObject, connectionForURI, sqlhub db_file = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'finance.db') connection = connectionForURI('sqlite:' + db_file) sqlhub.processConnection = connection class Transaction(SQLObject): pass Transaction.createTable() If the table is named anything else (as far as I can find), then it works fine. But as it is, this generates the following error: File "/usr/local/lib/python2.6/dist-packages/SQLObject-0.11.0-py2.6.egg/sqlobject/sqlite/sqliteconnection.py", line 183, in _executeRetry raise OperationalError(ErrorMessage(e)) sqlobject.dberrors.OperationalError: near "transaction": syntax error Not very helpful right? Either this error should be changed to point out the fact that "Transaction" is invalid as a table name, or the preferred solution would be to eliminate the error altogether and allow this table name. Considering that the import list contains no * and nothing called "Transaction" I see no reason why SQLObject's name space should interfere here. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2009-09-25 19:04 Message: If you add '?debug=1' to DB URI you find the following SQLObject debugging output: 1/QueryR : CREATE TABLE transaction ( id INTEGER PRIMARY KEY ) This is where the error came from - from SQLite, not from SQLObject! SQLObject's namespace has nothing to do here. Traceback (most recent call last): [skip] raise OperationalError(ErrorMessage(e)) sqlobject.dberrors.OperationalError: near "transaction": syntax error Let's test it without SQLObject: $ sqlite3 test SQLite version 3.5.9 Enter ".help" for instructions sqlite> CREATE TABLE transaction (id INTEGER PRIMARY KEY); SQL error: near "transaction": syntax error SQLite (like any other DB) doesn't allow keywords to be used as names. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2865410&group_id=74338 |
From: SourceForge.net <no...@so...> - 2009-09-25 14:52:15
|
Bugs item #2865000, was opened at 2009-09-23 17:26 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2865000&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: General Group: SQLObject release (specify) >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: greg (gregor_horvath) >Assigned to: Oleg Broytmann (phd) Summary: UnicodeEncodeError with ?debug=1 and unciode query Initial Comment: If in the connection string ?debug=1 is enabled and the select query is unicode, then a UnicodeEncodeError is thrown: File "/usr/lib/python2.5/site-packages/sqlobject/sresults.py", line 179, in __iter__ return iter(list(self.lazyIter())) File "/usr/lib/python2.5/site-packages/sqlobject/sresults.py", line 187, in lazyIter return conn.iterSelect(self) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 395, in iterSelect select, keepConnection=False) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 633, in __init__ dbconn.printDebug(rawconn, self.query, 'Select') File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 324, in printDebug self.debugWriter.write(msg) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 35, in write self.logfile.write(text + '\n') UnicodeEncodeError: 'ascii' codec can't encode character u'\xd6' in position 56: ordinal not in range(128) See in the attachment a test case wich demonstrates the error case and the ok case. Tested on Version 0.10.2 ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2009-09-25 18:52 Message: Fixed in the revisions 3992-3994 (branches 0.10, 0.11 and the trunk). Will be in the next round of releases. Thank you! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2865000&group_id=74338 |
From: <sub...@co...> - 2009-09-25 14:50:15
|
Author: phd Date: 2009-09-25 08:50:07 -0600 (Fri, 25 Sep 2009) New Revision: 3994 Modified: SQLObject/trunk/docs/News.txt SQLObject/trunk/sqlobject/dbconnection.py Log: Merged a bugfix in logging to console fro branch 0.11, rev. 3993. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2009-09-25 14:47:40 UTC (rev 3993) +++ SQLObject/trunk/docs/News.txt 2009-09-25 14:50:07 UTC (rev 3994) @@ -48,6 +48,11 @@ * Removed all deprecated attribute and functions. +SQLObject 0.11.2 +================ + +* A change ported from `SQLObject 0.10.8`_. + SQLObject 0.11.1 ================ @@ -103,6 +108,11 @@ * Changed the order of testing of SQLite modules - look for external PySQLite2 before sqlite3. +SQLObject 0.10.8 +================ + +* Fixed a bug in logging to console - convert unicode to str. + SQLObject 0.10.7 ================ Modified: SQLObject/trunk/sqlobject/dbconnection.py =================================================================== --- SQLObject/trunk/sqlobject/dbconnection.py 2009-09-25 14:47:40 UTC (rev 3993) +++ SQLObject/trunk/sqlobject/dbconnection.py 2009-09-25 14:50:07 UTC (rev 3994) @@ -28,27 +28,33 @@ conn.close() class ConsoleWriter: - def __init__(self, loglevel): + def __init__(self, connection, loglevel): # loglevel: None or empty string for stdout; or 'stderr' self.loglevel = loglevel or "stdout" + self.dbEncoding = getattr(connection, "dbEncoding", "ascii") def write(self, text): logfile = getattr(sys, self.loglevel) + if isinstance(text, unicode): + try: + text = text.encode(self.dbEncoding) + except UnicodeEncodeError: + text = repr(text)[2:-1] logfile.write(text + '\n') class LogWriter: - def __init__(self, logger, loglevel): + def __init__(self, connection, logger, loglevel): self.logger = logger self.loglevel = loglevel self.logmethod = getattr(logger, loglevel) def write(self, text): self.logmethod(text) -def makeDebugWriter(loggerName, loglevel): +def makeDebugWriter(connection, loggerName, loglevel): if not loggerName: - return ConsoleWriter(loglevel) + return ConsoleWriter(connection, loglevel) import logging logger = logging.getLogger(loggerName) - return LogWriter(logger, loglevel) + return LogWriter(connection, logger, loglevel) class Boolean(object): """A bool class that also understands some special string keywords (yes/no, true/false, on/off, 1/0)""" @@ -70,7 +76,7 @@ self.debug = Boolean(debug) self.debugOutput = Boolean(debugOutput) self.debugThreading = Boolean(debugThreading) - self.debugWriter = makeDebugWriter(logger, loglevel) + self.debugWriter = makeDebugWriter(self, logger, loglevel) self.doCache = Boolean(cache) self.cache = CacheSet(cache=self.doCache) self.style = style |