Bug 845798

Summary: translit table gives KeyError
Product: [Fedora] Fedora Reporter: Parag Nemade <pnemade>
Component: ibus-table-othersAssignee: Mike FABIAN <mfabian>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: daniil.ivanov, i18n-bugs, K9, mfabian, nav007, tfujiwar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ibus-table-1.4.99.20120907-3.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 854539 (view as bug list) Environment:
Last Closed: 2012-11-09 05:04:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 854539    
Attachments:
Description Flags
ibus-table-others-1.3.0.20100907-improve-translit.patch none

Description Parag Nemade 2012-08-05 06:03:40 UTC
Description of problem:
Though translit table is not failing build, it does throw a KeyError

ö is not in tab_dict
Traceback (most recent call last):
  File "/usr/share/ibus-table/engine/tabdict.py", line 62, in __init__
    self._key_id = tab_dict[xm_key]
KeyError: u'\xf6'
ä is not in tab_dict
Traceback (most recent call last):
  File "/usr/share/ibus-table/engine/tabdict.py", line 62, in __init__
    self._key_id = tab_dict[xm_key]
KeyError: u'\xe4'
ü is not in tab_dict
Traceback (most recent call last):
  File "/usr/share/ibus-table/engine/tabdict.py", line 62, in __init__
    self._key_id = tab_dict[xm_key]
KeyError: u'\xfc'


Version-Release number of selected component (if applicable):
ibus-table-others-1.3.0.20100907-6.fc15.noarch

How reproducible:
always

Steps to Reproduce:
1./bin/ibus-table-createdb  -n /usr/share/ibus-table/tables/translit.db -s translit.txt
2.
3.
  
Actual results:
gives KeyError

Expected results:
should not give KeyError

Additional info:

Comment 3 Mike FABIAN 2012-09-04 15:25:43 UTC
I tried with the latest master from

https://github.com/maxiaojun/ibus-table.git

which has the patch mentioned in comment#2

and applied the follwing additional patch to ibus-table:

$ cat ibus-table-1.3.9.20110827-uppercase-umlauts.patch
diff -ru ibus-table-1.3.9.20120904.orig/engine/tabdict.py ibus-table-1.3.9.20120904/engine/tabdict.py
--- ibus-table-1.3.9.20120904.orig/engine/tabdict.py    2012-09-03 16:51:59.000000000 +0200
+++ ibus-table-1.3.9.20120904/engine/tabdict.py 2012-09-04 14:50:32.186626109 +0200
@@ -54,7 +54,10 @@
     # for translit
     gen_uni('ä'):95,
     gen_uni('ö'):96,
-    gen_uni('ü'):97
+    gen_uni('ü'):97,
+    gen_uni('Ä'):98,
+    gen_uni('Ö'):99,
+    gen_uni('Ü'):100
     }
 
 tab_key_list = tab_dict.keys()

Comment 4 Mike FABIAN 2012-09-04 15:27:16 UTC
Created attachment 609731 [details]
ibus-table-others-1.3.0.20100907-improve-translit.patch

Then I added the attached patch to ibus-table-others.

Comment 5 Mike FABIAN 2012-09-04 15:30:26 UTC
After I did the stuff in comment#3 and comment#4, the translit table
in ibus-table-others builds without errors.

I can see that other additions I made to translit.txt are working,
for example I can type "YO" to get Ё, before my patch in comment#4 only "Yo"
inserted Ё, "YO" did not.

But the non-ASCII keys like äöüÄÖÜ still do *not* work.

Comment 6 Mike FABIAN 2012-09-05 07:09:23 UTC
This patch to ibus-table makes the äöüÄÖÜ in the translit table work:

$ cat ibus-table-1.3.9.20110827-enable-non-ascii.patch
diff -ru ibus-table-1.3.9.20120904.orig/engine/table.py ibus-table-1.3.9.20120904/engine/table.py
--- ibus-table-1.3.9.20120904.orig/engine/table.py      2012-09-03 16:51:59.000000000 +0200
+++ ibus-table-1.3.9.20120904/engine/table.py   2012-09-05 08:46:51.676913255 +0200
@@ -1377,8 +1377,8 @@
                 if ascii.isdigit (key.code):
                     self.commit_string (cond_letter_translate (unichr (key.code)))
                     return True
-            elif key.code > 127 and (not self._editor._py_mode):
-                return False
+            #elif key.code > 127 and (not self._editor._py_mode):
+            #    return False
 
         if key.code == keysyms.Escape:
             self.reset ()
ibus-table-1.3.9.20120904/engineだけに発見: table.py.~1~

Comment 7 Mike FABIAN 2012-09-05 07:19:14 UTC
Ah, Yuwei Yu already fixed it properly upstream yesterday:

https://github.com/acevery/ibus-table/commit/50692ab9599c3845bc9f29cb0516ee78b6b0eda0

Comment 8 Fedora Update System 2012-09-06 06:14:54 UTC
ibus-table-1.3.9.20110827-4.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/ibus-table-1.3.9.20110827-4.fc18

Comment 9 Fedora Update System 2012-09-06 06:16:51 UTC
ibus-table-1.3.9.20110827-3.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/ibus-table-1.3.9.20110827-3.fc17

Comment 10 Fedora Update System 2012-09-07 11:26:55 UTC
Package ibus-table-1.3.9.20110827-3.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ibus-table-1.3.9.20110827-3.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-13425/ibus-table-1.3.9.20110827-3.fc17
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2012-09-13 13:09:07 UTC
ibus-table-1.4.99.20120907-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/ibus-table-1.4.99.20120907-2.fc18

Comment 12 Parag Nemade 2012-11-09 05:04:07 UTC
This is already pushed to stable.

Comment 13 Fedora Update System 2012-11-12 08:02:07 UTC
ibus-table-1.4.99.20120907-3.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/ibus-table-1.4.99.20120907-3.fc17

Comment 14 Fedora Update System 2012-11-13 12:51:03 UTC
ibus-table-1.4.99.20121113-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/ibus-table-1.4.99.20121113-1.fc17

Comment 15 Fedora Update System 2012-11-28 11:54:27 UTC
ibus-table-1.4.99.20121113-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.