From ff970f9d9d1110d13c0ec58d62d5d1b653118ae9 Mon Sep 17 00:00:00 2001 From: "thomas.grandjean" Date: Sat, 21 Oct 2023 18:50:20 +0200 Subject: [PATCH] Fix bug on rewriting files to utf8 --- cartiflette/download/layer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cartiflette/download/layer.py b/cartiflette/download/layer.py index bc07ae88..105066c3 100644 --- a/cartiflette/download/layer.py +++ b/cartiflette/download/layer.py @@ -186,5 +186,5 @@ def _gis_and_encoding_evaluation(self): f"{self} - encoding={encoding}, " "layer will be re-encoded to UTF8" ) - with open(file, "w", encoding="utf8"): - data.decode(encoding) + with open(file, "w", encoding="utf8") as f: + f.write(data.decode(encoding))