一、读取configparser 配置文件报错 :spa
提示:ip
ConfigParser.MissingSectionHeaderError when parsing rsyncd config file with global optionsutf-8
解决方法:get
cfg = configparser.ConfigParser()
with open(file,'r') as fp:
cfg.read_file(itertools.chain(['[global]'], fp), source=file)
# config.read(file,encoding='utf-8')
gw_sip = cfg.get('test_sip_endpoint','gw_sip')io