Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
badw-it
DHParser
Commits
d5fa0938
Commit
d5fa0938
authored
Feb 19, 2018
by
Eckhart Arnold
Browse files
- utf-8 error corrected
parent
1422279c
Changes
3
Hide whitespace changes
Inline
Side-by-side
DHParser/dsl.py
View file @
d5fa0938
...
...
@@ -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
'
)
...
...
DHParser/log.py
View file @
d5fa0938
...
...
@@ -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
"
...
...
DHParser/testing.py
View file @
d5fa0938
...
...
@@ -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
'
,
' '
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment