Skip to content

fix(scripts): fix UnicodeEncodeError in footgun checker on Windows#27205

Closed
flamiinngo wants to merge 1 commit into
NousResearch:mainfrom
flamiinngo:fix/windows-footgun-checker-utf8-output
Closed

fix(scripts): fix UnicodeEncodeError in footgun checker on Windows#27205
flamiinngo wants to merge 1 commit into
NousResearch:mainfrom
flamiinngo:fix/windows-footgun-checker-utf8-output

Conversation

@flamiinngo

Copy link
Copy Markdown
Contributor

What

scripts/check-windows-footguns.py uses ✓ and ✗ characters in its output. Windows terminals default to cp1252, which
cannot encode these characters — running the script on Windows threw a UnicodeEncodeError before printing any
results.

Why it matters

This made the tool completely unusable on the exact platform it exists to help. A developer on Windows trying to check
their code for Windows-safety issues would get a crash instead of results.

Fix

Reconfigure stdout and stderr to UTF-8 at the start of main(), before any output is produced.

Verified on

  • Windows 11 Home, Python 3.13, terminal defaulting to cp1252
  • Before: UnicodeEncodeError: 'charmap' codec can't encode character '\u2713'
  • After: `✓ No Windows footguns found (462 file(s) scanned).

The check-windows-footguns.py script outputs a checkmark (U+2713) and
cross (U+2717) to report results. Windows terminals default to cp1252,
which cannot encode these characters, so running the script on Windows
threw a UnicodeEncodeError before any results were printed.

This made the tool completely unusable on the exact platform it exists
to help -- a developer on Windows trying to check their code for
Windows-safety issues would just get a crash instead.

Fix: reconfigure stdout and stderr to UTF-8 at the start of main(),
before any output is produced. Verified on Windows 11 Home with
Python 3.13 (terminal defaulting to cp1252).
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have labels May 17, 2026
teknium1 added a commit that referenced this pull request May 17, 2026
…tors

Adds release-note attribution mappings for 9 contributors from group 3:
- @darvsum (PR #26766)
- @hueilau (PR #26498)
- @Timur00Kh (PR #27114)
- @Grogger (PR #27061)
- @lemassykoi (PR #27042)
- @draplater (PR #26707)
- @pr7426 (PR #27048)
- @therahul-yo (PR #26215)
- @flamiinngo (PR #27205)

#27154 dropped from this batch — already landed on main as 4e9cedc.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #27302 — your commit was cherry-picked onto current main as part of a batch salvage of low-risk new-contributor PRs. Authorship preserved (fix(scripts): fix UnicodeEncodeError in footgun checker on Windows). Thanks for the contribution.

@teknium1 teknium1 closed this May 17, 2026
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants