Opened 16 years ago
Closed 16 years ago
#8929 closed defect (fixed)
admin/plugins shows wrong information for plugin distribution
| Reported by: | Owned by: | Remy Blank | |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.12 |
| Component: | admin/web | Version: | 0.11.6 |
| Severity: | normal | Keywords: | patch |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Attached screenshot shows that Trac fails to load correct information about AccountManager plugin that is installed outside of environment plugin directory (see DebianBug #562963).
The reason is here: http://trac.edgewall.org/browser/branches/0.11-stable/trac/admin/web_ui.py?rev=8424#L597
If plugin module is installed globally, get_module_path() returns path to shared /site-packages/ instead to plugin .egg directory, so to find the exact distribution - we need to find root package for the module and request Distribution for that package explicitly.
I'll attach patch for in for 0.11-stable
Attachments (2)
Change History (11)
by , 16 years ago
| Attachment: | wrong_plugin.png added |
|---|
comment:2 by , 16 years ago
| Milestone: | 0.11.7 → 0.12 |
|---|---|
| Owner: | set to |
I'll test your patch. However, as I mentioned in comment:7:ticket:8916, this is not a critical issue and will therefore not be included in 0.11.7.
follow-up: 5 comment:4 by , 16 years ago
Ok, this only happens when plugins are installed "flat", i.e. with the --single-version-externally-managed install option. Checking your patch…
comment:5 by , 16 years ago
Replying to rblank:
Ok, this only happens when plugins are installed "flat", i.e. with the
--single-version-externally-managedinstall option.
Exactly. In Debian they are installed globally in some kind of site-packages/.
comment:6 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Unfortunately, the trac.plugins extension points are not a reliable way to assign files to plugins, as it is not necessary that all modules containing components be listed there. Trac itself doesn't list all modules either.
However, the SOURCES.txt file contains all source files, and can be used reliably. This was implemented in [9034] and seems to work for all types of installs (zipped egg, unzipped egg, "flat", single-file).
comment:7 by , 16 years ago
Are you sure that SOURCES.txt for "flat" and single-file imports works reliably? This file is only generated for Python eggs.
Unfortunately I can not test your solution on existing installations where I experience the problem unless it is ported to Trac 0.11, but I'll try to review as far as possible.
comment:8 by , 16 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
For some reason, I just got a case where top_level.txt cannot be found, despite its existing in the filesystem:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 495, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.6/site-packages/trac/web/main.py", line 227, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/lib/python2.6/site-packages/trac/about.py", line 66, in process_request
plugins = get_plugin_info(self.env)
File "/usr/lib/python2.6/site-packages/trac/loader.py", line 157, in get_plugin_info
dist = find_distribution(module)
File "/usr/lib/python2.6/site-packages/trac/loader.py", line 140, in find_distribution
sources = path_sources[path] = get_sources(path)
File "/usr/lib/python2.6/site-packages/trac/util/__init__.py", line 473, in get_sources
toplevels = dist.get_metadata('top_level.txt').splitlines()
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1477, in get_metadata
raise KeyError("No metadata except PKG-INFO is available")
KeyError: No metadata except PKG-INFO is available
To be investigated…
comment:9 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
This was due to some packages in my site-packages having only a single .egg-info file. With [9045], this case doesn't generate an internal server error anymore.




wrong information about AccountManager