Don't use keyword `error` in encode

This is not supported in Python 2.6. Just use positional arguments.
reviewable/pr18780/r1
Jimena Cabrera-Notari 11 years ago
parent 6ccdf7cba5
commit 86e7555554

@ -597,7 +597,8 @@ def main():
except psycopg2.Error, e: except psycopg2.Error, e:
conn.rollback() conn.rollback()
# psycopg2 errors come in connection encoding, reencode # 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) module.fail_json(msg=msg)
if module.check_mode: if module.check_mode:

Loading…
Cancel
Save