]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- py3k binary type returned natively for sqlite3, pg8000, fixes [ticket:1639] and...
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 7 Jan 2010 18:47:39 +0000 (18:47 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 7 Jan 2010 18:47:39 +0000 (18:47 +0000)
- use type(None), py3k compat, [ticket:1584]

README.py3k
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/types.py

index c43ec6827ba75bc56580309cb966e05a11263a2c..c52f56d3c1e1d53da0a9bfe88707f460c81daf62 100644 (file)
@@ -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
 -------------
index 8d69194e6387ff81a250f11bd786d7ab75b9e638..44344d165b83b6b8094c11122fafe11dfc4350f7 100644 (file)
@@ -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):
index 7d078cf1256dd1d83b6295f2d2d4a71f32af00cf..1bb8504881b157bf168868d855d2418895779b99 100644 (file)
@@ -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')
index fa7e4d9f440edf885a9d5b33626bbb0b2051ace3..571cd967ceeb6e9fc0b5598506a3c153cce6caa4 100644 (file)
@@ -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)