Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG] JSONLoader rejects valid UTF-8 BOM files

Closed Beginner friendly
#8,022 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Vidit-Ostwal is already working on this.

Since Oct 12, 2026.

  • #8023 by @zouyonghe — merged
  • #8042 by @varun-projects — closed without merging
  • #8064 by @tandede — closed without merging

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data

Research direction

The bug is in the JSONLoader at crewai_tools/rag/loaders/json_loader.py, which opens files with encoding="utf-8" before calling json.loads. Start by running the reproduction script in the issue, which writes a BOM-prefixed file and calls JSONLoader().load on it, and check where metadata["parse_error"] gets set. Done means the BOM file produces the same parsed content and metadata as the BOM-free equivalent.

Written by the indexing model from the issue text.

Description

Description

JSONLoader treats a valid UTF-8 JSON file with a leading BOM as malformed JSON. The loader opens files with plain encoding="utf-8", and json.loads() rejects the resulting \ufeff prefix. The same JSON without BOM parses normally.

Reproduction

from pathlib import Path
from tempfile import TemporaryDirectory
from crewai_tools.rag.loaders.json_loader import JSONLoader
from crewai_tools.rag.source_content import SourceContent

with TemporaryDirectory() as directory:
    path = Path(directory) / "data.json"
    path.write_bytes(b"\xef\xbb\xbf{\"message\": \"hello\"}")
    result = JSONLoader().load(SourceContent(path))
    print(result.metadata, result.content)

Actual: metadata["parse_error"] is set and content retains the BOM-prefixed raw text.
Expected: same parsed content/metadata as the equivalent BOM-free JSON file.

Verified on CrewAI source main d38ceafb68c6ad33196c9ac052b9b67e74dab37c, Python 3.12.15, no network/model/credentials. This is distinct from CrewAI CSV BOM reports (#7466 and its existing PRs); public search found no JSONLoader/BOM issue or PR.

AI-assisted investigation and issue writing; llm-generated label required.

Dominant language
Python
Stars
59.6k
Forks
8.7k
Avg merge
1d 7h
Merged PRs (30d)
101

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from crewAIInc/crewAI

All issues in crewAIInc/crewAI

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.