From: funilrys Date: Sun, 7 Jun 2020 16:28:32 +0000 (+0200) Subject: Fix location issue under windows. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=5798b17132d0b4cf7390ecc8ffe0569e4a8dd517;p=stevenblack-hosts.git Fix location issue under windows. This patch fix https://github.com/StevenBlack/hosts/issues/1166#issuecomment-634686875 --- diff --git a/updateHostsFile.py b/updateHostsFile.py index 5df7978e1..7a486ab2d 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -1210,6 +1210,11 @@ def update_readme_data(readme_file, **readme_updates): readme_data = json.load(f) readme_data[extensions_key] = generation_data + for denomination, data in readme_data.copy().items(): + if "location" in data and data["location"] and "\\" in data["location"]: + # Windows compatibility: #1166 + readme_data[denomination]["location"] = data["location"].replace("\\", "/") + with open(readme_file, "w") as f: json.dump(readme_data, f)