fix python3, it breaks almost all of the ibus-table* packages. OBS-URL: https://build.opensuse.org/request/show/242585 OBS-URL: https://build.opensuse.org/package/show/M17N/ibus-table?expand=0&rev=31
23 lines
1.0 KiB
Diff
23 lines
1.0 KiB
Diff
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))
|