]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Cleanup of r5556. Makes the description_encoding less public since this is a
authorMichael Trier <mtrier@gmail.com>
Fri, 2 Jan 2009 03:29:33 +0000 (03:29 +0000)
committerMichael Trier <mtrier@gmail.com>
Fri, 2 Jan 2009 03:29:33 +0000 (03:29 +0000)
workaround for the pyodbc dbapi.

lib/sqlalchemy/databases/mssql.py
lib/sqlalchemy/engine/default.py

index 490e562e959a028d987adb3569dfb45e03db8532..965cf575871d025024e81b2d304121ab00637b74 100644 (file)
@@ -923,7 +923,7 @@ class MSSQLDialect(default.DefaultDialect):
                  auto_identity_insert=True, query_timeout=None,
                  text_as_varchar=False, use_scope_identity=False,
                  has_window_funcs=False, max_identifier_length=None,
-                 schema_name="dbo", description_encoding='utf-8', **opts):
+                 schema_name="dbo", **opts):
         self.auto_identity_insert = bool(auto_identity_insert)
         self.query_timeout = int(query_timeout or 0)
         self.schema_name = schema_name
@@ -933,7 +933,7 @@ class MSSQLDialect(default.DefaultDialect):
         self.use_scope_identity = bool(use_scope_identity)
         self.has_window_funcs =  bool(has_window_funcs)
         self.max_identifier_length = int(max_identifier_length or 0) or 128
-        super(MSSQLDialect, self).__init__(description_encoding=description_encoding, **opts)
+        super(MSSQLDialect, self).__init__(**opts)
 
     @classmethod
     def dbapi(cls, module_name=None):
@@ -1240,7 +1240,8 @@ class MSSQLDialect_pyodbc(MSSQLDialect):
     execution_ctx_cls = MSSQLExecutionContext_pyodbc
 
     def __init__(self, description_encoding='latin-1', **params):
-        super(MSSQLDialect_pyodbc, self).__init__(description_encoding=description_encoding, **params)
+        super(MSSQLDialect_pyodbc, self).__init__(**params)
+        self.description_encoding = description_encoding
         # FIXME: scope_identity sniff should look at server version, not the ODBC driver
         # whether use_scope_identity will work depends on the version of pyodbc
         try:
index 8a44bac74fdba1a891135b6f9a4ed2fc64cf6448..590159e2b2f52725ce81b2336213e93649df5bbe 100644 (file)
@@ -42,7 +42,7 @@ class DefaultDialect(base.Dialect):
 
     def __init__(self, convert_unicode=False, assert_unicode=False,
                  encoding='utf-8', paramstyle=None, dbapi=None, 
-                 label_length=None, description_encoding='utf-8', **kwargs):
+                 label_length=None, **kwargs):
         self.convert_unicode = convert_unicode
         self.assert_unicode = assert_unicode
         self.encoding = encoding
@@ -60,7 +60,7 @@ class DefaultDialect(base.Dialect):
         if label_length and label_length > self.max_identifier_length:
             raise exc.ArgumentError("Label length of %d is greater than this dialect's maximum identifier length of %d" % (label_length, self.max_identifier_length))
         self.label_length = label_length
-        self.description_encoding = description_encoding
+        self.description_encoding = getattr(self, 'description_encoding', encoding)
 
     def type_descriptor(self, typeobj):
         """Provide a database-specific ``TypeEngine`` object, given