Error opening options dialog

If you have a question or need help, this is the place to be.
pege
Posts: 6
Joined: Thu Aug 17, 2017 6:58 pm

Error opening options dialog

Post by pege » Fri Aug 18, 2017 6:14 am

Hi,

I have been using EventGhost for a long time and like it a lot. I just installed it on a new computer with a clean Windows 10 installation. Now I get the following error in the log when I try to open the option dialog. I thought it was something related to the latest rc, so I tried another version and got the same error. I have tried all versions between 0.5.0-beta5 and 0.5.0-rc4 and I get the same error in all versions.
The latest stable release works.
Any ideas what might be wrong? I searched the forum but didn't find anything.

Code: Select all

---> Welcome to EventGhost <---
08:01:51: 4 MainThread: Create(cls=<class 'eg.Classes.OptionsDialog.OptionsDialog'>)
08:01:51: 5 MainThread: OptionsDialog.ProcessingTask()
08:01:51: 5 MainThread: OptionsDialog.Configure(parent=<eg.Classes.MainFrame.MainFrame; proxy of <Swig Object of type 'wxFrame *' at 0x5653278> >)
08:01:51: 5 MainThread: OptionsDialog.__init__(parent=<eg.Classes.MainFrame.MainFrame; proxy of <Swig Object of type 'wxFrame *' at 0x5653278> >, title='Options')
08:01:51: 5 MainThread: OptionsDialog.__init__ => None
Traceback (most recent call last) (0.5.0-rc4):
  File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
    self.Configure(*args, **kwargs)
  File "C:\Program Files (x86)\EventGhost\eg\Utils.py", line 441, in LogItWithReturnWrapper
    result = func(*args, **kwargs)
  File "C:\Program Files (x86)\EventGhost\eg\Classes\OptionsDialog.py", line 120, in Configure
    max=999
  File "C:\Program Files (x86)\EventGhost\eg\Classes\ControlProviderMixin.py", line 116, in SpinIntCtrl
    return eg.SpinIntCtrl(self, -1, value, *args, **kwargs)
  File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 46, in __getattr__
    mod = __import__("eg.Classes." + name, None, None, [name], 0)
  File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinIntCtrl.py", line 24, in <module>
    class SpinIntCtrl(eg.SpinNumCtrl):
  File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 46, in __getattr__
    mod = __import__("eg.Classes." + name, None, None, [name], 0)
  File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinNumCtrl.py", line 27, in <module>
    THOUSANDS_SEP = l.GetInfo(wx.LOCALE_THOUSANDS_SEP)
  File "wx\_gdi.pyc", line 3106, in GetInfo
PyAssertionError: C++ assertion "strcmp(setlocale(LC_ALL, NULL), "C") == 0" failed at ..\..\src\common\intl.cpp(1449) 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!
08:01:51: 4 MainThread: Create => <eg.Classes.OptionsDialog.OptionsDialog; proxy of <Swig Object of type 'wxDialog *' at 0x3b16258> >
08:01:51: 4 MainThread: OptionsDialog.GetEvent()
08:01:51: 5 MainThread: OptionsDialog.Destroy()
08:01:51: 5 MainThread: OptionsDialog.ProcessingTask => None
08:01:51: 4 MainThread: OptionsDialog.GetEvent => (None, None)
08:01:51: 1 MainThread: MainFrame.OnDialogDestroy(event=<wx.WindowDestroyEvent>)

User avatar
kgschlosser
Site Admin
Posts: 5025
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error opening options dialog

Post by kgschlosser » Fri Aug 18, 2017 7:31 am

it has something to do with your local settings inside of Windows. this can be found in the Control Panel.
If you like the work I have been doing then feel free to Image

pege
Posts: 6
Joined: Thu Aug 17, 2017 6:58 pm

Re: Error opening options dialog

Post by pege » Fri Aug 18, 2017 7:41 am

Alright, but what? I have a clean install of Windows 10 with the standard values for Swedish local settings. I haven't change anything.

pege
Posts: 6
Joined: Thu Aug 17, 2017 6:58 pm

Re: Error opening options dialog

Post by pege » Fri Aug 18, 2017 7:58 am

Alright, so I changed Format in the region option dialog in Windows from "English (Sweden)" to "Swedish (Sweden)" and now it works.
Thanks for pointing me in the right direction.
I would, how ever, prefer to use "English (Sweden)". Is it a bug in EventGhost or in Windows?

User avatar
kgschlosser
Site Admin
Posts: 5025
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error opening options dialog

Post by kgschlosser » Fri Aug 18, 2017 6:00 pm

This seems to be a coding issue in EG i believe. I have attached a replacement file that I would like to to put into place. You will need to save the attached file to c:\program files (x86)\eventghost\eg\classes. this is the default install location if you installed it elsewhere then save it to that path in the eg\classes folder.

Let me know if this fixes the issue. this file has been this way for about a decade and this issue has never come up. so i am not sure if it is something that Microsoft changed with Windows 10. or if it is something that simply has never been an issue until now. But I will get this sorted out for you.

K
If you like the work I have been doing then feel free to Image

pege
Posts: 6
Joined: Thu Aug 17, 2017 6:58 pm

Re: Error opening options dialog

Post by pege » Sat Aug 19, 2017 9:11 am

Thanks for trying to fix this.

I tried the new file but I still can't open the option dialog. This is the error displayed (almost the same):

Code: Select all

Traceback (most recent call last) (0.5.0-rc4):
  File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
    self.Configure(*args, **kwargs)
  File "C:\Program Files (x86)\EventGhost\eg\Classes\OptionsDialog.py", line 120, in Configure
    max=999
  File "C:\Program Files (x86)\EventGhost\eg\Classes\ControlProviderMixin.py", line 116, in SpinIntCtrl
    return eg.SpinIntCtrl(self, -1, value, *args, **kwargs)
  File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 46, in __getattr__
    mod = __import__("eg.Classes." + name, None, None, [name], 0)
  File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinIntCtrl.py", line 24, in <module>
    class SpinIntCtrl(eg.SpinNumCtrl):
  File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 46, in __getattr__
    mod = __import__("eg.Classes." + name, None, None, [name], 0)
  File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinNumCtrl.py", line 26, in <module>
    THOUSANDS_SEP = l.GetInfo(wx.LOCALE_THOUSANDS_SEP)
  File "wx\_gdi.pyc", line 3106, in GetInfo
PyAssertionError: C++ assertion "strcmp(setlocale(LC_ALL, NULL), "C") == 0" failed at ..\..\src\common\intl.cpp(1449) 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!

User avatar
kgschlosser
Site Admin
Posts: 5025
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error opening options dialog

Post by kgschlosser » Sat Aug 19, 2017 3:27 pm

HA! this is a bug in wx.

wx is the software library that handles all of the graphics, the dialogs and windows things of that nature. Now I had changed how it sets the locale to do it the way the error stated. and it still errors with the same error.

I am going to have to do some more digging into this. the locale part of windows and wx is a very tricky thing. there might be a better means of capturing the information we need other then using wx.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5025
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error opening options dialog

Post by kgschlosser » Sat Aug 19, 2017 3:37 pm

give this file a try. see if it solves the issue. same instructions as before
Attachments
SpinNumCtrl.py
(5.61 KiB) Downloaded 105 times
If you like the work I have been doing then feel free to Image

pege
Posts: 6
Joined: Thu Aug 17, 2017 6:58 pm

Re: Error opening options dialog

Post by pege » Sat Aug 19, 2017 7:24 pm

Didn't work. See error:

Code: Select all

