Skip to content

Commit a092ddc

Browse files
committed
declare encoding
1 parent b256201 commit a092ddc

7 files changed

Lines changed: 24 additions & 24 deletions

File tree

coverage.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ wvpy/util.py 4 0 100%
4040
---------------------------------------------
4141
TOTAL 653 199 70%
4242

43-
======================= 25 passed, 2 warnings in 38.12s ========================
43+
======================= 25 passed, 2 warnings in 39.36s ========================

pkg/build/lib/wvpy/jtools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ def convert_py_file_to_notebook(
174174
assert isinstance(ipynb_file, str)
175175
assert isinstance(use_black, bool)
176176
assert py_file != ipynb_file # prevent clobber
177-
with open(py_file, "r") as f:
177+
with open(py_file, "r", encoding="utf-8") as f:
178178
text = f.read()
179179
nb = convert_py_code_to_notebook(text, use_black=use_black)
180-
with open(ipynb_file, "w") as f:
180+
with open(ipynb_file, "w", encoding="utf-8") as f:
181181
nbformat.write(nb, f)
182182

183183

@@ -242,7 +242,7 @@ def convert_notebook_file_to_py(
242242
with open(ipynb_file, "rb") as f:
243243
nb = nbformat.read(f, as_version=4)
244244
py_source = convert_notebook_code_to_py(nb, use_black=use_black)
245-
with open(py_file, "w") as f:
245+
with open(py_file, "w", encoding="utf-8") as f:
246246
f.write(py_source)
247247

248248

@@ -336,7 +336,7 @@ def render_as_html(
336336
nb = nbformat.read(f, as_version=4)
337337
elif notebook_file_name.endswith(".py"):
338338
suffix = ".py"
339-
with open(notebook_file_name, "r") as f:
339+
with open(notebook_file_name, "r", encoding="utf-8") as f:
340340
text = f.read()
341341
nb = convert_py_code_to_notebook(text)
342342
else:
@@ -497,7 +497,7 @@ def render_as_html(self) -> None:
497497

498498
def render_py_txt(self) -> None:
499499
"""
500-
Render Python to text (without nbconver, nbformat Jupyter bindings)
500+
Render Python to text (without nbconvert, nbformat Jupyter bindings)
501501
"""
502502
path = self.sheet_name
503503
if isinstance(self.path_prefix, str) and (len(self.path_prefix) > 0):
1 Byte
Binary file not shown.

pkg/dist/wvpy-1.1.1.tar.gz

5 Bytes
Binary file not shown.

pkg/docs/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/docs/wvpy/jtools.html

Lines changed: 12 additions & 12 deletions
Large diffs are not rendered by default.

pkg/wvpy/jtools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ def convert_py_file_to_notebook(
174174
assert isinstance(ipynb_file, str)
175175
assert isinstance(use_black, bool)
176176
assert py_file != ipynb_file # prevent clobber
177-
with open(py_file, "r") as f:
177+
with open(py_file, "r", encoding="utf-8") as f:
178178
text = f.read()
179179
nb = convert_py_code_to_notebook(text, use_black=use_black)
180-
with open(ipynb_file, "w") as f:
180+
with open(ipynb_file, "w", encoding="utf-8") as f:
181181
nbformat.write(nb, f)
182182

183183

@@ -242,7 +242,7 @@ def convert_notebook_file_to_py(
242242
with open(ipynb_file, "rb") as f:
243243
nb = nbformat.read(f, as_version=4)
244244
py_source = convert_notebook_code_to_py(nb, use_black=use_black)
245-
with open(py_file, "w") as f:
245+
with open(py_file, "w", encoding="utf-8") as f:
246246
f.write(py_source)
247247

248248

@@ -336,7 +336,7 @@ def render_as_html(
336336
nb = nbformat.read(f, as_version=4)
337337
elif notebook_file_name.endswith(".py"):
338338
suffix = ".py"
339-
with open(notebook_file_name, "r") as f:
339+
with open(notebook_file_name, "r", encoding="utf-8") as f:
340340
text = f.read()
341341
nb = convert_py_code_to_notebook(text)
342342
else:
@@ -497,7 +497,7 @@ def render_as_html(self) -> None:
497497

498498
def render_py_txt(self) -> None:
499499
"""
500-
Render Python to text (without nbconver, nbformat Jupyter bindings)
500+
Render Python to text (without nbconvert, nbformat Jupyter bindings)
501501
"""
502502
path = self.sheet_name
503503
if isinstance(self.path_prefix, str) and (len(self.path_prefix) > 0):

0 commit comments

Comments
 (0)