Skip to content

Force UTF-8 mode for Windows Python scripts#2894

Merged
ghutchis merged 1 commit into
OpenChemistry:masterfrom
aouxwoux:codex/force-utf8-python-output
Jul 21, 2026
Merged

Force UTF-8 mode for Windows Python scripts#2894
ghutchis merged 1 commit into
OpenChemistry:masterfrom
aouxwoux:codex/force-utf8-python-output

Conversation

@aouxwoux

Copy link
Copy Markdown
Contributor

For Windows launches, set PYTHONUTF8=1 on the process environment in the shared PythonScript launch path. This makes direct Python and pixi-launched plugin scripts use UTF-8 consistently, avoiding system-locale decoding of plugin output.

Adds a Windows regression test that launches a temporary Python script and verifies sys.flags.utf8_mode is enabled.

Validation:

  • git diff --check
  • Confirmed locally that PYTHONUTF8=1 enables Python UTF-8 mode
  • Full CMake/Qt test suite was not run locally because this environment lacks CMake and Qt

Fixes #1618.

@aouxwoux
aouxwoux force-pushed the codex/force-utf8-python-output branch from cbee7b3 to 3552b94 Compare July 12, 2026 17:18
@ghutchis

Copy link
Copy Markdown
Member

Hi - as part of our policy, we require commits to be signed by full names and permanent e-mail addresses. This allows us to contact contributors, e.g. for manuscripts about Avogadro development. This commit is currently signed as:

aouxwoux 81102668+aouxwoux@users.noreply.github.com

Which does neither. Please include a full name and permanent email address. Thanks.

Signed-off-by: Vipul Mittal <vipulmittal803@gmail.com>
@aouxwoux
aouxwoux force-pushed the codex/force-utf8-python-output branch from 3552b94 to 8f11eb5 Compare July 13, 2026 05:03
@ghutchis

Copy link
Copy Markdown
Member

Great - apologies for the delay. LGTM - many thanks.

@ghutchis
ghutchis merged commit 9bfbb40 into OpenChemistry:master Jul 21, 2026
23 of 24 checks passed
@welcome

welcome Bot commented Jul 21, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉 Thanks for making Avogadro better for everyone!

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.

Plugin output to console doesn't use Unicode on Windows, Avogadro expects UTF-8

2 participants