Skip to content

Update export_task.py #1991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions libs/labelbox/src/labelbox/schema/export_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def read(self) -> Iterator[Tuple[_MetadataFileInfo, str]]:
if not self._retrieval_strategy:
raise ValueError("retrieval strategy not set")
# create a buffer
with tempfile.NamedTemporaryFile(mode="w+", delete=False) as temp_file:
with tempfile.NamedTemporaryFile(mode="w+", delete=False, encoding="utf-8") as temp_file:
result = self._retrieval_strategy.get_next_chunk()
while result:
_, raw_data = result
Expand All @@ -275,7 +275,7 @@ def read(self) -> Iterator[Tuple[_MetadataFileInfo, str]]:
temp_file.write(raw_data)
result = self._retrieval_strategy.get_next_chunk()
# read buffer
with open(temp_file.name, "r") as temp_file_reopened:
with open(temp_file.name, "r", encoding="utf-8") as temp_file_reopened:
for idx, line in enumerate(temp_file_reopened):
yield (
_MetadataFileInfo(
Expand Down