From 92f8bf7b6f4e4f7fdb2d9fca58dd83f653146913 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 18 Jan 2024 07:12:50 +0100 Subject: [PATCH] mssql_script: make module Python 2 compatible (#7821) Make module Python 2 compatible. --- 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 13c52c9bfe..00b92e7312 100644 --- a/plugins/modules/mssql_script.py +++ b/plugins/modules/mssql_script.py @@ -283,7 +283,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