diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2024-01-29 20:03:59 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2024-01-29 20:03:59 +0000 |
commit | 22c0ffe06d77d3a5ea2eea9b5f57252e35c5f1cc (patch) | |
tree | 4f0ae055dd8a87c401dc75e90582a0d466d5d854 | |
parent | 8c9ee2c18f8b0156db27a97d2c241a30fdd05365 (diff) | |
download | ssg-22c0ffe06d77d3a5ea2eea9b5f57252e35c5f1cc.tar.gz ssg-22c0ffe06d77d3a5ea2eea9b5f57252e35c5f1cc.tar.xz ssg-22c0ffe06d77d3a5ea2eea9b5f57252e35c5f1cc.zip |
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.
-rw-r--r-- | ssg/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
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( |