4141from __future__ import annotations
4242from typing import Dict , Union , Iterable
4343import os
44- from configparser import ConfigParser , ExtendedInterpolation
4544from firebird .base .config import Config , StrOption , IntOption , BoolOption , EnumOption , \
46- ConfigListOption , ListOption
45+ ConfigListOption , ListOption , ConfigParser , EnvExtendedInterpolation
4746from .types import NetProtocol , DecfloatRound , DecfloatTraps
4847
4948class ServerConfig (Config ): # pylint: disable=R0902
@@ -218,7 +217,7 @@ def read(self, filenames: Union[str, Iterable], encoding: str=None):
218217
219218 Return list of successfully read files.
220219 """
221- parser = ConfigParser (interpolation = ExtendedInterpolation ())
220+ parser = ConfigParser (interpolation = EnvExtendedInterpolation ())
222221 read_ok = parser .read (filenames , encoding )
223222 if read_ok :
224223 self .load_config (parser )
@@ -228,13 +227,13 @@ def read_file(self, f):
228227
229228 The `f` argument must be iterable, returning one line at a time.
230229 """
231- parser = ConfigParser (interpolation = ExtendedInterpolation ())
230+ parser = ConfigParser (interpolation = EnvExtendedInterpolation ())
232231 parser .read_file (f )
233232 self .load_config (parser )
234233 def read_string (self , string : str ) -> None :
235234 """Read configuration from a given string.
236235 """
237- parser = ConfigParser (interpolation = ExtendedInterpolation ())
236+ parser = ConfigParser (interpolation = EnvExtendedInterpolation ())
238237 parser .read_string (string )
239238 self .load_config (parser )
240239 def read_dict (self , dictionary : Dict ) -> None :
@@ -247,7 +246,7 @@ def read_dict(self, dictionary: Dict) -> None:
247246 All types held in the dictionary are converted to strings during
248247 reading, including section names, option names and keys.
249248 """
250- parser = ConfigParser (interpolation = ExtendedInterpolation ())
249+ parser = ConfigParser (interpolation = EnvExtendedInterpolation ())
251250 parser .read_dict (dictionary )
252251 self .load_config (parser )
253252 def get_server (self , name : str ) -> ServerConfig :
@@ -282,7 +281,7 @@ def register_server(self, name: str, config: str=None) -> ServerConfig:
282281 srv_config = ServerConfig (name )
283282 self .servers .value .append (srv_config )
284283 if config :
285- parser = ConfigParser (interpolation = ExtendedInterpolation ())
284+ parser = ConfigParser (interpolation = EnvExtendedInterpolation ())
286285 parser .read_string (config )
287286 srv_config .load_config (parser , name )
288287 return srv_config
@@ -304,7 +303,7 @@ def register_database(self, name: str, config: str=None) -> DatabaseConfig:
304303 db_config = DatabaseConfig (name )
305304 self .databases .value .append (db_config )
306305 if config :
307- parser = ConfigParser (interpolation = ExtendedInterpolation ())
306+ parser = ConfigParser (interpolation = EnvExtendedInterpolation ())
308307 parser .read_string (config )
309308 db_config .load_config (parser , name )
310309 return db_config
0 commit comments