Skip to content

Commit

Permalink
used utf-8 encoding for opening .js scripts in the html_renderer func…
Browse files Browse the repository at this point in the history
…tionality of several environments (#320)
  • Loading branch information
ches-001 authored Dec 11, 2024
1 parent ecd9670 commit d1da130
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion kaggle_environments/envs/chess/chess.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,5 @@ def renderer(state, env):

def html_renderer():
jspath = path.abspath(path.join(path.dirname(__file__), "chess.js"))
with open(jspath) as g:
with open(jspath, encoding="utf-8") as g:
return g.read()
2 changes: 1 addition & 1 deletion kaggle_environments/envs/connectx/connectx.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,5 @@ def print_row(values, delim="|"):

def html_renderer():
jspath = path.abspath(path.join(dirpath, "connectx.js"))
with open(jspath) as f:
with open(jspath, encoding="utf-8") as f:
return f.read()
2 changes: 1 addition & 1 deletion kaggle_environments/envs/halite/halite.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,5 +259,5 @@ def renderer(state, env):

def html_renderer():
js_path = path.abspath(path.join(dir_path, "halite.js"))
with open(js_path) as js_file:
with open(js_path, encoding="utf-8") as js_file:
return js_file.read()
2 changes: 1 addition & 1 deletion kaggle_environments/envs/hungry_geese/hungry_geese.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,5 +326,5 @@ def renderer(state, env):

def html_renderer():
jspath = path.abspath(path.join(dirpath, "hungry_geese.js"))
with open(jspath) as f:
with open(jspath, encoding="utf-8") as f:
return f.read()
2 changes: 1 addition & 1 deletion kaggle_environments/envs/kore_fleets/kore_fleets.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,5 +507,5 @@ def renderer(state, env):

def html_renderer():
js_path = path.abspath(path.join(dir_path, "kore_fleets.js"))
with open(js_path) as js_file:
with open(js_path, encoding="utf-8") as js_file:
return js_file.read()
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def renderer(state, env):

def html_renderer():
jspath = path.abspath(path.join(path.dirname(__file__), "llm_20_questions.js"))
with open(jspath) as f:
with open(jspath, encoding="utf-8") as f:
return f.read()


Expand Down
2 changes: 1 addition & 1 deletion kaggle_environments/envs/tictactoe/tictactoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ def print_pos(pos):

def html_renderer():
jspath = path.abspath(path.join(path.dirname(__file__), "tictactoe.js"))
with open(jspath) as f:
with open(jspath, encoding="utf-8") as f:
return f.read()

0 comments on commit d1da130

Please sign in to comment.