Sybase ProgrammingError when checking unicode_for_unicode

Issue #2299 resolved
Former user created an issue

Using an older Sybase database (ASA 9, I think), line 234 in engine/default.py was raising a ProgrammingError:

    unicode_for_unicode = check_unicode(sqltypes.Unicode(60))

I am running a sqlalchemy 0.7.2 port on FreeBSD.

I fixed it by catching the exception and returning False in the check_unicode function:

+++ engine/default.py   2011-10-12 13:43:38.000000000 -0700
@@ -224,6 +224,8 @@
                 row = cursor.fetchone()

                 return isinstance(row[0](0), unicode)
+            except self.dbapi.ProgrammingError:
+                return False
             finally:
                 cursor.close()

Comments (2)

  1. Log in to comment