Ticket #2329 (closed defect: fixed)
plugins may fail to load on windows
| Reported by: | Geoff Reedy <gereedy@…> | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.9.1 |
| Component: | general | Version: | 0.9 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Plugins installed to a project's plugins directory may not be automatically enabled due to windows' case preserving yet case insensitive behavior.
trac.loader directly compares the location of each plugin's egg with the environment's plugin path without normalization, the following patch normalizes the paths before comparing them.
-
trac/loader.py
26 26 27 27 __all__ = ['load_components'] 28 28 29 def normalize_path(s): 30 return os.path.normcase(os.path.abspath(s)) 31 32 def paths_equal(path1, path2): 33 return normalize_path(path1) == normalize_path(path2) 34 29 35 def load_components(env): 30 36 31 37 loaded_components = [] … … 45 51 def enable_modules(egg_path, modules): 46 52 """Automatically enable any components provided by plugins loaded from 47 53 the environment plugins directory.""" 48 if os.path.dirname(egg_path) == os.path.realpath(plugins_dir):54 if paths_equal(os.path.dirname(egg_path), os.path.realpath(plugins_dir)): 49 55 for module in modules: 50 56 env.config.setdefault('components', module + '.*', 'enabled') 51 57
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


