From 22c0ffe06d77d3a5ea2eea9b5f57252e35c5f1cc Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Mon, 29 Jan 2024 20:03:59 +0000 Subject: Make .copy transparent Previously .copy read unicode, by reading bytes instead, it doesn't transform the input, and can be used to copy binary data without issues. --- ssg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssg/__init__.py b/ssg/__init__.py index ba945b8..c1c7d91 100644 --- a/ssg/__init__.py +++ b/ssg/__init__.py @@ -50,7 +50,7 @@ class Generator: def copy(self, dest: str, source: str | None = None) -> None: if source is None: source = dest - with open(source) as f: + with open(source, "rb") as f: self.write(dest, f.read()) def generate( -- cgit v1.2.3-54-g00ecf