2018年11月30日 星期五

[Python] configparser.DuplicateOptionError

Q: 

exception configparser.DuplicateOptionError 

Exception raised by strict parsers if a single option appears twice during reading from a single file, string or dictionary. This catches misspellings and case sensitivity-related errors, e.g. a dictionary may have two keys representing the same case-insensitive configuration key. 

 

 

 

 

SOL: 

config = configparser.RawConfigParser(allow_no_value=True,strict=False) 

 

 

 

 

 

沒有留言:

張貼留言