Getting wx._core.wxAssertionError

Ishan Buxy ce17b117 <[email protected]> Thu, 9 Dec 2021 22:44:27 -0800 (PST)
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
------=_Part_1716_61772196.1639118667827
Content-Type: multipart/alternative; 
	boundary="----=_Part_1717_1443797924.1639118667827"

------=_Part_1717_1443797924.1639118667827
Content-Type: text/plain; charset="UTF-8"

Hi,

I'm using GRASS GIS 7.8 <https://grass.osgeo.org/>, an application created 
using wxPython.

Every time I try to open a dataset using this application, I get the 
following error:
C:\Users\Ishan Buxy>Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\wxgui.py", line 105, in 
OnInit
    mainframe = GMFrame(parent=None, id=wx.ID_ANY,
  File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\lmgr\frame.py", line 
141, in __init__
    self._createMenuBar()
  File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\lmgr\frame.py", line 
268, in _createMenuBar
    self.menubar = GMenu(
  File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gui_core\menu.py", line 
47, in __init__
    self.Append(self._createMenu(child), child.label)
  File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gui_core\menu.py", line 
61, in _createMenu
    self._createMenuItem(menu, label=child.label, **data)
  File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gui_core\menu.py", line 
88, in _createMenuItem
    menuItem.SetBitmap(MetaIcon(img=icon).GetBitmap(self.bmpsize))
  File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\icons\icon.py", line 
96, in GetBitmap
    image = wx.Image(name=self.imagepath)
wx._core.wxAssertionError: C++ assertion "strcmp(setlocale(0, 0), "C") == 
0" failed at 
D:\src\osgeo4w\src\wxwidgets\wxwidgets-3.1.5-0df1d81acd6f1be8624022f8eecb51679008ca40\src\common\intl.cpp(1694) 
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...


Can someone please explain? How do I resolve this?

Regards,
Ishan

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/606f847f-2645-4402-ad27-4c1fde04bb7fn%40googlegroups.com.

------=_Part_1717_1443797924.1639118667827
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div>Hi,</div><div><br></div><div>I'm using <a href=3D"https://grass.osgeo.=
org/">GRASS GIS 7.8</a>, an application created using wxPython.</div><div><=
br></div><div>Every time I try to open a dataset using this application, I =
get the following error:</div><div>C:\Users\Ishan Buxy&gt;Traceback (most r=
ecent call last):<br>&nbsp; File "C:\Program Files\GRASS GIS 7.8\gui\wxpyth=
on\wxgui.py", line 105, in OnInit<br>&nbsp; &nbsp; mainframe =3D GMFrame(pa=
rent=3DNone, id=3Dwx.ID_ANY,<br>&nbsp; File "C:\Program Files\GRASS GIS 7.8=
\gui\wxpython\lmgr\frame.py", line 141, in __init__<br>&nbsp; &nbsp; self._=
createMenuBar()<br>&nbsp; File "C:\Program Files\GRASS GIS 7.8\gui\wxpython=
\lmgr\frame.py", line 268, in _createMenuBar<br>&nbsp; &nbsp; self.menubar =
=3D GMenu(<br>&nbsp; File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gui_=
core\menu.py", line 47, in __init__<br>&nbsp; &nbsp; self.Append(self._crea=
teMenu(child), child.label)<br>&nbsp; File "C:\Program Files\GRASS GIS 7.8\=
gui\wxpython\gui_core\menu.py", line 61, in _createMenu<br>&nbsp; &nbsp; se=
lf._createMenuItem(menu, label=3Dchild.label, **data)<br>&nbsp; File "C:\Pr=
ogram Files\GRASS GIS 7.8\gui\wxpython\gui_core\menu.py", line 88, in _crea=
teMenuItem<br>&nbsp; &nbsp; menuItem.SetBitmap(MetaIcon(img=3Dicon).GetBitm=
ap(self.bmpsize))<br>&nbsp; File "C:\Program Files\GRASS GIS 7.8\gui\wxpyth=
on\icons\icon.py", line 96, in GetBitmap<br>&nbsp; &nbsp; image =3D wx.Imag=
e(name=3Dself.imagepath)<br>wx._core.wxAssertionError: C++ assertion "strcm=
p(setlocale(0, 0), "C") =3D=3D 0" failed at D:\src\osgeo4w\src\wxwidgets\wx=
widgets-3.1.5-0df1d81acd6f1be8624022f8eecb51679008ca40\src\common\intl.cpp(=
1694) in wxLocale::GetInfo(): You probably called setlocale() directly inst=
ead of using wxLocale and now there is a mismatch between C/C++ and Windows=
 locale.<br>Things are going to break, please only change locale by creatin=
g wxLocale objects to avoid this!<br>OnInit returned false, exiting...</div=
><div><br></div><div><br></div><div>Can someone please explain? How do I re=
solve this?<br></div><div><br></div><div>Regards,</div><div>Ishan<br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;wxPython-users&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">wxpy=
[email protected]</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/wxpython-users/606f847f-2645-4402-ad27-4c1fde04bb7fn%40googlegro=
ups.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d=
/msgid/wxpython-users/606f847f-2645-4402-ad27-4c1fde04bb7fn%40googlegroups.=
com</a>.<br />

------=_Part_1717_1443797924.1639118667827--

------=_Part_1716_61772196.1639118667827--