Fix a traceback when removing files with globbed toctrees.

This commit is contained in:
Georg Brandl 2011-01-07 14:53:12 +01:00
parent 33647ec898
commit b75253dc82
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,8 @@
Release 1.0.7 (in development)
==============================
* Fix a traceback when removing files with globbed toctrees.
* If an autodoc object cannot be imported, always re-read the
document containing the directive on next build.

View File

@ -498,7 +498,8 @@ class BuildEnvironment:
# if files were added or removed, all documents with globbed toctrees
# must be reread
if added or removed:
changed.update(self.glob_toctrees)
# ... but not those that already were removed
changed.update(self.glob_toctrees & self.found_docs)
msg += '%s added, %s changed, %s removed' % (len(added), len(changed),
len(removed))
@ -630,6 +631,11 @@ class BuildEnvironment:
codecs.register_error('sphinx', self.warn_and_replace)
class SphinxSourceClass(FileInput):
def __init__(self_, *args, **kwds):
# don't call sys.exit() on IOErrors
kwds['handle_io_errors'] = False
FileInput.__init__(self_, *args, **kwds)
def decode(self_, data):
return data.decode(self_.encoding, 'sphinx')