From 0a9f5a058aa5f1ce627ca7d7d1c00ea9dfb48c9b Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 9 Dec 2010 19:18:19 +0100 Subject: [PATCH 1/3] major.minor version is enough for the grammar pickle. --- sphinx/pycode/pgen2/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/pycode/pgen2/driver.py b/sphinx/pycode/pgen2/driver.py index 39e347b79..5e6cf9a5b 100644 --- a/sphinx/pycode/pgen2/driver.py +++ b/sphinx/pycode/pgen2/driver.py @@ -120,7 +120,7 @@ def load_grammar(gt="Grammar.txt", gp=None, head, tail = os.path.splitext(gt) if tail == ".txt": tail = "" - gp = head + tail + ".".join(map(str, sys.version_info)) + ".pickle" + gp = head + tail + ".".join(map(str, sys.version_info[:2])) + ".pickle" if force or not _newer(gp, gt): logger.info("Generating grammar tables from %s", gt) g = pgen.generate_grammar(gt) From 9be3dc6cdafd5b4ec986f5382982584fde592a05 Mon Sep 17 00:00:00 2001 From: amenohi Date: Thu, 18 Nov 2010 16:44:41 +0900 Subject: [PATCH 2/3] Fix garbled HTML Help keywords. --- sphinx/builders/htmlhelp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py index 848068e57..dd6edfdda 100644 --- a/sphinx/builders/htmlhelp.py +++ b/sphinx/builders/htmlhelp.py @@ -258,7 +258,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder): def write_index(title, refs, subitems): def write_param(name, value): item = ' \n' % (name, value) - f.write(item.encode('ascii', 'xmlcharrefreplace')) + f.write(item.encode(self.encoding, 'xmlcharrefreplace')) title = cgi.escape(title) f.write('
  • \n') write_param('Keyword', title) From 0c7d972c81cb92088eff9bf7357639ef3908872d Mon Sep 17 00:00:00 2001 From: amenohi Date: Thu, 18 Nov 2010 17:18:15 +0900 Subject: [PATCH 3/3] On HTML Help, ignore 'html_output_encoding' and use langage encoding. --- sphinx/builders/html.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index f6cb802cc..3fb4557f7 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -690,7 +690,10 @@ class StandaloneHTMLBuilder(Builder): return uri ctx['pathto'] = pathto ctx['hasdoc'] = lambda name: name in self.env.all_docs - ctx['encoding'] = encoding = self.config.html_output_encoding + if self.name != 'htmlhelp': + ctx['encoding'] = encoding = self.config.html_output_encoding + else: + ctx['encoding'] = encoding = self.encoding ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw) self.add_sidebars(pagename, ctx) ctx.update(addctx)