From 5c5272c4aba57b56290039d5b765e5ff07dea6b3 Mon Sep 17 00:00:00 2001
From: Takeshi KOMIYA
Date: Thu, 27 Apr 2017 21:44:46 +0900
Subject: [PATCH 1/2] Fix #3657: EPUB builder crashes if document startswith
genindex exists
---
CHANGES | 1 +
sphinx/builders/epub.py | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/CHANGES b/CHANGES
index b38d91c4d..344e65fff 100644
--- a/CHANGES
+++ b/CHANGES
@@ -16,6 +16,7 @@ Bugs fixed
* #3614: Sphinx crashes with requests-2.5.0
* #3618: autodoc crashes with tupled arguments
* #3664: No space after the bullet in items of a latex list produced by Sphinx
+* #3657: EPUB builder crashes if document startswith genindex exists
Testing
--------
diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py
index 152401447..ea90642bc 100644
--- a/sphinx/builders/epub.py
+++ b/sphinx/builders/epub.py
@@ -500,7 +500,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
This method is overwritten for genindex pages in order to fix href link
attributes.
"""
- if pagename.startswith('genindex'):
+ if pagename.startswith('genindex') and 'genindexentries' in addctx:
if not self.use_index:
return
self.fix_genindex(addctx['genindexentries'])
From bd66ffc1fafd0e83f07e7143f99bc4023bc72508 Mon Sep 17 00:00:00 2001
From: Takeshi KOMIYA
Date: Fri, 28 Apr 2017 01:19:01 +0900
Subject: [PATCH 2/2] Fix the unreleased version number is shown (refs: #3678,
#3027)
---
doc/_templates/indexsidebar.html | 2 +-
doc/conf.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html
index bfa0139cb..6359921a5 100644
--- a/doc/_templates/indexsidebar.html
+++ b/doc/_templates/indexsidebar.html
@@ -3,7 +3,7 @@
{%trans%}project{%endtrans%}
Download
-{% if version.endswith('a0') %}
+{% if version.endswith('+') %}
{%trans%}This documentation is for version {{ version }}, which is
not released yet.{%endtrans%}
{%trans%}You can use it from the
diff --git a/doc/conf.py b/doc/conf.py
index 95d14ec46..6817af12a 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -16,7 +16,7 @@ exclude_patterns = ['_build']
project = 'Sphinx'
copyright = '2007-2017, Georg Brandl and the Sphinx team'
-version = sphinx.__released__
+version = sphinx.__display_version__
release = version
show_authors = True