pydoctor icon indicating copy to clipboard operation
pydoctor copied to clipboard

Fix intersphinx name resolution

Open adiroiban opened this issue 7 years ago • 5 comments

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'

adiroiban avatar Aug 01 '16 12:08 adiroiban

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.

adiroiban avatar Aug 02 '16 10:08 adiroiban

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

adiroiban avatar Aug 02 '16 12:08 adiroiban

Ugh, this stuff is all so fiddly. Can we override expandName on Attribute to just forward directly to self.parent?

mwhudson avatar Aug 02 '16 23:08 mwhudson

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 :(

adiroiban avatar Aug 03 '16 08:08 adiroiban

We should check if this kind of errors also happens with latest pydoctor.

tristanlatr avatar Apr 06 '22 04:04 tristanlatr