Comments (7)
(by mwhudson)
Is this pydoctor from current trunk?
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
from pydoctor.
(by allo)
the problem is introduced by
http://git.otfbot.org/otfbot.git/commit/?id=3d66cac6201080875075726fb71fccaee3ada133
from pydoctor.
(by allo)
what's the status of this bug?
will it be fixed anytime soon?
from pydoctor.
(by mwhudson)
I understand the problem, at least to some extent.
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!
from pydoctor.
(by allo)
oh, thanks for the feedback on the issue.
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
Traceback (most recent call last):
File "/usr/bin/pydoctor", line 5, in
main(sys.argv[1:])
File "/usr/lib/pymodules/python2.6/pydoctor/driver.py", line 287, in main
writer.writeIndividualFiles(subjects, options.htmlfunctionpages)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 185, in writeIndividualFiles
self.writeIndividualFiles(sub.orderedcontents, functionpages)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 185, in writeIndividualFiles
self.writeIndividualFiles(sub.orderedcontents, functionpages)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 185, in writeIndividualFiles
self.writeIndividualFiles(sub.orderedcontents, functionpages)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 185, in writeIndividualFiles
self.writeIndividualFiles(sub.orderedcontents, functionpages)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 185, in writeIndividualFiles
self.writeIndividualFiles(sub.orderedcontents, functionpages)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 181, in writeIndividualFiles
html = self.getHTMLFor(sub)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 194, in getHTMLFor
d = fun(o)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 316, in html_TwistedClass
x += self.genChildren(cls.orderedcontents, link=link)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 370, in _genChildren
'doc': summaryDoc(obj)}
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 30, in summaryDoc
return doc2html(obj, doc)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 53, in g
r = _cache[args] = f(*args)
File "/usr/lib/pymodules/python2.6/pydoctor/html.py", line 84, in doc2html
crap = pdoc.to_html(_EpydocLinker(obj))
AttributeError: 'NoneType' object has no attribute 'to_html'
from pydoctor.
(by mwhudson)
The branch I've just linked to the report contains a failing test case which is the crux of the issue I think.
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.
from pydoctor.
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 None
values should become a thing of the past.
from pydoctor.
Related Issues (20)
- Fix the standard library smoke test
- Drop support for python 3.6 HOT 3
- Is this normal? HOT 3
- Be clear that exit code 2 means partial success HOT 3
- Intersphinx from local folder HOT 6
- Fix verbose mode
- Regression on in link not found warnings linenumbers
- ERROR collecting pydoctor/test/test_attrs.py with Python-3.12 HOT 3
- Including default values for Pydantic model attributes HOT 3
- Don't raise exceptions when offline HOT 1
- dev-doc: "pydoctor_primer" not documented HOT 6
- Missing test dependencies: hypothesis HOT 4
- Failing and undocumented test "test_pyval_repr.py::test_expressions_parens" HOT 3
- "tox -p all" not working HOT 3
- "tox -p all" to noise for extern contributors HOT 4
- Contribution docu: Code Style HOT 1
- Test docu: Missing docu about test_packags.py and processPackage()
- Build infrastructure: Run ReadTheDocs on every PR/commit? HOT 2
- Find an extensible manner to integrate templatewriter customizations
- How to break down (debug) " Cannot find link target for XYZ" errors? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydoctor.