Commit cc6e1ec2 by Jimena Cabrera-Notari

Don't use keyword `error` in encode

This is not supported in Python 2.6. Just use positional arguments.
parent 40ee0307
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment