Ticket #1592 (closed defect: fixed)
Upgrade script to db version 11 fails on "macros_dir"
| Reported by: | arnarb@… | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.9 |
| Component: | admin/console | Version: | devel |
| Severity: | major | Keywords: | |
| Cc: |
Description
When upgrading directly from db version 8 to 13, the upgrade fails on source:trunk/trac/upgrades/db11.py#1723 with the following error:
Upgrade failed: 'module' object has no attribute '__default_macros_dir_dir__'
This is because default_dir is called with the string "macros_dir" instead of just "macros" (default_dir adds "_dir").
After fixing this, another error emerges:
Upgrade failed: global name 'macros_dir' is not defined
The whole patch for fixing both errors follows
Index: db11.py
===================================================================
--- db11.py (revision 1725)
+++ db11.py (working copy)
@@ -33,10 +33,10 @@
# Copy the new default wiki macros over to the environment
from trac.config import default_dir
- for f in os.listdir(default_dir('macros_dir')):
+ for f in os.listdir(default_dir('macros')):
if not f.endswith('.py'):
continue
- src = os.path.join(macros_dir, f)
+ src = os.path.join(default_dir('macros'), f)
dst = os.path.join(env.path, 'wiki-macros', f)
if not os.path.isfile(dst):
shutil.copy2(src, dst)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


