From 8bc51bb0ec0c3afe7633f253598de9858667bc1b Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 07:33:47 +0100 Subject: [PATCH] [PR #7821/92f8bf7b backport][stable-7] mssql_script: make module Python 2 compatible (#7865) mssql_script: make module Python 2 compatible (#7821) Make module Python 2 compatible. (cherry picked from commit 92f8bf7b6f4e4f7fdb2d9fca58dd83f653146913) Co-authored-by: Felix Fontein --- changelogs/fragments/7821-mssql_script-py2.yml | 2 ++ plugins/modules/mssql_script.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/7821-mssql_script-py2.yml diff --git a/changelogs/fragments/7821-mssql_script-py2.yml b/changelogs/fragments/7821-mssql_script-py2.yml new file mode 100644 index 0000000000..79de688628 --- /dev/null +++ b/changelogs/fragments/7821-mssql_script-py2.yml @@ -0,0 +1,2 @@ +bugfixes: + - "mssql_script - make the module work with Python 2 (https://github.com/ansible-collections/community.general/issues/7818, https://github.com/ansible-collections/community.general/pull/7821)." diff --git a/plugins/modules/mssql_script.py b/plugins/modules/mssql_script.py index 0033cf2e34..c24e4b9c32 100644 --- a/plugins/modules/mssql_script.py +++ b/plugins/modules/mssql_script.py @@ -284,7 +284,7 @@ def run_module(): # Process the script into batches queries = [] current_batch = [] - for statement in script.splitlines(keepends=True): + for statement in script.splitlines(True): # Ignore the Byte Order Mark, if found if statement.strip() == '\uFEFF': continue