mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix binary file manage test
This commit is contained in:
parent
9e3b44d6af
commit
e51b0f8c7e
1 changed files with 3 additions and 3 deletions
|
@ -5462,11 +5462,11 @@ def manage_file(name,
|
|||
# Write the static contents to a temporary file
|
||||
tmp = salt.utils.files.mkstemp(prefix=salt.utils.files.TEMPFILE_PREFIX,
|
||||
text=True)
|
||||
if salt.utils.platform.is_windows():
|
||||
contents = os.linesep.join(
|
||||
_splitlines_preserving_trailing_newline(contents))
|
||||
with salt.utils.files.fopen(tmp, 'wb') as tmp_:
|
||||
if encoding:
|
||||
if salt.utils.platform.is_windows():
|
||||
contents = os.linesep.join(
|
||||
_splitlines_preserving_trailing_newline(contents))
|
||||
log.debug('File will be encoded with %s', encoding)
|
||||
tmp_.write(contents.encode(encoding=encoding, errors=encoding_errors))
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue