Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Mustafa-Esoofally
Copy link
Contributor

@Mustafa-Esoofally Mustafa-Esoofally commented Jan 16, 2026

Summary

Cherry-pick of PR #6032 targeting v2.4.0.

CSVReader and FieldLabeledCSVReader ignored encoding parameter for BytesIO inputs - always used hardcoded "utf-8" instead of self.encoding or "utf-8".

Changes

  • Use self.encoding or "utf-8" for BytesIO decoding in sync and async methods
  • Added tests for custom encoding with BytesIO inputs

Original PR

#6032 (was merged to knowledge-ga-updates)

CSVReader and FieldLabeledCSVReader were ignoring the encoding parameter
when reading from BytesIO objects, always using hardcoded "utf-8".

Changes:
- csv_reader.py: 3 places now use self.encoding or "utf-8"
- field_labeled_csv_reader.py: 2 places now use self.encoding or "utf-8"
- Added 8 encoding tests across both readers

Co-Authored-By: Claude <[email protected]>
@Mustafa-Esoofally Mustafa-Esoofally requested a review from a team as a code owner January 16, 2026 17:12
Copy link
Contributor

@kausmeows kausmeows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

@claude
Copy link
Contributor

claude bot commented Jan 16, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@Mustafa-Esoofally Mustafa-Esoofally changed the base branch from v2.4.0 to knowledge-fixes January 16, 2026 18:28
@Mustafa-Esoofally Mustafa-Esoofally changed the base branch from knowledge-fixes to v2.4.0 January 16, 2026 18:31
@willemcdejongh willemcdejongh merged commit b877545 into v2.4.0 Jan 19, 2026
3 checks passed
@willemcdejongh willemcdejongh deleted the fix/csv-reader-encoding-v2 branch January 19, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants