Changeset 5706

Show
Ignore:
Timestamp:
11/17/08 18:21:03 (2 months ago)
Author:
faide
Message:

Fixed error when the pot file already existed and we could not copy it using os.rename...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/turbogears/toolbox/admi18n/__init__.py

    r5704 r5706  
    288288        filename = os.path.join(locales, 'messages.pot') 
    289289        try: 
    290             os.rename(pot, filename) 
    291         except OSError, e: 
     290            shutil.copyfile(pot, filename) 
     291        except IOError, e: 
    292292            print e 
    293293 
  • branches/1.1/turbogears/toolbox/admi18n/pygettext.py

    r5704 r5706  
    779779        if options.outpath: 
    780780            options.outfile = os.path.join(options.outpath, options.outfile) 
    781         fp = open(options.outfile, 'wt') 
     781        # we want to truncate any existing file so w+ is the best flag mix 
     782        fp = open(options.outfile, 'w+') 
    782783        closep = 1 
    783784