File ibus-table-python3.patch of Package ibus-table

Index: ibus-table-1.8.5/engine/tabcreatedb.py
===================================================================
--- ibus-table-1.8.5.orig/engine/tabcreatedb.py
+++ ibus-table-1.8.5/engine/tabcreatedb.py
@@ -358,7 +358,7 @@ def main ():
         if _bz2p:
             extra_s = bz2.BZ2File ( opts.extra, "r" )
         else:
-            extra_s = file ( opts.extra, 'r' )
+            extra_s = open ( opts.extra, 'r', encoding="utf-8" )
         debug_print ('\tParsing extra words source file ')
         extraline = parse_extra (extra_s)
         debug_print ('\tPreparing extra words lines')
@@ -375,7 +375,7 @@ def main ():
             extra_phrases.update({"%s\t%s" %(x[0],x[1]):x})
         debug_print ( '\t  the len of extra_phrases is: %d' % len(extra_phrases) )
         # pop duplicated keys
-        for x in extra_phrases:
+        for x in list(extra_phrases):
             if x in orig_phrases:
                 extra_phrases.pop(x)
         debug_print( '\t  %d extra phrases will be added' % len(extra_phrases))
openSUSE Build Service is sponsored by