diff --git a/src/cli/onefuzz/templates/libfuzzer.py b/src/cli/onefuzz/templates/libfuzzer.py index 3f4adfdf5..8e06d317a 100644 --- a/src/cli/onefuzz/templates/libfuzzer.py +++ b/src/cli/onefuzz/templates/libfuzzer.py @@ -626,7 +626,7 @@ class Libfuzzer(Command): with tempfile.TemporaryDirectory() as tempdir: if sysroot: setup_path = File(os.path.join(tempdir, "setup.sh")) - with open(setup_path, "w") as handle: + with open(setup_path, "w", newline="\n") as handle: sysroot_filename = helper.target_exe_blob_name(sysroot, None) handle.write( "#!/bin/bash\n" @@ -638,7 +638,7 @@ class Libfuzzer(Command): ) wrapper_path = File(os.path.join(tempdir, wrapper_name)) - with open(wrapper_path, "w") as handle: + with open(wrapper_path, "w", newline="\n") as handle: handle.write( "#!/bin/bash\n" 'SETUP_DIR=$(dirname "$(readlink -f "$0")")\n' @@ -648,7 +648,7 @@ class Libfuzzer(Command): upload_files = [setup_path, wrapper_path, sysroot] else: setup_path = File(os.path.join(tempdir, "setup.sh")) - with open(setup_path, "w") as handle: + with open(setup_path, "w", newline="\n") as handle: handle.write( "#!/bin/bash\n" "set -ex\n" @@ -656,7 +656,7 @@ class Libfuzzer(Command): ) wrapper_path = File(os.path.join(tempdir, wrapper_name)) - with open(wrapper_path, "w") as handle: + with open(wrapper_path, "w", newline="\n") as handle: handle.write( "#!/bin/bash\n" 'SETUP_DIR=$(dirname "$(readlink -f "$0")")\n'