python连接mysql,报错:configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%Sgmfc'
运行代码时抛出错误: configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%Sgmfc'
判断原因:在读取配置时,配置文件中存在%这个一类的特殊字符
解决方案:
在读取配置中将 self.config = configparser.ConfigParser()方法,换成:self.config = configparser.RawConfigParser()
完美解决!!
分类:
常见问题解决方案——python
标签:
Python