Error opening options dialog

If you have a question or need help, this is the place to be.
User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error opening options dialog

Post by kgschlosser » Sun Jul 28, 2019 4:22 am

We are aware of the issues with the locale settings and I have written a replacement It fixes quite a few issues with the locale settings.
If you like the work I have been doing then feel free to Image

rebirth24
Posts: 9
Joined: Sat Jul 15, 2017 7:40 pm

Re: Error opening options dialog

Post by rebirth24 » Sat Aug 10, 2019 9:08 pm

Has this been fixed? Just installed and I am having this issue.(Pre-Release version)

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

Re: Error opening options dialog

Post by kgschlosser » Sun Aug 11, 2019 1:13 am

we are still hammering out the best way to handle the issue. it's complex because of how Windows, wxPython (the GUI library) and Python handle the locale. specifically that they all handle it differently. we want to make sure the issue has been solved permanently. At the same time I am trying to work in automatic translations. The largest hurdle is getting everything to play nice with each other.
If you like the work I have been doing then feel free to Image

rebirth24
Posts: 9
Joined: Sat Jul 15, 2017 7:40 pm

Re: Error opening options dialog

Post by rebirth24 » Sat Oct 26, 2019 5:14 pm

This fixed yet?

jjazdk
Posts: 11
Joined: Wed Sep 02, 2015 8:21 pm

Re: Error opening options dialog

Post by jjazdk » Wed Mar 18, 2020 10:29 pm

I have this issue with the latest version (0.5.0-rc6).

System: Windows 10 Pro
Windows display language: English (Denmark)

Setting the display language to "English (United Kingdom)" solves the issue.

Let me know what I need to do, or anything I can do to help in the bug finding.

Log:
---> Welcome to EventGhost <---
Traceback (most recent call last) (0.5.0-rc6):
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\ConfigDialog.py", line 106, in Configure
treeItem.Configure(*args)
File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
return self.executable.Configure(*args)
File "C:\Program Files (x86)\EventGhost\plugins\Timer\__init__.py", line 518, in Configure
loopCtrl = eg.SpinIntCtrl(panel, -1, loops, 0, size=(200,-1))
File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 50, 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 50, 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!

jjazdk
Posts: 11
Joined: Wed Sep 02, 2015 8:21 pm

Re: Error opening options dialog

Post by jjazdk » Wed Mar 18, 2020 10:50 pm

Now it gets odd..

With display language = English (United Kingdom), I get this error when trying to open File->Options:

Traceback (most recent call last) (0.5.0-rc6):
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 194, in Configure
languageChoice.SetSelection(languageList.index(config.language))
ValueError: 'en_US' is not in list

User avatar
Sem;colon
Plugin Developer
Posts: 731
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Error opening options dialog

Post by Sem;colon » Thu Mar 19, 2020 1:20 am

kgschlosser wrote:
Sun Aug 11, 2019 1:13 am
At the same time I am trying to work in automatic translations.
Hi Kevin,
You're working on a lot of things and do a great job improving EG, but if you ask me, this is something not worth the effort. I never met someone outside an English speaking country that appreciates an automatic translation. Reason for this is, that no translation engine can properly translate texts and you end up with something that is not understandable at all (not even Google can do that). In fact, people just change the language to english (if possible) to get something they can read, instead of an automatic translation to their native language, that is just wrong.
Before spending more time with auto translation, I'd recommend to do a poll in the forum if this is even something people like to see in Eventghost. :wink:
If you like my work, Image me a drink :wink:

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

Re: Error opening options dialog

Post by kgschlosser » Thu Mar 19, 2020 3:02 pm

Sem;colon

The problem with the options dialog stems from another locale related issue. And while messing about with that issue 2-3 more problems with the locals popped up. I wrote some code that would fix the locale module in Python and correct the problems. Unfortunately I am not able to Monkey patch wxPython to fix issue that stem from it. I am however able to band-aide the problems in wxPython in order for things to run properly.

The problem you see there with the options dialog is because of EG use of non standard ISO codes. While that is an easy one to repair the others are not. I did not want to patch the locale module in Python but there is no way around not doing that in order to have it work properly.

I will have a bunch of extra time on my hands over the next few months because of the whole COVID-19 thing. My wife was layed off with no pay. so work on my house is going to come to a grinding halt in order to conserve funds. I am going to contact GitHub and see if there is a way they can add me to the EventGhost repository as owner. I will tell them to not remove any of it's existing members and they can check the authenticity of me stating I am the administrator of it by checking these forums. I have tried to contact cfull1 and also topix without any luck.

My gm plan is to contact GitHub and see if I am able to get onto the repository account. If I am not able to then I will have to create another repository. I do not really want to do that but I will if I have to.

I am going to draft an e-mail to GitHub today and see where I can get with it.
If you like the work I have been doing then feel free to Image

V_J
Experienced User
Posts: 237
Joined: Tue Mar 04, 2014 9:00 am

Re: Error opening options dialog

Post by V_J » Thu Apr 23, 2020 8:05 am

Can I ask what the current solution is?

For the record: On my EventGhost computer I have three locale installed, each with their own keyboard, but remote desktoping to the machine adds 2 more keyboards in one locale (most likely as remote desktop tries to match the keyboard without changing locale settings). The result of that is that I'm not sure of the current locale when I log in.... (unless I don't forget to set it on the login screen)

