From c5d1f56f316232fa269244d112a8a72b8c6ca3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sat, 4 Jan 2020 17:09:20 +0100 Subject: [PATCH] [plugin_installer] ZipFile supports only posix paths This was a problem on Windows --- plugin_installer/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin_installer/utils.py b/plugin_installer/utils.py index afb25e4..fb51849 100644 --- a/plugin_installer/utils.py +++ b/plugin_installer/utils.py @@ -39,7 +39,8 @@ class PluginInfo: @classmethod def from_zip_file(cls, zip_file, manifest_path): config = ConfigParser() - with zip_file.open(str(manifest_path)) as manifest_file: + # ZipFile can only handle posix paths + with zip_file.open(manifest_path.as_posix()) as manifest_file: try: config.read_string(manifest_file.read().decode()) except configparser.Error as error: @@ -167,12 +168,13 @@ def is_manifest_valid(config): def load_icon_from_zip(zip_file, icon_path): + # ZipFile can only handle posix paths try: - zip_file.getinfo(str(icon_path)) + zip_file.getinfo(icon_path.as_posix()) except KeyError: return None - with zip_file.open(str(icon_path)) as png_file: + with zip_file.open(icon_path.as_posix()) as png_file: data = png_file.read() pixbuf = GdkPixbuf.PixbufLoader()