diff --git a/changelogs/fragments/7821-mssql_script-py2.yml b/changelogs/fragments/7821-mssql_script-py2.yml new file mode 100644 index 00000000000..79de6886288 --- /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 13c52c9bfe8..00b92e7312f 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