From 7a413a6dab3b0ffe4ea210adfd79d93d1b62215c Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 12 Mar 2019 15:43:42 +0100 Subject: python/samba: ignore encoding errors while reading files Provisioning fails on C locale due to the Unicode quotes in ldif data. Patch read_and_sub_file() to read the files as UTF-8. Signed-off-by: Philipp Gesang Reviewed-by: Douglas Bagnall Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Apr 3 11:33:38 UTC 2019 on sn-devel-144 --- python/samba/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/samba') diff --git a/python/samba/__init__.py b/python/samba/__init__.py index 93240dddfbb..d851bf3606c 100644 --- a/python/samba/__init__.py +++ b/python/samba/__init__.py @@ -280,7 +280,7 @@ def read_and_sub_file(file_name, subst_vars): :param file_name: File to be read (typically from setup directory) param subst_vars: Optional variables to subsitute in the file. """ - data = open(file_name, 'r').read() + data = open(file_name, 'r', encoding="utf-8").read() if subst_vars is not None: data = substitute_var(data, subst_vars) check_all_substituted(data) -- cgit v1.2.1