1. dairiki
  2. alembic

Commits

dairiki  committed b33c38b

The str.encode() method does not accept keyword args in python < 2.7

  • Participants
  • Parent commits d1a0b88
  • Branches master

Comments (0)

Files changed (2)

File alembic/util.py

View file
  • Ignore whitespace
     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)
 

File tests/test_command.py

View file
  • Ignore whitespace
         # 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):