mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Use bytes rather than native string for result (#46281)
This prevents a stack trace in Python 3 when the result is an empty file since the file is open in binary mode and a native string in Python 3 is str, not bytes.
This commit is contained in:
@@ -309,7 +309,7 @@ def main():
|
||||
if original is None or original.endswith(b('\n')):
|
||||
result += b('\n')
|
||||
else:
|
||||
result = ''
|
||||
result = b''
|
||||
|
||||
if module._diff:
|
||||
diff['after'] = result
|
||||
|
||||
Reference in New Issue
Block a user