Commit d5fa0938 authored by Eckhart Arnold's avatar Eckhart Arnold
Browse files

- utf-8 error corrected

parent 1422279c
......@@ -546,7 +546,7 @@ def recompile_grammar(ebnf_filename, force=False) -> bool:
messages = compile_on_disk(ebnf_filename)
if messages:
# print("Errors while compiling: " + ebnf_filename + '!')
with open(error_file_name, 'w', encoding="UTF-8") as f:
with open(error_file_name, 'w', encoding="utf-8") as f:
for e in messages:
f.write(str(e))
f.write('\n')
......
......@@ -33,13 +33,12 @@ import collections
import contextlib
import html
import os
from typing import List, Union
from DHParser.error import line_col
from DHParser.stringview import StringView
from DHParser.syntaxtree import Node, WHITESPACE_PTYPE
from DHParser.toolkit import is_filename, escape_control_characters, typing
from typing import List, Union
from DHParser.toolkit import is_filename, escape_control_characters
__all__ = ('log_dir',
'logging',
......@@ -88,7 +87,7 @@ def log_dir() -> str:
pass
info_file_name = os.path.join(dirname, 'info.txt')
if not os.path.exists(info_file_name):
with open(info_file_name, 'w') as f:
with open(info_file_name, 'w', encoding="utf-8") as f:
f.write("This directory has been created by DHParser to store log files from\n"
"parsing. ANY FILE IN THIS DIRECTORY CAN BE OVERWRITTEN! Therefore,\n"
"do not place any files here and do not bother editing files in this\n"
......
......@@ -81,7 +81,7 @@ def unit_from_configfile(config_filename):
m = RX_COMMENT.match(txt, pos)
return pos
with open(config_filename, 'r') as f:
with open(config_filename, 'r', encoding="utf-8") as f:
cfg = f.read()
cfg = cfg.replace('\t', ' ')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment