pydoctor
pydoctor copied to clipboard
Fix intersphinx name resolution
Somehow the name resolution find the wrong name
Here is an error
twisted.web._http2.H2Connection:65 invalid ref to 'priority.PriorityTree' resolved as 'PriorityTree'
twisted.web._http2.H2Connection.priority:0 invalid ref to 'priority.PriorityTree' resolved as 'PriorityTree'
somehow, instead of looking for priority.PriorityTree
the link is searched for 'PriorityTree'
Most probably this regression was introduced here https://github.com/twisted/pydoctor/pull/113 it looks like in some cased fullerID
is failing to get the right id.
So,
we have this
class H2Connection(Protocol, TimeoutMixin):
"""
@ivar priority: A HTTP/2 priority tree used to ensure that responses are
prioritised appropriately.
@type priority: L{priority.PriorityTree}
"""
pydoctor.model.Documentable.expandName will think that the referred L{priority.PriorityTree}
is H2Connection.priority.PriorityTree
since the parent of PriorityTree
is priority
which is the same name as the ivar
Ugh, this stuff is all so fiddly. Can we override expandName on Attribute to just forward directly to self.parent?
Well, we can shortcut the attribute, but the issue is still there as the class is also failing to resolve the name.
twisted.web._http2.H2Connection:65 invalid ref to 'priority.PriorityTree' resolved as 'PriorityTree'
The ugly part for me is that this code has no unit tests so I am using the twisted codebase to check changes...and this is slow
I have created a separate ticket for expandName https://github.com/twisted/pydoctor/issues/125
I have submitted an PR with an ugly hack to fix this https://github.com/twisted/pydoctor/pull/126 as I have no other idea and I don't have more time to spend debugging this code :(
We should check if this kind of errors also happens with latest pydoctor.