From 385fbdb9c2e27751c6494edead38b153103ce507 Mon Sep 17 00:00:00 2001 From: Areeb Ahmed <135235925+areebahmeddd@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:34:10 +0530 Subject: [PATCH] fix: correct path separator issue in extract_source_from_url function for Windows compatibility (#280) --- openfoodfacts/images.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openfoodfacts/images.py b/openfoodfacts/images.py index 1b59cea..7f2a03d 100644 --- a/openfoodfacts/images.py +++ b/openfoodfacts/images.py @@ -192,7 +192,8 @@ def extract_source_from_url(url: str) -> str: if url_path.endswith(".json"): url_path = str(Path(url_path).with_suffix(".jpg")) - return url_path + # normalize windows path to unix path + return url_path.replace("\\", "/") def download_image(