]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Added a py3K conditional around unnecessary .decode()
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 13 Jan 2013 00:51:13 +0000 (19:51 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 13 Jan 2013 00:51:13 +0000 (19:51 -0500)
call in mssql information schema, fixes reflection
in Py3K. Also in 0.7.10. [ticket:2638]

doc/build/changelog/changelog_07.rst
doc/build/changelog/changelog_08.rst
lib/sqlalchemy/dialects/mssql/information_schema.py
test/dialect/test_mssql.py

index b98ff0d834670e5d9eb29e297e813de977d08177..cb88cd94089928ae25e24e4789c2b5a79ef43540 100644 (file)
@@ -8,6 +8,14 @@
     :version: 0.7.10
     :released:
 
+    .. change::
+        :tags: mssql, bug
+        :tickets: 2638
+
+      Added a Py3K conditional around unnecessary .decode()
+      call in mssql information schema, fixes reflection
+      in Py3k.
+
     .. change::
         :tags: orm, bug
         :tickets: 2650
index a45137167afa4c179d9711bcc219f9f4cb959d35..3abac5025858324ddd61c97222e19426f6f23fce 100644 (file)
@@ -6,6 +6,14 @@
 .. changelog::
     :version: 0.8.0
 
+    .. change::
+        :tags: mssql, bug
+        :tickets: 2638
+
+      Added a py3K conditional around unnecessary .decode()
+      call in mssql information schema, fixes reflection
+      in Py3K. Also in 0.7.10.
+
     .. change::
         :tags: orm, bug
         :tickets: 2650
index 15551e5e4149bd5cd54ba0cef64810ec80756370..35ce2450e0da9cce795d6bc1ecf612994f588136 100644 (file)
@@ -16,8 +16,10 @@ class CoerceUnicode(TypeDecorator):
     impl = Unicode
 
     def process_bind_param(self, value, dialect):
+        # Py2K
         if isinstance(value, str):
             value = value.decode(dialect.encoding)
+        # end Py2K
         return value
 
 schemata = Table("SCHEMATA", ischema,
index 972602378d08078bacd478f08e25194bff2aa241..8c1c0873a1ff2ce58fd72963c33ba03cf59b7bf8 100644 (file)
@@ -1990,6 +1990,13 @@ class BinaryTest(fixtures.TestBase, AssertsExecutionResults):
         fp.close()
         return stream
 
+class InfoCoerceUnicodeTest(fixtures.TestBase):
+    def test_info_unicode_coercion(self):
+        from sqlalchemy.dialects.mssql.information_schema import CoerceUnicode
+
+        dialect = mssql.dialect()
+        value = CoerceUnicode().bind_processor(dialect)('a string')
+        assert isinstance(value, unicode)
 
 class ReflectHugeViewTest(fixtures.TestBase):
     __only_on__ = 'mssql'