十四、报错:configparser.InterpolationSyntaxError: ‘%‘ must be followed by ‘%‘ or ‘(‘, found: “%)‘] 的解决
报错内容:
Failed to import test module: app.BusinessProcess.testLendRequestProcess.testPrivateOwner.test_001_lend_request_private_owner_module
Traceback (most recent call last):
File "C:\Python36\lib\unittest\loader.py", line 428, in _find_test_path
module = self._get_module_from_name(name)
File "C:\Python36\lib\unittest\loader.py", line 369, in _get_module_from_name
__import__(name)
File "C:\chushujin\study\sales_ui_auto\testCase\app\BusinessProcess\testLendRequestProcess\testPrivateOwner\test_001_lend_request_private_owner_module.py", line 9, in <module>
from page.app.BusinessProcess.testLendRequestProcess.testPrivateOwner.page_sales_lend_request_private_owner_module import PageSalesLendRequestPrivateOwner
File "C:\chushujin\study\sales_ui_auto\page\app\BusinessProcess\testLendRequestProcess\testPrivateOwner\page_sales_lend_request_private_owner_module.py", line 8, in <module>
from locator.app.BusinessProcess.testLendRequestProcess.testPrivateOwner.locator_sales_lend_request_private_owner_module import LocatorSalesLendRequestPrivateOwner
File "C:\chushujin\study\sales_ui_auto\locator\app\BusinessProcess\testLendRequestProcess\testPrivateOwner\locator_sales_lend_request_private_owner_module.py", line 9, in <module>
class LocatorSalesLendRequestPrivateOwner:
File "C:\chushujin\study\sales_ui_auto\locator\app\BusinessProcess\testLendRequestProcess\testPrivateOwner\locator_sales_lend_request_private_owner_module.py", line 18, in LocatorSalesLendRequestPrivateOwner
lend_request_private_owner_proportion_of_shares_xpath = myConfig.getAppElement("lend_request_private_owner_proportion_of_shares_xpath")
File "C:\chushujin\study\sales_ui_auto\comm\my_config.py", line 62, in getAppElement
app_Element = config.get('appElement',key)
File "C:\Python36\lib\configparser.py", line 800, in get
d)
File "C:\Python36\lib\configparser.py", line 394, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "C:\Python36\lib\configparser.py", line 444, in _interpolate_some
"found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: "%)']/following::android.widget.EditText"
总的分析来说 ,最后一句才是重点:读取配置文件config.ini时候,里面存在%引起的
解决方法一:
configparser很可能正在读取字符串中的文字“%”符号。'%'符号用于字符串插值(替代)。如果要使用文字“%”,可以使用另一个“%”对其进行转义。例如,在configparser读取的配置变量中,使用“ 100 %%”表示“ 100%”。
解决方法二:
将
cf= configparser.ConfigParser()
改为:
cf = configparser.RawConfigParser()
十四、报错:configparser.InterpolationSyntaxError: ‘%‘ must be followed by ‘%‘ or ‘(‘, found: “%)‘] 的解决相关推荐
- stacktrace not available;stata报错:stacktrace not available是什么意思,如何解决?
stacktrace not available:stata报错:stacktrace not available是什么意思,如何解决? "stacktrace not available& ...
- centos在yum install报错:Another app is currently holding the yum lock解决方法
centos在yum install报错:Another app is currently holding the yum lock解决方法 参考文章: (1)centos在yum install报错 ...
- phpmyadmin登录报错crypt_random_string requires at least one symmetric cipher be loaded 解决方法
phpmyadmin登录报错crypt_random_string requires at least one symmetric cipher be loaded 解决方法 参考文章: (1)php ...
- python的moviepy库 打包 报错: ‘moviepy.audio.fx.all‘ has no attribute ‘audio_fade 的解决办法
本篇文章主要讲解python的moviepy库 打包 报错: 'moviepy.audio.fx.all' has no attribute 'audio_fade 的解决办法 日期:2022年3月9 ...
- oracle插入时间报错,Oracle 插入时间时 报错:ORA-01861: 文字与格式字符串不匹配 的解决办法...
一.写sql的方式插入到Oracle中 往oracle中插入时间 '2007-12-28 10:07:24' 如果直接按照字符串方式,或者,直接使用to_date('2007-12-28 10:07 ...
- 控制台报错:java.lang.ClassNotFoundException: javax.xml.bind.JAXBException之解决方法
控制台报错:java.lang.ClassNotFoundException: javax.xml.bind.JAXBException之解决方法 参考文章: (1)控制台报错:java.lang.C ...
- msfconsole启动失败并报错`not_after=‘: bignum too big to convert into `long‘的解决方法
msfconsole启动失败并报错`not_after=': bignum too big to convert into `long'的解决方法 参考文章: (1)msfconsole启动失败并报错 ...
- Pycharm报错:AttributeError: ‘NoneType‘ object has no attribute ‘_gdal‘的解决办法
Pycharm报错:AttributeError: 'NoneType' object has no attribute '_gdal'的解决办法 解决办法如下: pycharm找到settings ...
- SVN报错:can‘t open file db/txn-current-lock:permission denied 解决方法
SVN报错:can't open file db/txn-current-lock:permission denied 解决方法 参考文章: (1)SVN报错:can't open file db/t ...
- mysql 1033_mysql报错1033 Incorrect information in file: ''''xxx.frm''''问题的解决方法(图)...
这篇文章主要介绍了关于mysql报错1033 Incorrect information in file: 'xxx.frm'问题的解决方法,文中通过示例代码介绍的很详细,需要的朋友可以参考借鉴,下面 ...
最新文章
- php调用搜狗ocr接口,搜狗ocr识别接口
- 数据结构 --静态队列 讲解
- Python类的使用总结
- 使用windowManager实现音乐播放器(悬浮框)效果
- android视频播放器api,03.视频播放器Api说明
- vscode括号颜色插件_[VSCode插件推荐] Bracket Pair Colorizer: 为代码中的括号添上一抹亮色...
- 修改配置nginx,限制无良爬虫频率
- html汉字在ie11中乱码,你好 我电脑 IE11 网页下拉的键都变成的中文乱码 例如“马夬”“邢”之类的中文乱码...
- 使用Latex排版一篇IEEE Robotics and Automation Letters期刊文章
- pptx文件怎么打开(ppt兼容包下载)
- adb通过局域网连接手机
- 20159318 《网络攻防实践》第2周学习总结
- 关于应用RestHighLevelClient操作ElasticSearch出现“远程主机强迫关闭一个现有连接”的问题探究
- Android手机与PC端进行通信
- Vue如何使用video标签实现视频播放
- 本科生毕业论文设计-论文总体-论文格式-查重经历
- 什么是低格、高格、快格?
- 车站广播系统采用计算机,高铁站广播系统
- bat批处理之启动多个PC端微信
- 微信开放平台10分钟推送一次临时ticket