Closed timothydijamco closed 3 years ago
I believe the cause is the use of ==
in UninitializedGlobalVariableMixin.should_suppress_value_header
(introduced in #8500):
def should_suppress_value_header(self) -> bool:
return (self.object == UNINITIALIZED_ATTR or
super().should_suppress_value_header())
I think ==
can be changed to is
, which is how UninitializedInstanceAttributeMixin.should_suppress_value_header
is implemented:
def should_suppress_value_header(self) -> bool:
return (self.object is UNINITIALIZED_ATTR or
super().should_suppress_value_header())
Thank you for reporting. Indeed, this must be a bug!
thanks @tk0miya!
This is specific to 3.4.0
Autosummary may fail on a global variable whose value is an object with an
__eq__
implementation that raises an error.Example
For example, let's say I have a module that looks like this:
foo
__eq__
behavior is strict, and may raise an errorWhen running Sphinx, autosummary will fail.
(This code example is a little contrived but hopefully it illustrates well enough—it's a very simplified version of our actual use case)
To Reproduce I have a minimal repro here: https://github.com/timothydijamco/sphinx-eq-bug-repro
Running the below will hit the error if using Sphinx 3.4.0 (but not with Sphinx 3.3.1).
Expected behavior Sphinx should finish building successfully (it builds OK when using 3.3.1).
Environment info