From f7a0acfa0a2c30a3201366b155cebfdd9f9dbdf4 Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Tue, 28 Oct 2014 21:24:21 +0900 Subject: add a example. --- EXAMPLES | 1 + 1 file changed, 1 insertion(+) diff --git a/EXAMPLES b/EXAMPLES index cc4c4de8..cc85a1f1 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -50,6 +50,7 @@ Documentation using the default theme * PyMQI: http://packages.python.org/pymqi/ * PyPubSub: http://pubsub.sourceforge.net/ * pyrticle: http://documen.tician.de/pyrticle/ +* pySPACE: http://pyspace.github.io/pyspace/ * Python: http://docs.python.org/ * python-apt: http://apt.alioth.debian.org/python-apt-doc/ * PyUblas: http://documen.tician.de/pyublas/ -- cgit v1.2.1 From f887ae16257cdb0ef9d4dd89136e379dc85875fb Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Wed, 29 Oct 2014 01:08:47 +0900 Subject: Fix #1610: Sphinx cause AttributeError when MeCab search option is enabled and python-mecab is not installed. --- CHANGES | 2 ++ sphinx/search/ja.py | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 24bef95f..a3d8a079 100644 --- a/CHANGES +++ b/CHANGES @@ -22,6 +22,8 @@ Bugs fixed a toctree was replaced with wrong title and link. * #1584: Point to master doc in HTML "top" link. * #1585: Autosummary of modules broken in Sphinx-1.2.3. +* #1610: Sphinx cause AttributeError when MeCab search option is enabled and + python-mecab is not installed. Release 1.2.3 (released Sep 1, 2014) diff --git a/sphinx/search/ja.py b/sphinx/search/ja.py index d5a7b4af..1f8398dd 100644 --- a/sphinx/search/ja.py +++ b/sphinx/search/ja.py @@ -46,7 +46,7 @@ class MecabBinder(object): result = self.native.parse(input2) else: result = self.ctypes_libmecab.mecab_sparse_tostr( - self.ctypes_mecab, input) + self.ctypes_mecab, input.encode(self.dict_encode)) return result.decode(self.dict_encode).split(' ') def init_native(self, options): @@ -83,7 +83,7 @@ class MecabBinder(object): self.ctypes_libmecab = ctypes.CDLL(libpath) self.ctypes_libmecab.mecab_sparse_tostr.restype = ctypes.c_char_p - self.ctypes_mecab = self.libmecab.mecab_new2(param) + self.ctypes_mecab = self.ctypes_libmecab.mecab_new2(param) def __del__(self): if self.ctypes_libmecab: @@ -260,7 +260,6 @@ class SearchJapanese(SearchLanguage): if type not in ('mecab', 'default'): raise ValueError(("Japanese tokenizer's type should be 'mecab'" " or 'default'")) - self.libmecab = None if type == 'mecab': self.splitter = MecabBinder(options) else: -- cgit v1.2.1