diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-05-26 20:55:26 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-05-26 20:55:26 +0900 |
| commit | 2578f47664361b1b4c48fa1c7c3d01ade53eb32f (patch) | |
| tree | e08c18e47ac5a82e5604d3053cfb056f4b37a8e9 /sphinx/websupport | |
| parent | 08cfcbc363d684510dff3b2ed628a88a0e4d729a (diff) | |
| parent | 2c351a1261a5eb414f0e03a4aa811ee798f79819 (diff) | |
| download | sphinx-git-2578f47664361b1b4c48fa1c7c3d01ade53eb32f.tar.gz | |
Merge branch 'stable'
Diffstat (limited to 'sphinx/websupport')
| -rw-r--r-- | sphinx/websupport/search/xapiansearch.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sphinx/websupport/search/xapiansearch.py b/sphinx/websupport/search/xapiansearch.py index ee9b33da7..1e43dcbe9 100644 --- a/sphinx/websupport/search/xapiansearch.py +++ b/sphinx/websupport/search/xapiansearch.py @@ -11,6 +11,8 @@ import xapian +from six import string_types + from sphinx.util.osutil import ensuredir from sphinx.websupport.search import BaseSearch @@ -73,7 +75,10 @@ class XapianSearch(BaseSearch): results = [] for m in matches: - context = self.extract_context(m.document.get_data()) + data = m.document.get_data() + if not isinstance(data, string_types): + data = data.decode("utf-8") + context = self.extract_context(data) results.append((m.document.get_value(self.DOC_PATH), m.document.get_value(self.DOC_TITLE), ''.join(context))) |
