Commits

Georg Brandl  committed 71c5924

Fix a traceback when removing files with globbed toctrees.

  • Participants
  • Parent commits 4da5d75

Comments (0)

Files changed (2)

 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.
 

File sphinx/environment.py

         # 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))
         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')