summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-11-04 08:52:17 +0100
committerGeorg Brandl <georg@python.org>2014-11-04 08:52:17 +0100
commit5180d8c3cb94fe5e83f969277696455354ccac8b (patch)
treea2fa4906936e6b858eb17772a4b8626cbdf7fb2e
parentfad7cf4945f3a5bd45cac9ff1633c47ac8b1eec1 (diff)
parentf887ae16257cdb0ef9d4dd89136e379dc85875fb (diff)
downloadsphinx-5180d8c3cb94fe5e83f969277696455354ccac8b.tar.gz
Merge with stable.
-rw-r--r--CHANGES2
-rw-r--r--EXAMPLES1
-rw-r--r--sphinx/search/ja.py5
3 files changed, 5 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 6a2da9e6..292dffa0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -190,6 +190,8 @@ Bugs fixed
develop builder extensions. Thanks to Takeshi Komiya.
* #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.
Documentation
-------------
diff --git a/EXAMPLES b/EXAMPLES
index 17143e92..32714779 100644
--- a/EXAMPLES
+++ b/EXAMPLES
@@ -51,6 +51,7 @@ Documentation using the default theme
* PyMQI: http://pythonhosted.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/
diff --git a/sphinx/search/ja.py b/sphinx/search/ja.py
index bc308b67..862645a8 100644
--- a/sphinx/search/ja.py
+++ b/sphinx/search/ja.py
@@ -48,7 +48,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):
@@ -85,7 +85,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:
@@ -263,7 +263,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: