mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Use to_bytes on filenames in filesystem calls.
This commit is contained in:
parent
27a33a6f18
commit
5b79ed77e7
6 changed files with 13 additions and 11 deletions
|
@ -127,7 +127,7 @@ class Connection(ConnectionBase):
|
|||
|
||||
out_path = pipes.quote(self._prefix_login_path(out_path))
|
||||
try:
|
||||
with open(in_path, 'rb') as in_file:
|
||||
with open(to_bytes(in_path, errors='strict'), 'rb') as in_file:
|
||||
try:
|
||||
p = self._buffered_exec_command('dd of=%s bs=%s' % (out_path, BUFSIZE), stdin=in_file)
|
||||
except OSError:
|
||||
|
@ -153,7 +153,7 @@ class Connection(ConnectionBase):
|
|||
except OSError:
|
||||
raise AnsibleError("chroot connection requires dd command in the chroot")
|
||||
|
||||
with open(out_path, 'wb+') as out_file:
|
||||
with open(to_bytes(out_path, errors='strict'), 'wb+') as out_file:
|
||||
try:
|
||||
chunk = p.stdout.read(BUFSIZE)
|
||||
while chunk:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue