Fix #2407: building docs crash if document includes large data image URIs

This commit is contained in:
Takeshi KOMIYA
2016-04-16 15:04:32 +09:00
parent 21ee53df2d
commit 73166b241d
2 changed files with 6 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ Bugs fixed
* #2370: the equations are slightly misaligned in LaTeX writer
* #1817, #2077: suppress pep8 warnings on conf.py generated by sphinx-quickstart
* #2407: building docs crash if document includes large data image URIs
Release 1.4.1 (released Apr 12, 2016)

View File

@@ -907,7 +907,11 @@ class BuildEnvironment:
# The special key ? is set for nonlocal URIs.
node['candidates'] = candidates = {}
imguri = node['uri']
if imguri.find('://') != -1:
if imguri.startswith('data:'):
self.warn_node('image data URI found. some builders might not support', node)
candidates['?'] = imguri
continue
elif imguri.find('://') != -1:
self.warn_node('nonlocal image URI found: %s' % imguri, node)
candidates['?'] = imguri
continue