Skip to content

Commit cb66ac2

Browse files
vbrodskyVal Brodsky
authored andcommitted
Fix encoding for exporter (#1862)
1 parent 8276fc6 commit cb66ac2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
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
5-
import json
69
from typing import (
10+
TYPE_CHECKING,
11+
Any,
712
Callable,
813
Generic,
914
Iterator,
1015
Optional,
1116
Tuple,
1217
TypeVar,
1318
Union,
14-
TYPE_CHECKING,
15-
Any,
1619
)
1720

1821
import requests
19-
import tempfile
20-
import os
22+
from pydantic import BaseModel
2123

2224
from labelbox.schema.task import Task
2325
from labelbox.utils import _CamelCaseMixin
24-
from pydantic import BaseModel
2526

2627
if TYPE_CHECKING:
2728
from labelbox import Client
@@ -120,6 +121,7 @@ def _get_file_content(
120121
)
121122
response = requests.get(file_info.file, timeout=30)
122123
response.raise_for_status()
124+
response.encoding = "utf-8"
123125
assert (
124126
len(response.content)
125127
== file_info.offsets.end - file_info.offsets.start + 1

0 commit comments

Comments
 (0)