Kodi Community Forum

Full Version: Frodo Beta 1 unicode bug in xbmc.Keyboard
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
#!/usr/bin/python
# -*- coding: utf8 -*-

import xbmc, xbmcaddon, xbmcplugin,xbmcgui
kb = xbmc.Keyboard(u"öäü", "Unicode Test", False)
kb.doModal()
if (kb.isConfirmed()):
    print "OK =" + kb.getText()
else:
    print "Cancel ="

Call the above code a few times (tested on Windows 7 64Bit) and press backspace.
Sometimes backspace works and sometimes not!
If it doesn't work then the print "OK... won't create a log entry.
Instead you'll get:
Quote:00:05:18 T:9788 DEBUG: CTextureCacheJob::GetImageHash - unable to stat url D:\Apps\XBMC Frodo Portable\portable_data\addons\plugin.video.test\icon.png
00:05:19 T:5124 DEBUG: CApplication:TonguerocessMouse: trying mouse action leftclick
00:05:19 T:5124 DEBUG: CGUIMediaWindow::GetDirectory (plugin://plugin.video.test/)
00:05:19 T:5124 DEBUG: ParentPath = [addons://sources/video/]
00:05:19 T:9788 DEBUG: XFILE::CPluginDirectory::StartScript - calling plugin UnicodeTest('plugin://plugin.video.test/','0','')
00:05:19 T:9788 INFO: initializing python engine.
00:05:19 T:9788 DEBUG: new python thread created. id=3
00:05:19 T:9788 DEBUG: XFILE::CPluginDirectory::WaitOnScriptResult - waiting on the UnicodeTest plugin...
00:05:19 T:9248 NOTICE: Thread XBPyThread start, auto delete: false
00:05:19 T:9248 DEBUG: Python thread: start processing
00:05:19 T:9248 NOTICE: -->Python Interpreter Initialized<--
00:05:19 T:9248 DEBUG: XBPyThread:Tonguerocess - The source file to load is D:\Apps\XBMC Frodo Portable\portable_data\addons\plugin.video.test\default.py
00:05:19 T:9248 DEBUG: XBPyThread:Tonguerocess - Setting the Python path to D:\Apps\XBMC Frodo Portable\portable_data\addons\plugin.video.test;D:\Apps\XBMC Frodo Portable\portable_data\addons\script.module.dialogaddonscan\lib;D:\Apps\XBMC Frodo Portable\addons\weather.wunderground\resources\lib\wunderground;D:\Apps\XBMC Frodo Portable\addons\script.module.simplejson\lib;D:\Apps\XBMC Frodo Portable\portable_data\addons\script.module.beautifulsoup\lib;D:\Apps\XBMC Frodo Portable\addons\script.module.pil\lib;D:\Apps\XBMC Frodo Portable\portable_data\addons\script.common.plugin.cache\lib;D:\Apps\XBMC Frodo Portable\portable_data\addons\script.module.xbmcswift2\lib;D:\Apps\XBMC Frodo Portable\addons\script.module.pysqlite\lib;D:\Apps\XBMC Frodo Portable\system\python\DLLs;D:\Apps\XBMC Frodo Portable\system\python\Lib;D:\Apps\XBMC Frodo Portable\python26.zip;D:\Apps\XBMC Frodo Portable\system\python\lib\plat-win;D:\Apps\XBMC Frodo Portable\system\python\lib\lib-tk;D:\Apps\XBMC Frodo Portable;D:\Apps\XBMC Frodo Portable\system\python;D:\Apps\XBMC Frodo Portable\system\python\lib\site-packages;
00:05:19 T:9248 DEBUG: XBPyThread:Tonguerocess - Entering source directory D:\Apps\XBMC Frodo Portable\portable_data\addons\plugin.video.test
00:05:19 T:9248 DEBUG: Instantiating addon using automatically obtained id of "plugin.video.test" dependent on version 1.0 of the xbmc.python api
00:05:19 T:5124 DEBUG: ------ Window Init (DialogBusy.xml) ------
00:05:19 T:5124 DEBUG: ------ Window Init (DialogKeyboard.xml) ------
00:05:19 T:5124 DEBUG: CAnnouncementManager - Announcement: OnInputRequested from xbmc
00:05:19 T:5124 DEBUG: GOT ANNOUNCEMENT, type: 128, from xbmc, message OnInputRequested
00:05:20 T:6632 DEBUG: CAESinkDirectSound:Big Grineinitialize: Cleaning up
00:05:21 T:5124 DEBUG: Keyboard: scancode: 0e, sym: 0008, unicode: 0008, modifier: 0
00:05:21 T:5124 DEBUG: CApplication::OnKey: backspace (f008) pressed, trying keyboard action 61448
00:05:21 T:5124 ERROR: XFILE::CDirectory::GetDirectory - Unhandled exception
00:05:21 T:5124 ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.test/
00:05:21 T:5124 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.test/) failed
00:05:21 T:5124 DEBUG: CGUIMediaWindow::GetDirectory (addons://sources/video/)
00:05:21 T:5124 DEBUG: ParentPath = []
00:05:21 T:8036 NOTICE: Thread Jobworker start, auto delete: true
00:05:21 T:9644 NOTICE: Thread Background Loader start, auto delete: false
00:05:21 T:5124 DEBUG: ------ Window Deinit (Pointer.xml) ------
00:05:21 T:9644 DEBUG: Thread Background Loader 9644 terminating
00:05:23 T:5124 DEBUG: Keyboard: scancode: 0e, sym: 0008, unicode: 0008, modifier: 0
00:05:23 T:5124 DEBUG: CApplication::OnKey: backspace (f008) pressed, trying keyboard action 61448
00:05:23 T:5124 ERROR: exception in CApplication::FrameMove()
00:05:24 T:5124 DEBUG: Keyboard: scancode: 0e, sym: 0008, unicode: 0008, modifier: 0
00:05:24 T:5124 DEBUG: CApplication::OnKey: backspace (f008) pressed, trying keyboard action 61448
00:05:24 T:5124 ERROR: exception in CApplication::FrameMove()
00:05:24 T:5124 DEBUG: Keyboard: scancode: 38, sym: 0134, unicode: 0000, modifier: 100
00:05:24 T:5124 DEBUG: CApplication::OnKey: alt-leftalt (4f0d4) pressed, trying keyboard action 61652

Please can anybody confirm this behavior/bug ?
full debug log via xbmclogs.com please and have a look if beside the log file a .dmp file was created. post that as well via dropbox or similar.
1) Debug log

2) First time add-on is started begins at line 349.
Backspace with keyboard dialog works as you can see in notice "OK =öä" in line 375 because the Ü is deleted.
But there are the first errors "ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.test/) failed"

3) Second time add-on is started begins at line 390.
In line 409 backspace is pressed immediately followed by error messages.
Pressing okay closes the dialog box but afterwards the working notification is shown and XBMC doesn't respond anymore.
Therefore killed with task manager.

When backspace is pressed. The underlying selection of the test add-on in the list view of MyVideoNav flashes onces.
Perhaps this is important to know.
bluetooth keyboard with low battery or covered with aloi?
No Fujitsu laptop keyboard.
Is it the wrong type of keyboard for Frodo?Laugh

Did anybody already use my test add-on to reproduce the bug?
if you're using visual studio can you set a breakpoint on the 'throw' of an exception. This line is particularly bothersome:

00:05:21 T:5124 ERROR: XFILE::CDirectory::GetDirectory - Unhandled exception

If you can, can you let us know what line it breaks on?
I'm sorry, but this is an approach I don't like.
Even if I could tell you the line then an official developer must look on it.

I do a part of the UAT for you, but you do the bug fixing.
For this I already gave you my rocket science python add-on.Wink
Seems to work now in release Frodo Beta 2 20121204