Reviewers: ,


Please review this at http://codereview.tryton.org/816002/

Affected files:
  M trytond/ir/ui/view.py
  M trytond/tools/misc.py


Index: trytond/ir/ui/view.py
===================================================================

--- a/trytond/ir/ui/view.py
+++ b/trytond/ir/ui/view.py
@@ -1,6 +1,7 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 import os
+import sys
 import logging
 from lxml import etree
 from trytond.model import ModelView, ModelSQL, fields
@@ -100,7 +101,9 @@
         key = (cls.__name__, type_)
         rng = cls._get_rng_cache.get(key)
         if rng is None:
- rng_name = os.path.join(os.path.dirname(__file__), type_ + '.rng')
+            rng_name = os.path.join(os.path.dirname(
+                    unicode(__file__, sys.getfilesystemencoding())),
+                type_ + '.rng')
             rng = etree.fromstring(open(rng_name).read())
             cls._get_rng_cache.set(key, rng)
         return rng

Index: trytond/tools/misc.py
===================================================================

--- a/trytond/tools/misc.py
+++ b/trytond/tools/misc.py
@@ -78,7 +78,8 @@
 def file_open(name, mode="r", subdir='modules'):
     """Open a file from the root dir, using a subdir folder."""
     from trytond.modules import EGG_MODULES
-    root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+    root_path = os.path.dirname(os.path.dirname(os.path.abspath(
+                unicode(__file__, sys.getfilesystemencoding()))))

     egg_name = False
     if subdir == 'modules':



Reply via email to