]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
The str.encode() method does not accept keyword args in python < 2.7
authorJeff Dairiki <dairiki@dairiki.org>
Sun, 1 Sep 2013 09:33:50 +0000 (02:33 -0700)
committerJeff Dairiki <dairiki@dairiki.org>
Sun, 1 Sep 2013 09:33:50 +0000 (02:33 -0700)
alembic/util.py
tests/test_command.py

index bd2f03586d9f73f677eeef38f4dabfe51c4c94a1..a8750a2c145d967c6ec313538e8daa130c340c8c 100644 (file)
@@ -127,7 +127,7 @@ def write_outstream(stream, *text):
     encoding = getattr(stream, 'encoding', 'ascii') or 'ascii'
     for t in text:
         if not isinstance(t, binary_type):
-            t = t.encode(encoding, errors='replace')
+            t = t.encode(encoding, 'replace')
         t = t.decode(encoding)
         stream.write(t)
 
index 1179b6e087dd661dcc9eaad6f1bf25479508408f..53a95386f19fdb546808889edf9491f301375bcb 100644 (file)
@@ -26,11 +26,11 @@ class StdoutCommandTest(unittest.TestCase):
         # test default encode/decode behavior as well,
         # rev B has a non-ascii char in it + a coding header.
         eq_(
-            buf.getvalue().decode("ascii", errors='replace').strip(),
+            buf.getvalue().decode("ascii", 'replace').strip(),
             "\n".join([
                 script.get_revision(rev).log_entry
                 for rev in expected
-            ]).encode("ascii", errors="replace").decode("ascii").strip()
+            ]).encode("ascii", "replace").decode("ascii").strip()
         )
 
     def _buf_fixture(self):