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