From 9bfe0e0e33defbae10a11fa3f4c6f376ba22117e Mon Sep 17 00:00:00 2001 From: rsashank Date: Wed, 5 Jun 2024 23:52:40 +0530 Subject: [PATCH] refactor/bugfix: helper: Normalize file path in process_media. This removes platform-dependence from download_media, and for now leaves more in process_media, which already had a platform-dependent test. This addresses a failing test in WSL environments in download_media, which is no longer dependent upon the platform. --- zulipterminal/helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zulipterminal/helper.py b/zulipterminal/helper.py index 76d0a0158d..a71d055b74 100644 --- a/zulipterminal/helper.py +++ b/zulipterminal/helper.py @@ -784,6 +784,7 @@ def process_media(controller: Any, link: str) -> None: controller.view.set_footer_text, "Downloading your media..." ) media_path = download_media(controller, link, show_download_status) + media_path = normalized_file_path(media_path) tool = "" # TODO: Add support for other platforms as well. @@ -825,7 +826,7 @@ def download_media( show_download_status() controller.report_success([" Downloaded ", ("bold", media_name)]) - return normalized_file_path(local_path) + return local_path @asynch