Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions burr/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,14 @@ def create_test_case(
if target_file_name:
# if it already exists, load it up and append to it
if os.path.exists(target_file_name):
with open(target_file_name, "r") as f:
with open(target_file_name, "r", encoding="utf-8") as f:
# assumes it's a list of test cases
current_testcases = json.load(f)
current_testcases.append(tc_json)
else:
current_testcases = [tc_json]
print(f"\nWriting data to file {target_file_name}")
with open(target_file_name, "w") as f:
with open(target_file_name, "w", encoding="utf-8") as f:
json.dump(current_testcases, f, indent=2)
else:
logger.info(json.dumps(tc_json, indent=2))
Expand Down
2 changes: 1 addition & 1 deletion burr/integrations/streamlit.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def load_state_from_log_file(jsonl_log_file: str, app: Application) -> AppState:
:return: AppState
"""
out = []
for i, line in enumerate(open(jsonl_log_file)):
for i, line in enumerate(open(jsonl_log_file, encoding="utf-8")):
json_line = json.loads(line)
record = Record(
state=json_line["state"],
Expand Down
2 changes: 1 addition & 1 deletion burr/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# and then load it for the test.
def load_test_cases(file_name: str) -> tuple:
"""Load test cases from a json file."""
with open(file_name, "r") as f:
with open(file_name, "r", encoding="utf-8") as f:
json_test_cases = json.load(f)
test_cases = [(tc.get("input_state"), tc.get("expected_state")) for tc in json_test_cases]
test_ids = [
Expand Down
2 changes: 1 addition & 1 deletion burr/tracking/server/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ async def version() -> dict:
ui_app.mount("/public", StaticFiles(directory=base_asset_directory, html=True), "/public")

# Read index.html once at startup
with open(os.path.join(base_asset_directory, "index.html")) as f:
with open(os.path.join(base_asset_directory, "index.html"), encoding="utf-8") as f:
_index_html_template = f.read()

@ui_app.get("/manifest.json")
Expand Down
Loading