From 86e7555554c233d2e72cb4c2907378cd97bcc29e 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. --- database/postgresql_privs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/database/postgresql_privs b/database/postgresql_privs index 2f3db9a93f1..de5fa94fa48 100644 --- a/database/postgresql_privs +++ b/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: