[env] fix pickled doctrees cache (#11939)

This commit is contained in:
Bénédikt Tran 2024-03-14 10:22:51 +01:00 committed by GitHub
parent 12d523efdc
commit f3087e8405
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -90,6 +90,9 @@ Bugs fixed
Patch by Bénédikt Tran. Patch by Bénédikt Tran.
* #12008: Fix case-sensitive lookup of ``std:label`` names in intersphinx inventory. * #12008: Fix case-sensitive lookup of ``std:label`` names in intersphinx inventory.
Patch by Michael Goerz. Patch by Michael Goerz.
* #11474: Fix doctrees caching causing files not be rebuilt in some cases,
e.g., when :confval:`numfig` is ``True``.
Patch by Bénédikt Tran.
Testing Testing
------- -------

View File

@ -265,6 +265,9 @@ class BuildEnvironment:
"""Obtains serializable data for pickling.""" """Obtains serializable data for pickling."""
__dict__ = self.__dict__.copy() __dict__ = self.__dict__.copy()
__dict__.update(app=None, domains={}, events=None) # clear unpickable attributes __dict__.update(app=None, domains={}, events=None) # clear unpickable attributes
# ensure that upon restoring the state, the most recent pickled files
# on the disk are used instead of those from a possibly outdated state
__dict__.update(_pickled_doctree_cache={})
return __dict__ return __dict__
def __setstate__(self, state: dict) -> None: def __setstate__(self, state: dict) -> None: