Skip to content

Commit

Permalink
fix: correct path separator issue in extract_source_from_url function…
Browse files Browse the repository at this point in the history
… for Windows compatibility (#280)
  • Loading branch information
areebahmeddd authored Nov 4, 2024
1 parent d844fe4 commit 385fbdb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openfoodfacts/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 385fbdb

Please sign in to comment.