mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
* On Python3 environment, docutils.conf with 'source_link=true' in the general section cause type error. Closes #1531
This commit is contained in:
parent
d40c786538
commit
e984e381e8
2
CHANGES
2
CHANGES
@ -32,6 +32,8 @@ Bugs fixed
|
||||
a default parameter with an empty list `[]`. Thanks to Geert Jansen.
|
||||
* #1508: Non-ASCII filename raise exception on make singlehtml, latex, man,
|
||||
texinfo and changes.
|
||||
* #1531: On Python3 environment, docutils.conf with 'source_link=true' in the
|
||||
general section cause type error.
|
||||
|
||||
Release 1.2.2 (released Mar 2, 2014)
|
||||
====================================
|
||||
|
@ -40,6 +40,7 @@ from sphinx.util.nodes import clean_astext, make_refnode, WarningStream
|
||||
from sphinx.util.osutil import SEP, fs_encoding, find_catalog_files
|
||||
from sphinx.util.matching import compile_matchers
|
||||
from sphinx.util.pycompat import class_types
|
||||
from sphinx.util.compat import docutils_version
|
||||
from sphinx.util.websupport import is_commentable
|
||||
from sphinx.errors import SphinxError, ExtensionError
|
||||
from sphinx.locale import _
|
||||
@ -619,7 +620,10 @@ class BuildEnvironment:
|
||||
destination_class=NullOutput)
|
||||
pub.set_components(None, 'restructuredtext', None)
|
||||
pub.process_programmatic_settings(None, self.settings, None)
|
||||
pub.set_source(None, src_path.encode(fs_encoding))
|
||||
if docutils_version < (0, 8): #1531
|
||||
pub.set_source(None, src_path.encode(fs_encoding))
|
||||
else:
|
||||
pub.set_source(None, src_path)
|
||||
pub.set_destination(None, None)
|
||||
pub.publish()
|
||||
doctree = pub.document
|
||||
|
@ -14,7 +14,7 @@ import re
|
||||
from StringIO import StringIO
|
||||
from functools import wraps
|
||||
|
||||
from util import test_roots, TestApp
|
||||
from util import test_roots, TestApp, path, SkipTest
|
||||
|
||||
|
||||
html_warnfile = StringIO()
|
||||
@ -98,4 +98,31 @@ def test_man(app):
|
||||
@with_conf_app(buildername='texinfo', warning=html_warnfile)
|
||||
def test_texinfo(app):
|
||||
app.builder.build(['contents'])
|
||||
assert html_warnfile.getvalue() == ''
|
||||
|
||||
|
||||
@with_conf_app(buildername='html', srcdir='(empty)',
|
||||
docutilsconf='[general]\nsource_link=true\n')
|
||||
def test_docutils_source_link(app):
|
||||
srcdir = path(app.srcdir)
|
||||
(srcdir / 'conf.py').write_text('')
|
||||
(srcdir / 'contents.rst').write_text('')
|
||||
app.builder.build_all()
|
||||
|
||||
|
||||
@with_conf_app(buildername='html', srcdir='(empty)',
|
||||
docutilsconf='[general]\nsource_link=true\n')
|
||||
def test_docutils_source_link_with_nonascii_file(app):
|
||||
srcdir = path(app.srcdir)
|
||||
mb_name = u'\u65e5\u672c\u8a9e'
|
||||
try:
|
||||
(srcdir / (mb_name + '.txt')).write_text('')
|
||||
except UnicodeEncodeError:
|
||||
from path import FILESYSTEMENCODING
|
||||
raise SkipTest(
|
||||
'nonascii filename not supported on this filesystem encoding: '
|
||||
'%s', FILESYSTEMENCODING)
|
||||
|
||||
(srcdir / 'conf.py').write_text('')
|
||||
(srcdir / 'contents.rst').write_text('')
|
||||
|
||||
app.builder.build_all()
|
||||
|
Loading…
Reference in New Issue
Block a user