mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #3488: objects.inv has broken when `release
or
version
` contain return code
This commit is contained in:
parent
cdacabdab3
commit
3a3cec7a8e
2
CHANGES
2
CHANGES
@ -19,6 +19,8 @@ Bugs fixed
|
||||
to failed PDF build
|
||||
* EPUB file has duplicated ``nav.xhtml`` link in ``content.opf``
|
||||
except first time build
|
||||
* #3488: objects.inv has broken when ``release`` or ``version`` contain
|
||||
return code
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -849,13 +849,17 @@ class StandaloneHTMLBuilder(Builder):
|
||||
self.finish_tasks.add_task(self.dump_inventory)
|
||||
|
||||
def dump_inventory(self):
|
||||
def safe_name(string):
|
||||
return re.sub("\s+", " ", string)
|
||||
|
||||
self.info(bold('dumping object inventory... '), nonl=True)
|
||||
with open(path.join(self.outdir, INVENTORY_FILENAME), 'wb') as f:
|
||||
f.write((u'# Sphinx inventory version 2\n'
|
||||
u'# Project: %s\n'
|
||||
u'# Version: %s\n'
|
||||
u'# The remainder of this file is compressed using zlib.\n'
|
||||
% (self.config.project, self.config.version)).encode('utf-8'))
|
||||
% (safe_name(self.config.project),
|
||||
safe_name(self.config.version))).encode('utf-8'))
|
||||
compressor = zlib.compressobj(9)
|
||||
for domainname, domain in sorted(self.env.domains.items()):
|
||||
for name, dispname, type, docname, anchor, prio in \
|
||||
|
Loading…
Reference in New Issue
Block a user