Skip to content

fix: text encoding issues#91

Merged
p- merged 5 commits into
mainfrom
p--fix-enc
Jul 6, 2026
Merged

fix: text encoding issues#91
p- merged 5 commits into
mainfrom
p--fix-enc

Conversation

@p-

@p- p- commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 3, 2026 14:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses text encoding issues when reading/searching files inside local GitHub zip archives by decoding zip entry bytes as UTF-8 (with replacement on decode errors), and adds regression tests to ensure non-ASCII content is handled correctly without leaking Python bytes representations.

Changes:

  • Decode zip entry lines via line.decode("utf-8", errors="replace") in search_zipfile() to correctly match non-ASCII search terms.
  • Decode zip entry lines in get_file() so returned content is str (not bytes) and safe for downstream formatting/joining.
  • Add tests covering non-ASCII text, invalid UTF-8 bytes, and tool outputs to ensure decoded/numbered lines are returned.
Show a summary per file
File Description
tests/test_local_file_viewer.py Adds regression tests verifying decoded output for non-ASCII and invalid UTF-8 content.
src/seclab_taskflows/mcp_servers/local_file_viewer.py Fixes zipfile line handling by decoding bytes to str for search and file reads.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread tests/test_local_file_viewer.py
Comment thread src/seclab_taskflows/mcp_servers/local_file_viewer.py
Copilot AI review requested due to automatic review settings July 3, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread src/seclab_taskflows/mcp_servers/gh_file_viewer.py
@p- p- merged commit e41d11a into main Jul 6, 2026
9 checks passed
@p- p- deleted the p--fix-enc branch July 6, 2026 08:22
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