Skip to content
Open
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
10 changes: 5 additions & 5 deletions burr/tracking/server/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ async def _load_project_annotations(self, project_id: str):
annotations_path = self._get_annotation_path(project_id)
annotations = []
if os.path.exists(annotations_path):
async with aiofiles.open(annotations_path) as f:
async with aiofiles.open(annotations_path, encoding="utf-8") as f:
for line in await f.readlines():
annotations.append(AnnotationOut.parse_raw(line))
return annotations
Expand Down Expand Up @@ -348,7 +348,7 @@ async def create_annotation(
**annotation.dict(),
)
annotations_path = self._get_annotation_path(project_id)
async with aiofiles.open(annotations_path, "a") as f:
async with aiofiles.open(annotations_path, "a", encoding="utf-8") as f:
await f.write(annotation_out.json() + "\n")
return annotation_out

Expand Down Expand Up @@ -381,7 +381,7 @@ async def update_annotation(
detail=f"Annotation: {annotation_id} from project: {project_id} not found",
)
annotations_path = self._get_annotation_path(project_id)
async with aiofiles.open(annotations_path, "w") as f:
async with aiofiles.open(annotations_path, "w", encoding="utf-8") as f:
for a in all_annotations:
await f.write(a.json() + "\n")
return annotation_out
Expand All @@ -407,7 +407,7 @@ async def get_annotations(
if not os.path.exists(annotation_path):
return []
annotations = []
async with aiofiles.open(annotation_path) as f:
async with aiofiles.open(annotation_path, encoding="utf-8") as f:
for line in await f.readlines():
parsed = AnnotationOut.parse_raw(line)
if (
Expand Down Expand Up @@ -530,7 +530,7 @@ async def get_application_logs(
steps = Step.from_logs(lines)
children = []
if os.path.exists(children_file):
async with aiofiles.open(children_file) as f:
async with aiofiles.open(children_file, encoding="utf-8") as f:
str_children = await f.readlines()
children = [
ChildApplicationModel.parse_obj(json.loads(item)) for item in str_children
Expand Down
Loading