https://bugzilla.redhat.com/show_bug.cgi?id=1256244
--- Comment #7 from Mike FABIAN <mfabian(a)redhat.com> ---
The problem happens no matter whether GObject introspection or
ctypes is used:
[mfabian@Fedora-Workstation-netinst-x86_6 ~]$ cat /etc/fedora-release
cat /etc/fedora-release
Fedora release 23 (Twenty Three)
[mfabian@Fedora-Workstation-netinst-x86_6 ~]$ cat transliterator-gi.py
cat transliterator-gi.py
import gi
gi.require_version('Translit', '1.0')
from gi.repository import Translit
trans = Translit.Transliterator.get('m17n', 'mr-itrans')
result = trans.transliterate('praviN')
print(result[0])
print(result[0].encode('utf-8'))
[mfabian@Fedora-Workstation-netinst-x86_6 ~]$ python3 transliterator-gi.py
python3 transliterator-gi.py
Segmentation fault (core dumped)
[mfabian@Fedora-Workstation-netinst-x86_6 ~]$ cat transliterator-ctypes.py
cat transliterator-ctypes.py
import ctypes
class Transliterator(object):
__libtranslit = ctypes.CDLL("libtranslit.so.0",
mode=ctypes.RTLD_GLOBAL)
__get = __libtranslit.translit_transliterator_get
__get.argtypes = [ctypes.c_char_p,
ctypes.c_char_p]
__get.restype = ctypes.c_void_p
__transliterate = __libtranslit.translit_transliterator_transliterate
__transliterate.argtypes = [ctypes.c_void_p,
ctypes.c_char_p,
ctypes.c_void_p]
__transliterate.restype = ctypes.c_char_p
def __init__(self, trans):
self.__trans = trans
@staticmethod
def get(backend, name):
return Transliterator(Transliterator.__get(
ctypes.c_char_p(backend.encode('utf-8')),
ctypes.c_char_p(name.encode('utf-8'))))
def transliterate(self, _input):
endpos = ctypes.c_ulong()
output = Transliterator.__transliterate(
self.__trans,
ctypes.c_char_p(_input.encode('utf-8')),
ctypes.byref(endpos))
return (output.decode('utf-8'), endpos.value)
trans = Transliterator.get('m17n', 'mr-itrans')
result = trans.transliterate('praviN')
print(result[0])
print(result[0].encode('utf-8'))
[mfabian@Fedora-Workstation-netinst-x86_6 ~]$ python3 transliterator-ctypes.py
<-netinst-x86_6 ~]$ python3 transliterator-ctypes.py
Segmentation fault (core dumped)
[mfabian@Fedora-Workstation-netinst-x86_6 ~]$
On Fedora 22, both GObject Introspection and ctypes work and produce
identical results.
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug
https://bugzilla.redhat.com/token.cgi?t=AsA9ETLb8Z&a=cc_unsubscribe
_______________________________________________
i18n-bugs mailing list
i18n-bugs(a)lists.fedoraproject.org
http://lists.fedoraproject.org/postorius/i18n-bugs@lists.fedoraproject.org