1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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
This commit is contained in:
Philipp Gesang 2019-03-12 15:43:42 +01:00 committed by Noel Power
parent d01c5bc9fb
commit 7a413a6dab

View File

@ -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)