Skip to content

Commit 9a12709

Browse files
authored
Fix encoding for exporter (#1862)
1 parent b0127cf commit 9a12709

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

libs/labelbox/src/labelbox/schema/export_task.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
import json
2+
import os
3+
import tempfile
4+
import warnings
15
from abc import ABC, abstractmethod
26
from dataclasses import dataclass
37
from enum import Enum
48
from functools import lru_cache
59
from io import TextIOWrapper
6-
import json
710
from pathlib import Path
811
from typing import (
12+
TYPE_CHECKING,
13+
Any,
914
Callable,
1015
Generic,
1116
Iterator,
@@ -14,19 +19,14 @@
1419
Tuple,
1520
TypeVar,
1621
Union,
17-
TYPE_CHECKING,
1822
overload,
19-
Any,
2023
)
2124

2225
import requests
23-
import warnings
24-
import tempfile
25-
import os
26+
from pydantic import BaseModel
2627

2728
from labelbox.schema.task import Task
2829
from labelbox.utils import _CamelCaseMixin
29-
from pydantic import BaseModel, Field, AliasChoices
3030

3131
if TYPE_CHECKING:
3232
from labelbox import Client
@@ -241,6 +241,7 @@ def _get_file_content(
241241
)
242242
response = requests.get(file_info.file, timeout=30)
243243
response.raise_for_status()
244+
response.encoding = "utf-8"
244245
assert (
245246
len(response.content)
246247
== file_info.offsets.end - file_info.offsets.start + 1

0 commit comments

Comments
 (0)