mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #1807: Sphinx crashes in japanese indexing in some systems.
Modified to specify the C type, if directly using the libmecab.
This commit is contained in:
parent
24c42817ed
commit
d0bc66da58
1
CHANGES
1
CHANGES
@ -39,6 +39,7 @@ Bugs fixed
|
||||
* #1580: Fix paragraphs in longtable don't work in Latex output
|
||||
* #1366: Fix centered image not centered in latex
|
||||
* #1860: Fix man page using ``:samp:`` with braces - font doesn't reset
|
||||
* #1610 Sphinx crashes in japanese indexing in some systems.
|
||||
|
||||
Release 1.3.3 (released Dec 2, 2015)
|
||||
====================================
|
||||
|
@ -85,10 +85,15 @@ class MecabBinder(object):
|
||||
dict = options.get('dict')
|
||||
if dict:
|
||||
param += ' -d %s' % dict
|
||||
|
||||
fs_enc = sys.getfilesystemencoding() or sys.getdefaultencoding()
|
||||
|
||||
self.ctypes_libmecab = ctypes.CDLL(libpath)
|
||||
self.ctypes_libmecab.mecab_new2.argtypes = (ctypes.c_char_p,)
|
||||
self.ctypes_libmecab.mecab_new2.restype = ctypes.c_void_p
|
||||
self.ctypes_libmecab.mecab_sparse_tostr.argtypes = (ctypes.c_void_p, ctypes.c_char_p)
|
||||
self.ctypes_libmecab.mecab_sparse_tostr.restype = ctypes.c_char_p
|
||||
self.ctypes_mecab = self.ctypes_libmecab.mecab_new2(param)
|
||||
self.ctypes_mecab = ctypes.c_void_p(self.ctypes_libmecab.mecab_new2(param.encode(fs_enc)))
|
||||
|
||||
def __del__(self):
|
||||
if self.ctypes_libmecab:
|
||||
|
Loading…
Reference in New Issue
Block a user