Modify ↓
Opened 19 years ago
Closed 19 years ago
#2329 closed defect (fixed)
plugins may fail to load on windows
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.9.1 |
Component: | general | Version: | 0.9 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
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 (0)
Change History (3)
comment:1 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 19 years ago
Patch applied in r2525.
cmlenz, I let you port this on 0.9-stable and close the ticket if you find the change OK.
comment:3 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ported to stable in r2532.
Note:
See TracTickets
for help on using tickets.
Yep, that's a better fix than what I did in r2471.