summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--doc/builders.rst38
-rw-r--r--sphinx/quickstart.py8
-rw-r--r--sphinx/util/osutil.py10
4 files changed, 54 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 93001fa75..86c605fa7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -74,6 +74,10 @@ Bugs fixed
* C++, fix parsing of types prefixed with 'enum'.
* #2023: Dutch search support uses Danish stemming info
* C++, add support for user-defined literals.
+* On Py2 environment, conf.py that is generated by sphinx-quickstart should have u prefixed
+ config value for 'version' and 'release'.
+* #2102: On Windows + Py3, using ``|today|`` and non-ASCII date format will raise
+ UnicodeEncodeError.
Documentation
-------------
diff --git a/doc/builders.rst b/doc/builders.rst
index 4fbd5bae6..93e01e4b7 100644
--- a/doc/builders.rst
+++ b/doc/builders.rst
@@ -23,6 +23,8 @@ The builder's "name" must be given to the **-b** command-line option of
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. class:: DirectoryHTMLBuilder
@@ -36,6 +38,8 @@ The builder's "name" must be given to the **-b** command-line option of
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. versionadded:: 0.6
@@ -48,6 +52,8 @@ The builder's "name" must be given to the **-b** command-line option of
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. versionadded:: 1.0
@@ -61,6 +67,8 @@ The builder's "name" must be given to the **-b** command-line option of
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. module:: sphinx.builders.qthelp
@@ -72,6 +80,8 @@ The builder's "name" must be given to the **-b** command-line option of
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. _Qt help: http://qt-project.org/doc/qt-4.8/qthelp-framework.html
@@ -96,6 +106,8 @@ The builder's "name" must be given to the **-b** command-line option of
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. versionadded:: 1.3
@@ -109,6 +121,8 @@ The builder's "name" must be given to the **-b** command-line option of
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. module:: sphinx.builders.epub
@@ -122,6 +136,8 @@ The builder's "name" must be given to the **-b** command-line option of
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. module:: sphinx.builders.latex
@@ -145,6 +161,8 @@ The builder's "name" must be given to the **-b** command-line option of
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
Note that a direct PDF builder using ReportLab is available in `rst2pdf
@@ -162,6 +180,8 @@ for details.
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. versionadded:: 0.4
@@ -175,6 +195,8 @@ for details.
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. versionadded:: 1.0
@@ -196,6 +218,8 @@ for details.
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. versionadded:: 1.1
@@ -261,6 +285,8 @@ for details.
The old name ``web`` still works as well.
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
The file suffix is ``.fpickle``. The global context is called
@@ -276,6 +302,8 @@ for details.
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
The file suffix is ``.fjson``. The global context is called
@@ -293,6 +321,8 @@ for details.
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. versionadded:: 1.1
@@ -307,6 +337,8 @@ for details.
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. module:: sphinx.builders.linkcheck
@@ -318,6 +350,8 @@ for details.
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. module:: sphinx.builders.xml
@@ -329,6 +363,8 @@ for details.
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. versionadded:: 1.2
@@ -343,6 +379,8 @@ for details.
.. autoattribute:: name
+ .. autoattribute:: format
+
.. autoattribute:: supported_image_types
.. versionadded:: 1.2
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index c8c46fabf..1cfe715c5 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -127,9 +127,9 @@ author = u'%(author_str)s'
# built documents.
#
# The short X.Y version.
-version = '%(version_str)s'
+version = u'%(version_str)s'
# The full version, including alpha/beta/rc tags.
-release = '%(release_str)s'
+release = u'%(release_str)s'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -715,7 +715,7 @@ if "%%1" == "clean" (
REM Check if sphinx-build is available and fallback to Python version if any
-%%SPHINXBUILD%% 2> nul
+%%SPHINXBUILD%% 1>NUL 2>NUL
if errorlevel 9009 goto sphinx_python
goto sphinx_ok
@@ -978,7 +978,7 @@ set SPHINXPROJ=%(project_fn)s
if "%%1" == "" goto help
-%%SPHINXBUILD%% 2> nul
+%%SPHINXBUILD%% >NUL 2>NUL
if errorlevel 9009 (
\techo.
\techo.The 'sphinx-build' command was not found. Make sure you have Sphinx
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py
index 5bfbcabc4..a56da44fe 100644
--- a/sphinx/util/osutil.py
+++ b/sphinx/util/osutil.py
@@ -166,8 +166,14 @@ def ustrftime(format, *args):
# given by LC_TIME; if that is available, use it
enc = locale.getlocale(locale.LC_TIME)[1] or 'utf-8'
return time.strftime(text_type(format).encode(enc), *args).decode(enc)
- else:
- return time.strftime(format, *args)
+ else: # Py3
+ # On Windows, time.strftime() and Unicode characters will raise UnicodeEncodeError.
+ # http://bugs.python.org/issue8304
+ try:
+ return time.strftime(format, *args)
+ except UnicodeEncodeError:
+ r = time.strftime(format.encode('unicode-escape').decode(), *args)
+ return r.encode().decode('unicode-escape')
def safe_relpath(path, start=None):