[FIXED] UnicodeDecodeError: 'ascii' codec can't decode ...

Found a bug in EventGhost? Report it here.
Post Reply
Maxime
Posts: 12
Joined: Tue Mar 20, 2007 6:43 am
Location: Reims, France
Contact:

[FIXED] UnicodeDecodeError: 'ascii' codec can't decode ...

Post by Maxime » Fri Jun 15, 2007 5:26 am

Hi,

Since I have the latest nightly builds (currently, 995), EventGhost sometimes (often) reports these errors:

Traceback (most recent call last) (995):
File "C:\Program Files\EventGhost\eg\EventGhostEvent.py", line 150, in Execute
File "C:\Program Files\EventGhost\eg\Init.py", line 524, in RunProgram
File "C:\Program Files\EventGhost\eg\TreeItems\ActionItem.py", line 259, in Execute
File "C:\Program Files\EventGhost\eg\Init.py", line 558, in PrintError
File "C:\Program Files\EventGhost\eg\Log.py", line 116, in DoPrint
File "C:\Program Files\EventGhost\eg\Log.py", line 104, in Write
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 12: ordinal not in range(128)

For any action I have: launching an application, modifying volume... it blocks without doing the action.
It seems that it doesn't occur on each session. Moreover, if I close and restart EG, some errors disappear for some actions, and some remain (EG is launched automatically on startup).

IIRC, the problems are not present in 0.3.5c, but I'm not sure of that (I remember that I reverted to 0.3.5 and re-updated it to 0.3.6 because I also had problems with it). I'll keep 0.3.5 in my startup menu, see if the problems occur on next session, and keep you informed on the results.

Until then, you can download my XML file here: http://maxime.abbey.free.fr/eventghost.xml

In case the errors would come from this file ;)

Cheers,
Maxime

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster » Fri Jun 15, 2007 4:34 pm

0.3.6 has another handling of Unicode characters. That's why you unlikely will have these errors in 0.3.5.

To find the source of the problem, it would be helpful if you could copy a bigger part of the log the next time they happen, so I can see which actions have triggered the problem.

From what I can see so far, this error is not the source in the first degree. Something else has triggered a more or less expected error (e.g. the target application is not running) and the plugin wanted to show it in the log. But then some Unicode decoding broke and triggered another error.

Could also be a fault in the French language file (that wasn't updated for a long time). Do you use this translation?
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

Maxime
Posts: 12
Joined: Tue Mar 20, 2007 6:43 am
Location: Reims, France
Contact:

Post by Maxime » Fri Jun 15, 2007 5:34 pm

Bitmonster wrote:0.3.6 has another handling of Unicode characters. That's why you unlikely will have these errors in 0.3.5.
OK :)

I thought about reverting back to 0.3.5, but it'd not have been helpful for you to fix errors in 0.3.6, so :lol:
Bitmonster wrote: To find the source of the problem, it would be helpful if you could copy a bigger part of the log the next time they happen, so I can see which actions have triggered the problem.
No problem.

I copied all the log into a text file which you'll find here: http://maxime.abbey.free.fr/eventghost.log

Sorry for the lack of colors, I don't know if there's any way to save the log from within the application, so I pasted it into my text editor after copying it to the clipboard.
Bitmonster wrote: From what I can see so far, this error is not the source in the first degree. Something else has triggered a more or less expected error (e.g. the target application is not running) and the plugin wanted to show it in the log. But then some Unicode decoding broke and triggered another error.
Should be a pretty accurate analysis, as these errors only occur on Windows or session startup. If I close and restart EG after boot time, the errors disappear.
Bitmonster wrote: Could also be a fault in the French language file (that wasn't updated for a long time). Do you use this translation?
Hmmm... I don't think so.

Before rebooting in order to get a more complete log, I switched to English and the errors are still here.

And, if you test your software with your German translation, I guess that you're also able to detect bugs related to special or accentuated characters 8)

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster » Fri Jun 15, 2007 5:55 pm

Maxime wrote:Sorry for the lack of colors, I don't know if there's any way to save the log from within the application, so I pasted it into my text editor after copying it to the clipboard.
Colours don't matter. I can see the errors quite well.

But this time something else went wrong. And it is a really severe error:
The System plugin didn't started at all and that is why all volume controls and application start-ups fail. It seems to be related to the problem we had some time ago here:
http://www.eventghost.org/forum/viewtopic.php?t=285
Maxime wrote: Hmmm... I don't think so.

Before rebooting in order to get a more complete log, I switched to English and the errors are still here.

And, if you test your software with your German translation, I guess that you're also able to detect bugs related to special or accentuated characters 8)
Well, this time there is no UnicodeError, but we might see the real error now. I have to simulate this with the French translation. Possibly we again see the UnicodeError then.

Yes, the German translation also uses Unicode characters, but the translation file has gone through many changes. Since the French file is unchanged for long, it is possible that some old latin-1 codes cause the trouble, that I have converted in the other files but not in the French one.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

Maxime
Posts: 12
Joined: Tue Mar 20, 2007 6:43 am
Location: Reims, France
Contact:

Post by Maxime » Fri Jun 15, 2007 6:31 pm

Bitmonster wrote:Colours don't matter. I can see the errors quite well.
Okay :)
Bitmonster wrote: But this time something else went wrong. And it is a really severe error:
The System plugin didn't started at all and that is why all volume controls and application start-ups fail. It seems to be related to the problem we had some time ago here:
http://www.eventghost.org/forum/viewtopic.php?t=285
Exactly... somewhat forgot about that thread... that I made :lol:
But, this time, restarting EG seems to fix the problem, while it didn't seem to work when I reported this previous (same?) bug.
Bitmonster wrote: Well, this time there is no UnicodeError, but we might see the real error now. I have to simulate this with the French translation. Possibly we again see the UnicodeError then.
Maybe the title of the topic is not really accurate then?
Bitmonster wrote: Yes, the German translation also uses Unicode characters, but the translation file has gone through many changes. Since the French file is unchanged for long, it is possible that some old latin-1 codes cause the trouble, that I have converted in the other files but not in the French one.
Okay :)

