[Trac-tickets] [The Trac Project] #1592: Upgrade script to db version 11 fails on "macros_dir"

The Trac Project noreply at edgewall.com
Wed May 25 04:42:32 EDT 2005


#1592: Upgrade script to db version 11 fails on "macros_dir"
------------------------+---------------------------------------------------
       Id:  1592        |      Status:  new                     
Component:  trac-admin  |    Modified:  Wed May 25 03:42:31 2005
 Severity:  major       |   Milestone:                          
 Priority:  normal      |     Version:  devel                   
    Owner:  daniel      |    Reporter:  arnarb at oddi.is          
------------------------+---------------------------------------------------
 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)
 }}}

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/1592>
The Trac Project <>


More information about the Trac-Tickets mailing list