1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-24 04:23:53 +03:00

gp: Use read_file() instead of readfp()

readfp() is deprecated and could be removed in a future version of
Python.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton
2023-08-29 16:30:08 +12:00
committed by Andrew Bartlett
parent 34042677b7
commit 2b566979ac
3 changed files with 8 additions and 8 deletions

View File

@@ -362,9 +362,9 @@ class gp_inf_ext(gp_ext):
inf_conf = ConfigParser(interpolation=None)
inf_conf.optionxform = str
try:
inf_conf.readfp(StringIO(policy.decode()))
inf_conf.read_file(StringIO(policy.decode()))
except UnicodeDecodeError:
inf_conf.readfp(StringIO(policy.decode('utf-16')))
inf_conf.read_file(StringIO(policy.decode('utf-16')))
return inf_conf