Skip to content

Fix encoding for exporter #1862

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

Merged
merged 1 commit into from
Oct 10, 2024
Merged
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
15 changes: 8 additions & 7 deletions libs/labelbox/src/labelbox/schema/export_task.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import json
import os
import tempfile
import warnings
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
from functools import lru_cache
from io import TextIOWrapper
import json
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
Callable,
Generic,
Iterator,
Expand All @@ -14,19 +19,14 @@
Tuple,
TypeVar,
Union,
TYPE_CHECKING,
overload,
Any,
)

import requests
import warnings
import tempfile
import os
from pydantic import BaseModel

from labelbox.schema.task import Task
from labelbox.utils import _CamelCaseMixin
from pydantic import BaseModel, Field, AliasChoices

if TYPE_CHECKING:
from labelbox import Client
Expand Down Expand Up @@ -241,6 +241,7 @@ def _get_file_content(
)
response = requests.get(file_info.file, timeout=30)
response.raise_for_status()
response.encoding = "utf-8"
assert (
len(response.content)
== file_info.offsets.end - file_info.offsets.start + 1
Expand Down
Loading