Skip to content

Commit

Permalink
gh-125873: Improve error message when PYTHONHOME is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
refeed committed Oct 27, 2024
1 parent c5b99f5 commit 6e83963
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved error message when ``PYTHONHOME`` is invalid
2 changes: 1 addition & 1 deletion Python/codecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ _PyCodec_InitRegistry(PyInterpreterState *interp)
// search functions, so this is done after everything else is initialized.
PyObject *mod = PyImport_ImportModule("encodings");
if (mod == NULL) {
return PyStatus_Error("Failed to import encodings module");
return PyStatus_Error("Failed to import encodings module. Are you sure PYTHONHOME is correct?");
}
Py_DECREF(mod);

Expand Down

0 comments on commit 6e83963

Please sign in to comment.