wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now ther

本文详细介绍了在安装Robot Framework Ride后遇到的配置错误,重点在于修正了locale设置导致的问题,通过修改application.py中的locale变量,避免了wxLocale冲突。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装RF

pip install robotframework
pip install robotframework-appiumlibrary
pip install robotframework-databaselibrary
pip install robotframework-requests
pip install robotframework-ride
pip install robotframework-seleniumlibrary
pip install wxPython

启动RF

切换到目录: “Python的Script目录"下并运行命令"python ride.py”, 即可打开RF的主界面

出现下面错误 网上找了很多答案,写的不怎么明白,我记录一下,解决方式

D:\python3.8.6\Scripts>python ride.py
<class ‘robotide.preferences.configobj.UnreprError’> Parse error in value at line 0.
<class ‘robotide.preferences.configobj.UnreprError’> Parse error in value at line 70.
<class ‘robotide.preferences.configobj.UnreprError’> Parse error in value at line 71.
<class ‘robotide.preferences.configobj.UnreprError’> Parse error in value at line 13.
Traceback (most recent call last):
File “D:\python3.8.6\lib\site-packages\robotide\application\application.py”, line 58, in OnInit
self.frame = RideFrame(self, self._controller)
File “D:\python3.8.6\lib\site-packages\robotide\ui\mainframe.py”, line 175, in init
self._init_ui()
File “D:\python3.8.6\lib\site-packages\robotide\ui\mainframe.py”, line 279, in _init_ui
self.tree = Tree(self, self.actions,
File “D:\python3.8.6\lib\site-packages\robotide\ui\tree.py”, line 86, in init
self._images = TreeImageList()
File “D:\python3.8.6\lib\site-packages\robotide\ui\images.py”, line 42, in init
TestCaseController: _TreeImage(self, ‘robot.png’),
File “D:\python3.8.6\lib\site-packages\robotide\ui\images.py”, line 80, in init
self.normal = self._get_image(image_list, normal)
File “D:\python3.8.6\lib\site-packages\robotide\ui\images.py”, line 91, in _get_image
img = wx.Image(path, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
wx._core.wxAssertionError: C++ assertion “strcmp(setlocale(LC_ALL, NULL), “C”) == 0” failed at …\src\common\intl.cpp(1579) in wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now there is a mismatch between C/C++ and Windows locale.
Things are going to break, please only change locale by creating wxLocale objects to avoid this!
OnInit returned false, exiting…
Error in atexit._run_exitfuncs:
wx._core.wxAssertionError: C++ assertion “GetEventHandler() == this” failed at …\src\common\wincmn.cpp(478) in wxWindowBase::~wxWindowBase(): any pushed event handlers must have been removed

解决

再python安装目录下

D:\python3.8.6\Lib\site-packages\robotide\application\application.py

修改

 self._initial_locale = wx.Locale(wx.LANGUAGE_ENGLISH)

改成

self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)

建议改的时候直接Ctrl+D直接复制这一行,替换成需要修改的参数,空格容易出现问题
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Yuno Wang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值