In case you'll need help to re-translate some English strings to French, I can contribute, provided that I have enough time to do that ;)

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster » Fri Jun 15, 2007 8:27 pm

I think I will have to write some debug code to find out what makes your system so different, that the System plugin couldn't start. I hope tomorrow I have time to write a version you could try.

Could you write something about the PC you use? Is it a dual-core machine and/or does it run Win64?
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster » Fri Jun 15, 2007 8:58 pm

I've made a small hack (998), that should make waiting for the moment we can fix this problem completely a bit more convenient. The first error for the System plugin will be shown as before, but the plugin should not interrupt its start-up then, so EG should be usable. I also converted the French language file, so I hope we will not see so much UnicodeDecodeErrors in the future.

Now we only have to find out, why this "SystemError: WAIT_TIMEOUT for HookThread" is happening on your system.

Would be nice, if someone could update the French translation a bit, as there is missing much currently and EG looks a bit odd if only a half of the menus are translated.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

Maxime
Posts: 12
Joined: Tue Mar 20, 2007 6:43 am
Location: Reims, France
Contact:

Post by Maxime » Sat Jun 16, 2007 6:37 am

Bitmonster wrote:Could you write something about the PC you use? Is it a dual-core machine and/or does it run Win64?
My config is 3 years and a half old: 3 GHz Northwood P4, 1,5 GB DDR400, 7600 GT on dual-screen (19" CRT, 1400x1050@85 and 17" LCD, 1280x1024@60), 32-bit Windows XP SP2, Medion X10-compatible remote control, Chicony WUR0108 wireless keyboard (both used in EventGhost) and QWare optical mouse. If you need more details, let me know ;)
Bitmonster wrote:I've made a small hack (998), that should make waiting for the moment we can fix this problem completely a bit more convenient. The first error for the System plugin will be shown as before, but the plugin should not interrupt its start-up then, so EG should be usable. I also converted the French language file, so I hope we will not see so much UnicodeDecodeErrors in the future.

Now we only have to find out, why this "SystemError: WAIT_TIMEOUT for HookThread" is happening on your system.
Okay... but I saw that you uploaded 999 as well, should I try this one instead?
Bitmonster wrote:Would be nice, if someone could update the French translation a bit, as there is missing much currently and EG looks a bit odd if only a half of the menus are translated.
If there are only a few strings missing, I can do it. I would not have the time to update hundred of messages, but if there are only a few dozens of untranslated lines... no problem ;)

Maxime
Posts: 12
Joined: Tue Mar 20, 2007 6:43 am
Location: Reims, France
Contact:

Post by Maxime » Sat Jun 16, 2007 6:59 am

Hmmm... interesting: http://maxime.abbey.free.fr/eventghost.999.log

This time, with build 999 and French translation file, a "No X10 receiver found" message appears. Of course, the receiver is here (connected to a USB hub), maybe it can't be detected too quickly on startup... and now, I remember that Girder (which I used before EG) also displayed a "no X10 found" message box on startup.

However, the remote successfully works with EG, even after this message (and without restarting the application). The keyboard works as well, so they don't seem to be blocked anymore.

I'll restart Windows once again to confirm that the problem doesn't show up anymore, and to confirm that EG does not prevent Windows from logging off, related to the previous bug I reported.

(BTW: thanks for the "Hide the main window instead of closing it" option... I was missing that and was ready to ask it to you! ;))

Maxime
Posts: 12
Joined: Tue Mar 20, 2007 6:43 am
Location: Reims, France
Contact:

Post by Maxime » Sat Jun 16, 2007 7:26 am

Okay, I rebooted leaving the "Log only assignated and activated events" option unchecked, and I obtained some additional errors:

Code: Select all

