mirror of https://github.com/explosion/spaCy.git
encoding UTF8 (#6161)
This commit is contained in:
parent
3fa30a7f2d
commit
6a04e5adea
|
@ -114,6 +114,6 @@ def project_document(
|
|||
content = f"{before}{content}{after}"
|
||||
else:
|
||||
msg.warn("Replacing existing file")
|
||||
with output_file.open("w") as f:
|
||||
with output_file.open("w", encoding="utf8") as f:
|
||||
f.write(content)
|
||||
msg.good("Saved project documentation", output_file)
|
||||
|
|
|
@ -700,7 +700,7 @@ from pathlib import Path
|
|||
@spacy.registry.loggers("my_custom_logger.v1")
|
||||
def custom_logger(log_path):
|
||||
def setup_logger(nlp: "Language") -> Tuple[Callable, Callable]:
|
||||
with Path(log_path).open("w") as file_:
|
||||
with Path(log_path).open("w", encoding="utf8") as file_:
|
||||
file_.write("step\\t")
|
||||
file_.write("score\\t")
|
||||
for pipe in nlp.pipe_names:
|
||||
|
|
|
@ -1256,7 +1256,7 @@ def main(template_path, output=None, data_path=None):
|
|||
data_str = f"export const DATA = {data}"
|
||||
result = compiler.get_output()
|
||||
if output is not None:
|
||||
with output.open("w") as f:
|
||||
with output.open("w", encoding="utf8") as f:
|
||||
f.write(f"{header}\n{result}\n{data_str}")
|
||||
print(f"Updated {output.parts[-1]}")
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue