Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-94526: Force utf8 encoding in _bootstrap_python #96889

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Force ``utf8`` encoding in ``_bootstrap_python`` to fix compilation under path containing non-ascii characters. Patch by Kumar Aditya.
11 changes: 11 additions & 0 deletions Programs/_bootstrap_python.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ main(int argc, char **argv)
{
PyStatus status;

PyPreConfig preconfig;
PyPreConfig_InitIsolatedConfig(&preconfig);
// To keep code simple, pre-initialization doesn't parse argv.
// It ignores -E, -I and -X dev command line options etc.
// Force utf8 encoding
preconfig.utf8_mode = 1;
kumaraditya303 marked this conversation as resolved.
Show resolved Hide resolved
status = Py_PreInitialize(&preconfig);
if (PyStatus_Exception(status)) {
Py_ExitStatusException(status);
}

PyConfig config;
PyConfig_InitIsolatedConfig(&config);
// don't warn, pybuilddir.txt does not exist yet
Expand Down