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:
Sam Doran
2018-09-28 16:04:50 -04:00
committed by GitHub
parent 2d01966e87
commit 8b1ae30e2e
3 changed files with 73 additions and 24 deletions

View File

@@ -0,0 +1,2 @@
bugfixes:
- blockinfile - use bytes rather than a native string to prevent a stacktrace in Python 3 when writing to the file (https://github.com/ansible/ansible/issues/46237)