diff --git a/youtube_dl_gui/optionsmanager.py b/youtube_dl_gui/optionsmanager.py index a2d97c1..c5c3f55 100644 --- a/youtube_dl_gui/optionsmanager.py +++ b/youtube_dl_gui/optionsmanager.py @@ -47,7 +47,7 @@ class OptionsManager(object): def __init__(self, config_path): self.config_path = config_path self.settings_file = os.path.join(config_path, self.SETTINGS_FILENAME) - self.options = dict() + self.options = {} self.load_default() self.load_from_file() diff --git a/youtube_dl_gui/utils.py b/youtube_dl_gui/utils.py index b34259d..65e0d5d 100644 --- a/youtube_dl_gui/utils.py +++ b/youtube_dl_gui/utils.py @@ -87,7 +87,7 @@ def get_config_path(): """ if os.name == 'nt': - path = os.getenv('APPDATA') + path = os.getenv('APPDATA').decode(get_encoding(), 'ignore') else: path = os.path.join(os.path.expanduser('~'), '.config') @@ -190,7 +190,7 @@ def get_locale_file(): DIR_NAME = 'locale' SEARCH_DIRS = [ - os.path.join(absolute_path(sys.argv[0]), DIR_NAME), + os.path.join(absolute_path(sys.argv[0].decode(get_encoding(), 'ignore')), DIR_NAME), os.path.join(get_lib_path(), DIR_NAME), os.path.join('/usr', 'share', __appname__.lower(), DIR_NAME) ] @@ -223,7 +223,7 @@ def get_icon_file(): ICONS_LIST = [ICON_NAME % size for size in SIZES] search_dirs = [ - os.path.join(absolute_path(sys.argv[0]), 'icons'), + os.path.join(absolute_path(sys.argv[0].decode(get_encoding(), 'ignore')), 'icons'), os.path.join(get_lib_path(), 'icons'), ] @@ -231,6 +231,7 @@ def get_icon_file(): path = os.getenv('XDG_DATA_DIRS') if path is not None: + path = path.decode(get_encoding(), 'ignore') for xdg_path in path.split(':'): xdg_path = os.path.join(xdg_path, 'icons', 'hicolor')