Skip to content

fix(file_filter): add explicit utf-8 encoding to subprocess calls (#1866) #1886

Open
gstggsstt wants to merge 1 commit intoMoonshotAI:mainfrom
gstggsstt:main
Open

fix(file_filter): add explicit utf-8 encoding to subprocess calls (#1866) #1886
gstggsstt wants to merge 1 commit intoMoonshotAI:mainfrom
gstggsstt:main

Conversation

@gstggsstt
Copy link
Copy Markdown

@gstggsstt gstggsstt commented Apr 15, 2026

…866)

Add encoding="utf-8" to all subprocess.run calls in file_filter.py to prevent encoding errors on systems where the default encoding is not UTF-8.

Related Issue

Resolve #(issue_number)

Description

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

…onshotAI#1866)

Add encoding="utf-8" to all subprocess.run calls in file_filter.py
to prevent encoding errors on systems where the default encoding
is not UTF-8.
Copilot AI review requested due to automatic review settings April 15, 2026 03:18
@gstggsstt gstggsstt closed this Apr 15, 2026
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@gstggsstt gstggsstt reopened this Apr 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 aims to prevent locale-dependent decoding failures when file_filter.py invokes git by making subprocess.run(..., text=True) decode output explicitly as UTF-8.

Changes:

  • Add encoding="utf-8" to subprocess.run calls used by git_index_mtime, _git_deleted_files, and list_files_git (tracked + untracked).

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

Comment thread src/kimi_cli/utils/file_filter.py
Comment thread src/kimi_cli/utils/file_filter.py
Comment thread src/kimi_cli/utils/file_filter.py
Comment thread src/kimi_cli/utils/file_filter.py
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.

2 participants