mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Don't use keyword error
in encode
This is not supported in Python 2.6. Just use positional arguments.
This commit is contained in:
parent
40ee030790
commit
cc6e1ec261
1 changed files with 2 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue