mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Fix unicode handling in connection plugins.
This commit is contained in:
parent
e52c1f26d3
commit
f878a5d2e0
5 changed files with 16 additions and 15 deletions
|
@ -25,6 +25,7 @@ from ansible.plugins.action import ActionBase
|
|||
from ansible.utils.boolean import boolean
|
||||
from ansible.utils.hashing import checksum, checksum_s, md5, secure_hash
|
||||
from ansible.utils.path import makedirs_safe
|
||||
from ansible.utils.unicode import to_bytes
|
||||
|
||||
|
||||
class ActionModule(ActionBase):
|
||||
|
@ -158,7 +159,7 @@ class ActionModule(ActionBase):
|
|||
self._connection.fetch_file(source, dest)
|
||||
else:
|
||||
try:
|
||||
f = open(dest, 'w')
|
||||
f = open(to_bytes(dest, errors='strict'), 'w')
|
||||
f.write(remote_data)
|
||||
f.close()
|
||||
except (IOError, OSError) as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue