#23525: admin/docs/filters|tags __file__ attribute errors for egg extensions
-------------------------------------+-------------------------------------
Reporter: welbornprod | Owner: nobody
Type: Bug | Status: new
Component: contrib.admindocs | Version: 1.7
Severity: Normal | Resolution:
Keywords: __file__ | Triage Stage: Accepted
AttributeError filters tags | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 0
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):
* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Django is attempting to find all possible modules, even those that aren't
imported yet, which is technically incompatible with Python's import
machinery (loaders and importers).
[https://docs.python.org/3/library/pkgutil.html#pkgutil.iter_modules
pkgutil.iter_modules] won't help. So there won't be a perfect solution.
That said, I would find it better to split the try/except in two parts:
1. attempt to compute `os.path.dirname(upath(mod.__file__))`, `continue`
if that fails,
2. attempt to list files within that directory, `continue` if that fails,
--
Ticket URL: <https://code.djangoproject.com/ticket/23525#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.a57318df6df6fb15888c3f40c9f26076%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.