Regarding the automatic translation: I'm with Sem;colon. I use multiple locale settings for different reasons (mainly to switch keyboards as I use multiple languages that have special characters which are most easily accessible in that language's keyboard, but it also affects spell checking in some programs so that is why I change the whole locale), but I prefer the interface language of my apps to be in English. I always curse when an app decides to set its language according to the locale or keyboard (apps do the weirdest things), as it requires me to look for the option to change the language in some convoluted menu structure shown in a language I may not be very comfortable with. Basically, don't assume that the peoples locale is a language they are comfortable with. English with an easy to find menu entry to manually set the language causes - in my opinion - the least issues (though I would never change it from English). :D

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

Re: Error opening options dialog

Post by kgschlosser » Fri Apr 24, 2020 3:47 pm

ok let me break this down to you.


Locale = spoken language + location

This is a setting you have set in windows. If you have set your computer to have a locale of en_DE then you would have English language with German formatting. If there was an automatic translation It is not assuming anything. It is getting this information from what you have Windows set to for the specific user that logs in. You should be able to navigate through the menus without a problem as the menus should be in the same exact language that windows is using to display it's menus.

The reason why locales are such a pain in the ass is because of what other pieces of software have done. like Python and also the wxPython gui framework and also Windows.

Because of the enormity of possible choices for language_country pairings locals should only be handled using an ISO code for the locale. Windows has available to it pre defines LCID's these LCID's are what Python and also wxPython uses when setting the locale. This is incorrect to do. the reason why is that in Windows there are locales that have the exact same LCID. those are "virtual" LCID's they allow for non typical language_country pairings to be made. If a user has one of these pairings made then errors will happen when EG goes to start up. It has been stated by Microsoft that the using of an LCID to set a locale SHOULD NOT be done. but developers continue to use it. Python is a complete disaster when it comes to this because depending on what version of python you are using is going to change how you should set the locale when running on Windows. It can be en_US or English_United States or English_United States.cp1252 or en_Unites States.cp1252 or English_US.cp1252 or English_United States.UTF8

I have been working on a wrapper that handles this issue and solves most of the problems. I am going to have to fork EG and open up a new repository because I am not able to get ahold of the either of the people that have access to it. I am somewhat annoyed that they have both vanished without a trace and are not responding to any e-mails. There is nothing I can do about it really except open up another repository. I have fixes for these things I just need to get them added to the code and create a release. once I am able to get that done I am then going to crate an official release of 0.5 and move onto 1.0 and get the Python 3 update done.
If you like the work I have been doing then feel free to Image

V_J
Experienced User
Posts: 237
Joined: Tue Mar 04, 2014 9:00 am

Re: Error opening options dialog

Post by V_J » Sat Apr 25, 2020 4:01 am

But Windows display language is not part of the locale... I only have Windows in English (UK), but have locales en_UK, nl_BE, pl_PL and es_ES...
Anyway, I don't know how it is all done internally, but I know I'm often cursing at how Windows does some things :D

To get the options panel in Eventghost, should I add en_US?

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

Re: Error opening options dialog

Post by kgschlosser » Sat Apr 25, 2020 6:32 am

if you open up the file c:\Program Files (x86)\EventGhost\eg\Classes\OptionsDialog.py and search for this line

Code: Select all

        languageList = ["en_EN"]
change the en_EN to en_US save the changes and restart EG you should then be able to open the options dialog.


as far as this error is concerned

Code: Select all

Traceback (most recent call last) (0.5.0-rc6):
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\ConfigDialog.py", line 106, in Configure
treeItem.Configure(*args)
File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 80, in Configure
return self.executable.Configure(*args)
File "C:\Program Files (x86)\EventGhost\plugins\Timer\__init__.py", line 518, in Configure
loopCtrl = eg.SpinIntCtrl(panel, -1, loops, 0, size=(200,-1))
File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 50, 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 50, 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!
I am working on a solution to that problem. There is no "mismatch" occurring the error is happening because wxPython is using virtual LCID's as a way to identify a locale. and this is not the right way to do it. I have to finish up working on the GetInfo portion of wxLocale so it will query windows using the ISO locale instead of using the LCID.
If you like the work I have been doing then feel free to Image

V_J
Experienced User
Posts: 237
Joined: Tue Mar 04, 2014 9:00 am

Re: Error opening options dialog

Post by V_J » Sun Apr 26, 2020 1:14 pm

Thank! Editing the file did the trick. :)

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

Re: Error opening options dialog

Post by kgschlosser » Sun Apr 26, 2020 8:30 pm

I know it did. but there are still underlying problems that need attending to. This will at least allow the dialog to open up.
If you like the work I have been doing then feel free to Image

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

Re: Error opening options dialog

Post by kgschlosser » Sun Apr 26, 2020 8:33 pm

I am ironing out the code in the monkey patch of wxPython to get the locale to behave properly. But to throw a another wrench into the gears Python has it's own set of problems and those problems change based on the python version that is running. So I am trying to fix all of them at once so that I will not have to go back and fix this when we upgrade to python 3.6+

The problem with the SpinNumCtrl the error in the 2nd to last post from me is going to be solved with this as well.
If you like the work I have been doing then feel free to Image

Post Reply