Traceback (most recent call last) (0.5.0-rc4):
  File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
    self.Configure(*args, **kwargs)
  File "C:\Program Files (x86)\EventGhost\eg\Classes\OptionsDialog.py", line 120, in Configure
    max=999
  File "C:\Program Files (x86)\EventGhost\eg\Classes\ControlProviderMixin.py", line 116, in SpinIntCtrl
    return eg.SpinIntCtrl(self, -1, value, *args, **kwargs)
  File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinIntCtrl.py", line 58, in __init__
    **kwargs
  File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinNumCtrl.py", line 94, in __init__
    numCtrl.SetValue(value)  # To avoid bug in NumCtrl
  File "wx\lib\masked\numctrl.pyc", line 1281, in SetValue
  File "wx\lib\masked\textctrl.pyc", line 189, in SetValue
  File "wx\lib\masked\textctrl.pyc", line 241, in ModifyValue
  File "wx\lib\masked\maskededit.pyc", line 4473, in _adjustInt
  File "wx\lib\masked\maskededit.pyc", line 1644, in _AdjustField
  File "string.pyc", line 521, in replace
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 0: ordinal not in range(128)

User avatar
kgschlosser
Site Admin
Posts: 5025
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error opening options dialog

Post by kgschlosser » Sat Aug 19, 2017 10:19 pm

OK this is going to be a tough nut to crack. now the code problems have wandered their way into the wx module. Let be bounce this off of one of my partners and see what he thinks about it. I know it can be fixed i want to get another head involved to find the easiest solution. But as it stands we are going to have to patch the wx modules code. and I would like to do it as little as possible.
If you like the work I have been doing then feel free to Image

User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Error opening options dialog

Post by topix » Fri Aug 25, 2017 6:46 pm

@pege: Please replace the following files with the attached onces and see if the error is gone.

- <EventGhostFolder>\eg\__init__.py
- <EventGhostFolder>\eg\Utils.py
- <EventGhostFolder>\eg\Classes\SpinNumCtrl.py
Attachments
SpinNumCtrl.py
(5.52 KiB) Downloaded 95 times
__init__.py
(3.2 KiB) Downloaded 126 times
Utils.py
(18.78 KiB) Downloaded 117 times

User avatar
kgschlosser
Site Admin
Posts: 5025
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error opening options dialog

Post by kgschlosser » Fri Aug 25, 2017 11:49 pm

@topix

its an odd problem isn't it?
If you like the work I have been doing then feel free to Image

someguy1
Posts: 34
Joined: Sun Mar 02, 2014 2:09 pm

Re: Error opening options dialog

Post by someguy1 » Sat Feb 23, 2019 11:07 am

I got the same problem. In windows 10 when I try to open the options I get this error:

Code: Select all

12:04:37 PM   Traceback (most recent call last) (0.5.0-rc6):
12:04:37 PM     File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 162, in ProcessingTask
12:04:37 PM       self.Configure(*args, **kwargs)
12:04:37 PM     File "C:\Program Files (x86)\EventGhost\eg\Classes\OptionsDialog.py", line 194, in Configure
12:04:37 PM       languageChoice.SetSelection(languageList.index(config.language))
12:04:37 PM   ValueError: 'en_US' is not in list
I too had Swedish in region format etc. I did the same thing as OP did, changing format to Swedish (sweden), but it didn't work. then I changed everything about language and region to English, still didn't work..

At least on English (united states) and Swedish (sweden) region formats EG starts. But when I set it to English (Sweden) as I originally had and want then EG won't even start and generates this error log:
Attachments
Log.txt
(8.34 KiB) Downloaded 27 times

User avatar
kgschlosser
Site Admin
Posts: 5025
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error opening options dialog

Post by kgschlosser » Sun Feb 24, 2019 5:11 am

Yes we know of the problem it has been fixed. If you click on the build button at the top of the forum you can download a version of EG that has the fix added to it.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5025
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error opening options dialog

Post by kgschlosser » Sun Feb 24, 2019 5:15 am

That locale error we also know about. And that is because you are running build 1809 of Windows. Microsoft broke something in that build. I am currently trying to work around the problem . No solution as of yet.

If you go into Cli.py file and change

locale.setlocale(locale.LC_ALL, '')

To
locale.setlocale(locale.LC_ALL, None)

See if that fixes it.
If you like the work I have been doing then feel free to Image

Post Reply