From: Mike Bayer Date: Thu, 7 Jan 2010 18:47:39 +0000 (+0000) Subject: - py3k binary type returned natively for sqlite3, pg8000, fixes [ticket:1639] and... X-Git-Tag: rel_0_6beta1~89 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ee458a619b443a24b195d4374759cff2e54e4bd;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - py3k binary type returned natively for sqlite3, pg8000, fixes [ticket:1639] and [ticket:1581] for now - use type(None), py3k compat, [ticket:1584] --- diff --git a/README.py3k b/README.py3k index c43ec6827b..c52f56d3c1 100644 --- a/README.py3k +++ b/README.py3k @@ -17,6 +17,12 @@ written. You now have a Python 3 version of SQLAlchemy in lib/. +Current 3k Issues +----------------- + +Current bugs and tickets related to Py3k are on the Py3k milestone in trac: + +http://www.sqlalchemy.org/trac/query?status=new&status=assigned&status=reopened&milestone=py3k Running Tests ------------- diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py index 8d69194e63..44344d165b 100644 --- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py +++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py @@ -145,6 +145,9 @@ class _OracleUnicodeText(sqltypes.UnicodeText): return value return process else: + # TODO: this is wrong - we are getting a LOB here + # no matter what version of oracle, so process() + # is still needed return super(_OracleUnicodeText, self).result_processor(dialect, coltype) class _OracleInteger(sqltypes.Integer): diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index 7d078cf125..1bb8504881 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -23,7 +23,7 @@ from sqlalchemy.orm.interfaces import ( MANYTOMANY, MANYTOONE, MapperProperty, ONETOMANY, PropComparator, StrategizedProperty, ) -from types import NoneType +NoneType = type(None) __all__ = ('ColumnProperty', 'CompositeProperty', 'SynonymProperty', 'ComparableProperty', 'RelationProperty', 'BackRef') diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py index fa7e4d9f44..571cd967ce 100644 --- a/lib/sqlalchemy/types.py +++ b/lib/sqlalchemy/types.py @@ -849,6 +849,8 @@ class Binary(TypeEngine): """ self.length = length + # Python 3 - sqlite3 doesn't need the `Binary` conversion + # here, though pg8000 does to indicate "bytea" def bind_processor(self, dialect): DBAPIBinary = dialect.dbapi.Binary def process(value): @@ -858,6 +860,10 @@ class Binary(TypeEngine): return None return process + # Python 3 has native bytes() type + # both sqlite3 and pg8000 seem to return it + # (i.e. and not 'memoryview') + # Py2K def result_processor(self, dialect, coltype): if util.jython: def process(value): @@ -874,7 +880,8 @@ class Binary(TypeEngine): else: return None return process - + # end Py2K + def adapt(self, impltype): return impltype(length=self.length)