1. Ben Trofatter
  2. sqlalchemy-1753

Commits

Mike Bayer  committed d576b5f

The long-deprecated and non-functional ``assert_unicode`` flag on
:func:`.create_engine` as well as :class:`.String` is removed.

  • Participants
  • Parent commits 7a33802
  • Branches default

Comments (0)

Files changed (5)

File doc/build/changelog/changelog_08.rst

View 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.

File lib/sqlalchemy/engine/__init__.py

View file
 
     :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']``.

File lib/sqlalchemy/engine/default.py

View file
 
     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,
                 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

File lib/sqlalchemy/types.py

View file
 
     def __init__(self, length=None, collation=None,
                         convert_unicode=False,
-                        assert_unicode=None, unicode_error=None,
+                        unicode_error=None,
                         _warn_on_bytestring=False
                         ):
         """
           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
             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

File test/perf/stress_all.py

View file
 # 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))
 
     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)