diff rhodecode/model/db.py @ 1401:b7563ad4e7ee beta

Unicode fixes, added safe_str method for global str() operations +better test sandboxing
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 30 Jun 2011 01:25:37 +0200
parents 0d7b56b97953
children 5875955def39
line wrap: on
line diff
--- a/rhodecode/model/db.py	Wed Jun 29 01:49:53 2011 +0200
+++ b/rhodecode/model/db.py	Thu Jun 30 01:25:37 2011 +0200
@@ -42,7 +42,7 @@
 from vcs.utils.lazy import LazyProperty
 from vcs.nodes import FileNode
 
-from rhodecode.lib import str2bool, json
+from rhodecode.lib import str2bool, json, safe_str
 from rhodecode.model.meta import Base, Session
 from rhodecode.model.caching_query import FromCache
 
@@ -479,7 +479,11 @@
             Session.add(inv)
             Session.commit()
 
-        return _c(self.repo_name)
+        # TODO: remove this trick when beaker 1.6 is released
+        # and have fixed this issue
+        rn = safe_str(self.repo_name)
+
+        return _c(rn)
 
     def __get_instance(self):
 
@@ -497,7 +501,8 @@
             return
 
         if alias == 'hg':
-            repo = backend(repo_full_path, create=False,
+
+            repo = backend(safe_str(repo_full_path), create=False,
                            baseui=self._ui)
             #skip hidden web repository
             if repo._get_hidden():