标签:missing 读取 iter lob .com ssi https itertools .config
1、读取configparser 配置文件报错 :
提示:
ConfigParser.MissingSectionHeaderError when parsing rsyncd config file with global options
解决方法:
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‘)
标签:missing 读取 iter lob .com ssi https itertools .config
原文地址:https://www.cnblogs.com/Ray-Lei/p/10251675.html