Source

trac-ticketlinks / trac / env.py

Diff from to

trac/env.py

 from trac.util import copytree, create_file, get_pkginfo, makedirs
 from trac.util.compat import any
 from trac.util.concurrency import threading
-from trac.util.text import exception_to_unicode, printerr, printout
+from trac.util.text import exception_to_unicode, path_to_unicode, printerr, \
+                           printout
 from trac.util.translation import _, N_
 from trac.versioncontrol import RepositoryManager
 from trac.web.href import Href
     def _do_hotcopy(self, dest):
         if os.path.exists(dest):
             raise TracError(_("hotcopy can't overwrite existing '%(dest)s'",
-                              dest=dest))
+                              dest=path_to_unicode(dest)))
         import shutil
 
         # Bogus statement to lock the database while copying files
 
         try:
             printout(_('Hotcopying %(src)s to %(dst)s ...', 
-                       src=self.env.path, dst=dest))
+                       src=path_to_unicode(self.env.path),
+                       dst=path_to_unicode(dest)))
             db_str = self.env.config.get('trac', 'database')
             prefix, db_path = db_str.split(':', 1)
             if prefix == 'sqlite':
                     if src in err:
                         printerr('  %s' % err)
                     else:
-                        printerr("  %s: '%s'" % (err, src))
+                        printerr("  %s: '%s'" % (err, path_to_unicode(src)))
         finally:
             # Unlock database
             cnx.rollback()
         printout(_("Upgrade done.\n\n"
                    "You may want to upgrade the Trac documentation now by "
                    "running:\n\n  trac-admin %(path)s wiki upgrade",
-                   path=self.env.path))
+                   path=path_to_unicode(self.env.path)))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.