Traceback (most recent call last) (999):
  File "C:\Program Files\EventGhost\eg\ActionThread.py", line 49, in StartSession
  File "C:\Program Files\EventGhost\eg\PluginTools.py", line 277, in OpenPlugin
  File "C:\Program Files\EventGhost\eg\PluginTools.py", line 235, in GetPluginInfo
  File "ntpath.pyc", line 91, in join
error: (1702, 'WTSRegisterSessionNotification', 'Handle de liaison non valide.')
Can't find action: Window.SendKeys(u'{Up}')
Can't find action: Window.SendKeys(u'{Down}')
Can't find action: Window.SendKeys(u'{Right}')
Can't find action: Window.SendKeys(u'{Left}')
Can't find action: Window.SendKeys(u'{Enter}')
Can't find action: Window.SendKeys(u'{Esc}')
Can't find action: Window.SendKeys(u'{Alt+F4}')
Can't find action: Window.SendKeys(u'{Tab}')
Can't find action: Window.SendKeys(u'{Shift+Tab}')
Can't find action: Window.SendKeys(u'+')
Can't find action: Window.SendKeys(u'-')
Can't find action: Window.SendKeys(u'{Win}')
Can't find action: Window.SendKeys(u'{Space}')
Can't find action: Window.SendKeys(u'{Pause}')
Can't find action: Window.SendKeys(u'{Alt+Enter}')
Démarrage automatique
Greffon: Keyboard
Greffon: X10: Medion
Error starting plugin: X10 Remote
No X10 receiver found!
Maybe related to the fact that EG can't start the X10 plugin on startup...
But these errors do not prevent the remote or the keyboard from working correctly afterwards. So I guess that this "Unicode" problem is fixed...

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster » Sat Jun 16, 2007 3:33 pm

Hmm, that's interesting. This time the Window plugin was killed. :)

The X10 plugin shows an error, because again a thread that is expected to start up hasn't started its work within 5 seconds. This is similar to the HookThread problem. So it seems that your system is heavily blocked at the start up of EG. But actually your PC is faster than my current machine. Might be worth a try to start EG with a higher priority. You could try it by modifying the (autostart) shortcut this way:

C:\WINDOWS\system32\cmd.exe /c start "EventGhost" /HIGH "C:\Program Files\EventGhost\EventGhost.exe"
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

Maxime
Posts: 12
Joined: Tue Mar 20, 2007 6:43 am
Location: Reims, France
Contact:

Post by Maxime » Sun Jun 17, 2007 5:35 am

I modified the shortcut, but it did not prevent errors from raising.
But, as long as they don't block the software, it doesn't really matters :)

And, yes, my system is quite overbloated. I haven't reinstalled Windows since I got it 3 1/2 years ago (:lol:), and, although it still perfectly works, startup time is several minutes long.

I have a lot of peripherals and drivers... and, especially, a Sound Blaster Live! soundcard on which I load almost 250 MB of SoundFonts on Windows bootup. What I can say is that it slows down the startup process quite a bit :lol:

Oh well... this new build of EG can handle errors without being blocked like before, that's all I was asking for ;)

Thank you.

BTW:

I noticed that 0.3.6 branch seems to encounter difficulties when installed in a path with accentuated characters, eg. "C:\Bureau\Outils\Matériel\Télécommande\EventGhost", while 0.3.5 was doing just fine. And the setup reports the exact same error when I install it in this folder :

Traceback (most recent call last):
File "EventGhost.pyw", line 34, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 20: ordinal not in range(128)"

It does not prevent it from being installed (all files are copied in the folder), but EG raises this error when being launched, and closes immediately.

I think it has something to do with this bug, but I don't know if I should create another thread for it...

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster » Sun Jun 17, 2007 2:47 pm

Ah, another fine UnicodeError. :)

This one will take some more time to fix. There seem to be multiple places, where it breaks if a Unicode install path is used.

Back to the ThreadTimouts:
I will add an option to the config.py file, where you can set a default timeout for all threads. This might help to tune EG to your system. I will let you know, when it is implemented.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster » Tue Jun 19, 2007 6:48 pm

I have uploaded 0.3.6.1024.
It should fix the UnicodeError if installed with Unicode path.

After the first run, you will find an option "defaultThreadStartTimeout" in the config.py file (inside EG's application data folder). Try to increase this value (defaults to 5 seconds) till you get no more timeout errors. It will not influence the "WAIT_TIMEOUT for HookThread" error. This one needs some more work.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

Maxime
Posts: 12
Joined: Tue Mar 20, 2007 6:43 am
Location: Reims, France
Contact:

Post by Maxime » Wed Jun 20, 2007 6:22 am

I confirm that this build has fixed the installation path bug. I've been able to install it in C:\Bureau\Outils\Matériel\Télécommande\EventGhost.

And, this time, I did not get any error at Windows startup, even without changing anything in the config file. I'll see if some errors arise at next bootup.

Thanks for already fixing all bugs which prevented me from using 0.3.6 without hassle :)

Post Reply