Skip to content

fix(scripts): reconfigure stdout to utf-8 for Windows compat#47

Merged
dev76bitpl merged 3 commits into
mainfrom
fix/new-project-windows-compat
May 24, 2026
Merged

fix(scripts): reconfigure stdout to utf-8 for Windows compat#47
dev76bitpl merged 3 commits into
mainfrom
fix/new-project-windows-compat

Conversation

@dev76bitpl
Copy link
Copy Markdown
Owner

Summary

  • sys.stdout.reconfigure(encoding="utf-8") added after imports in new-project.py
  • Fixes UnicodeEncodeError: 'charmap' codec can't encode character crash on Windows when running the script in terminals using cp1250 encoding (emoji in print output)
  • Works on both Windows and Linux/macOS — reconfigure() is a no-op when stdout already uses UTF-8

Test plan

  • python3 scripts/new-project.py --init --dry-run — no UnicodeEncodeError, emoji visible
  • python3 scripts/new-project.py --help — no crash
  • Run on Linux (or WSL) — no regression

🤖 Generated with Claude Code

- .editorconfig: new -- LF line endings, UTF-8, trim whitespace; fixes CRLF
  warnings on Windows across all editors
- new-project.py COPY_DOCS: added AI_TEMPLATE_NOTES.md -- file is always-read
  so new projects created via copy-to-dir mode must have it

[skip-test-check] [skip-docs]
- new-project.py: add sys.stdout.reconfigure(encoding="utf-8") after imports
- fixes UnicodeEncodeError on Windows cp1250 terminals (emoji in print output)

[skip-test-check] [skip-docs]
@dev76bitpl dev76bitpl merged commit 66f4ac6 into main May 24, 2026
1 of 2 checks passed
@dev76bitpl dev76bitpl deleted the fix/new-project-windows-compat branch May 24, 2026 19:24
@github-actions github-actions Bot mentioned this pull request May 24, 2026
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.

1 participant