diff --git a/trytond/ir/ui/view.py b/trytond/ir/ui/view.py index 45e6102af0..19c3d3da4f 100644 --- 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 @@ class View(ModelSQL, ModelView): 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 diff --git a/trytond/tools/misc.py b/trytond/tools/misc.py index 090c5a11f2..a632f7c974 100644 --- a/trytond/tools/misc.py +++ b/trytond/tools/misc.py @@ -78,7 +78,8 @@ def exec_command_pipe(name, *args): 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':