]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
The long-deprecated and non-functional ``assert_unicode`` flag on
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 25 Oct 2012 16:07:38 +0000 (12:07 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 25 Oct 2012 16:07:38 +0000 (12:07 -0400)
        :func:`.create_engine` as well as :class:`.String` is removed.

doc/build/changelog/changelog_08.rst
lib/sqlalchemy/engine/__init__.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/types.py
test/perf/stress_all.py

index 999b2ebbce9e4d9d105790fb6fb7d8ae3a4fade1..5d06263f446fa0622871f270c09f2a913b1f6137 100644 (file)
         :meth:`.ColumnOperators.notlike`,
         :meth:`.ColumnOperators.notilike` to :class:`.ColumnOperators`.
 
+    .. change::
+        :tags: sql, removed
+
+        The long-deprecated and non-functional ``assert_unicode`` flag on
+        :func:`.create_engine` as well as :class:`.String` is removed.
\ No newline at end of file
index eb9ef266bd2efd98d810fdad52a3c31e0c6e80e5..3deb437bbff70ca07c7daf6de83673db500b89bd 100644 (file)
@@ -126,12 +126,6 @@ def create_engine(*args, **kwargs):
 
     :ref:`connections_toplevel`
 
-    :param assert_unicode:  Deprecated.  This flag
-        sets an engine-wide default value for
-        the ``assert_unicode`` flag on the
-        :class:`.String` type - see that
-        type for further details.
-
     :param case_sensitive=True: if False, result column names
        will match in a case-insensitive fashion, that is,
        ``row['SomeColumn']``.
index f43c0404e6d8ea8b2af3a09eca75dd5669ec4bac..1be7bc02937f343700e7fc421f699d2c8fce86e8 100644 (file)
@@ -99,7 +99,7 @@ class DefaultDialect(interfaces.Dialect):
 
     reflection_options = ()
 
-    def __init__(self, convert_unicode=False, assert_unicode=False,
+    def __init__(self, convert_unicode=False,
                  encoding='utf-8', paramstyle=None, dbapi=None,
                  implicit_returning=None,
                  case_sensitive=True,
@@ -111,16 +111,6 @@ class DefaultDialect(interfaces.Dialect):
                 self.name)
 
         self.convert_unicode = convert_unicode
-        if assert_unicode:
-            util.warn_deprecated(
-                "assert_unicode is deprecated. "
-                "SQLAlchemy emits a warning in all cases where it "
-                "would otherwise like to encode a Python unicode object "
-                "into a specific encoding but a plain bytestring is "
-                "received. "
-                "This does *not* apply to DBAPIs that coerce Unicode "
-                "natively.")
-
         self.encoding = encoding
         self.positional = False
         self._ischema = None
index e31cecfe22345a92b26460c70bfb8864ea88c94e..579bd354d5ca0d52a115a306cee3549030493b05 100644 (file)
@@ -982,7 +982,7 @@ class String(Concatenable, TypeEngine):
 
     def __init__(self, length=None, collation=None,
                         convert_unicode=False,
-                        assert_unicode=None, unicode_error=None,
+                        unicode_error=None,
                         _warn_on_bytestring=False
                         ):
         """
@@ -1035,13 +1035,6 @@ class String(Concatenable, TypeEngine):
           cause SQLAlchemy's encode/decode services to be
           used unconditionally.
 
-        :param assert_unicode: Deprecated.  A warning is emitted
-          when a non-``unicode`` object is passed to the
-          :class:`.Unicode` subtype of :class:`.String`,
-          or the :class:`.UnicodeText` subtype of :class:`.Text`.
-          See :class:`.Unicode` for information on how to
-          control this warning.
-
         :param unicode_error: Optional, a method to use to handle Unicode
           conversion errors. Behaves like the ``errors`` keyword argument to
           the standard library's ``string.decode()`` functions.   This flag
@@ -1058,15 +1051,6 @@ class String(Concatenable, TypeEngine):
             raise exc.ArgumentError("convert_unicode must be 'force' "
                                         "when unicode_error is set.")
 
-        if assert_unicode:
-            util.warn_deprecated('assert_unicode is deprecated. '
-                                 'SQLAlchemy emits a warning in all '
-                                 'cases where it would otherwise like '
-                                 'to encode a Python unicode object '
-                                 'into a specific encoding but a plain '
-                                 'bytestring is received. This does '
-                                 '*not* apply to DBAPIs that coerce '
-                                 'Unicode natively.')
         self.length = length
         self.collation = collation
         self.convert_unicode = convert_unicode
index b5d210eefe68f8798f80f08068d7987c83b9738d..d17028530ffec7573c69ce9d81808f7e78cbb42d 100644 (file)
@@ -129,7 +129,7 @@ typedecoratortest = (MyIntType, genmyintvalue,
 # Unicode
 def genunicodevalue(rnum, fnum):
     return (rnum % 4) and (u"value%d" % fnum) or None
-unicodetest = (Unicode(20, assert_unicode=False), genunicodevalue,
+unicodetest = (Unicode(20, ), genunicodevalue,
                dict(num_records=100000))
 #               dict(engineurl='mysql:///test', freshdata=False))
 
@@ -159,7 +159,7 @@ if test_methods:
     for engineurl in ('postgresql://scott:tiger@localhost/test',
                        'sqlite://', 'mysql://scott:tiger@localhost/test'):
         print "\n%s\n" % engineurl
-        test_table = prepare(Unicode(20, assert_unicode=False),
+        test_table = prepare(Unicode(20,),
                              genunicodevalue,
                              num_fields=10, num_records=100000,
                              verbose=verbose, engineurl=engineurl)