-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pydoctor throws AttributeError #11
Comments
(by mwhudson) Can you poke around using pydoctor --pdb and try to see what code is triggering the problem. I imagine it could be something like: import name class name: pass class subclass(name): pass |
(by allo) |
(by allo) |
(by mwhudson) The basic problem is that I assumed Python was more consistent than it is :-) The way names in import statements is resolved is somewhat different to how names in general are resolved, in particular when a package init defines a name that collides with a module. I'll get it fixed I guess, but it might take a while, I'm afraid. Knowing you care helps motivate me! |
(by allo) i tried a bit, the problem is the init.py in the package pluginSupport. Delete it, and it works. you see it in the linked git commit. there seems to be a problem, that both the package and a file have the name pluginSupport. if i move pluginSupport.py to plSupport.py, i get an error in the html-generation, not in the subclasses place. another thing i tried (without understand much of your code) is "if o:" -> 'if o and hasattr(o, "subclasses"):'. this also moves the exception to another place. the error with plSupport.py instead of pluginSupport.py: writing html to doc/api/ using pydoctor.html.SystemWriter |
(by mwhudson) It's also a bug that pydoctor blows up in the way it does, if it misinterprets what's going on that's one thing, but it shouldn't blow up like this. I'm not sure what the real fix for this is. It probably is the thing I mentioned first -- the lookup path for import statements and python expressions are not quite the same. That might be quite a large change though, and it might be possible to bodge it more simply. Not sure if that would be a good idea though. |
Since the code changed significantly in the last 10 years, I'm going to assume this issue has been fixed at some point. Therefore I'm closing this report. I do agree that pydoctor should never crash, no matter how complex the code it's analyzing, so if something similar happens again, please open a new issue. We're gradually adopting mypy now, so unexpected |
Imported from Launchpad using lp2gh.
The text was updated successfully, but these errors were encountered: