summaryrefslogtreecommitdiff
path: root/python/samba
diff options
context:
space:
mode:
authorPhilipp Gesang <philipp.gesang@intra2net.com>2019-03-12 15:43:42 +0100
committerNoel Power <npower@samba.org>2019-04-03 11:33:38 +0000
commit7a413a6dab3b0ffe4ea210adfd79d93d1b62215c (patch)
tree18f0a279d01705e57d05def1362c58a434b88d47 /python/samba
parentd01c5bc9fbe316d2358ead6382f4e7e3bf5fc000 (diff)
downloadsamba-7a413a6dab3b0ffe4ea210adfd79d93d1b62215c.tar.gz
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 <philipp.gesang@intra2net.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Wed Apr 3 11:33:38 UTC 2019 on sn-devel-144
Diffstat (limited to 'python/samba')
-rw-r--r--python/samba/__init__.py2
1 files changed, 1 insertions, 1 deletions
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)