Skip to content

Commit 6809fb4

Browse files
fix: force utf-8 for reading test files, check all open() calls.
1 parent 13b79f2 commit 6809fb4

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

screenplain/export/html.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,6 @@ def _tag(self, tag_name, classes=[]):
166166
return tag(self.out, tag_name, classes)
167167

168168

169-
def _read_file(filename):
170-
with open(path) as stream:
171-
return stream.read()
172-
173-
174169
def convert(screenplay, out, css_file=None, bare=False):
175170
"""Convert the screenplay into HTML, written to the file-like object `out`.
176171
@@ -191,7 +186,7 @@ def convert_full(screenplay, out, css_file):
191186
written to the file-like object `out`.
192187
193188
"""
194-
with open(css_file, 'r') as stream:
189+
with open(css_file, 'r', encoding='utf-8') as stream:
195190
css = stream.read()
196191
out.write(
197192
'<!DOCTYPE html>\n'

tests/files_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
def read_file(path):
23-
with open(path) as stream:
23+
with open(path, encoding="utf-8") as stream:
2424
return stream.read()
2525

2626

0 commit comments

Comments
 (0)