From b84a84fc5e7d39e6ef696c347e661edc691ef900 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Mon, 19 Oct 2015 16:23:29 +0300 Subject: [PATCH] Revert "Utils.py: decode sys.argv & os.getenv using system encoding" This reverts commit def80ed6b419ff121a6284fd9ea402af3cf95386. --- youtube_dl_gui/optionsmanager.py | 2 +- youtube_dl_gui/utils.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/youtube_dl_gui/optionsmanager.py b/youtube_dl_gui/optionsmanager.py index c5c3f55..a2d97c1 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 = {} + self.options = dict() self.load_default() self.load_from_file() diff --git a/youtube_dl_gui/utils.py b/youtube_dl_gui/utils.py index 65e0d5d..b34259d 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').decode(get_encoding(), 'ignore') + path = os.getenv('APPDATA') 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].decode(get_encoding(), 'ignore')), DIR_NAME), + os.path.join(absolute_path(sys.argv[0]), 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].decode(get_encoding(), 'ignore')), 'icons'), + os.path.join(absolute_path(sys.argv[0]), 'icons'), os.path.join(get_lib_path(), 'icons'), ] @@ -231,7 +231,6 @@ 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')