From cc6e1ec261b1806d8e8efc320b10a8abe4d12c20 Mon Sep 17 00:00:00 2001 From: Jimena Cabrera-Notari Date: Thu, 6 Mar 2014 13:33:53 +0000 Subject: [PATCH] Don't use keyword `error` in encode This is not supported in Python 2.6. Just use positional arguments. --- library/database/postgresql_privs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/database/postgresql_privs b/library/database/postgresql_privs index 2f3db9a93f..de5fa94fa4 100644 --- a/library/database/postgresql_privs +++ b/library/database/postgresql_privs @@ -597,7 +597,8 @@ def main(): except psycopg2.Error, e: conn.rollback() # psycopg2 errors come in connection encoding, reencode - msg = e.message.decode(conn.encoding).encode(errors='replace') + msg = e.message.decode(conn.encoding).encode(sys.getdefaultencoding(), + 'replace') module.fail_json(msg=msg) if module.check_mode: