aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/dynload_shlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/dynload_shlib.c')
-rw-r--r--Python/dynload_shlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index 082154dd91b..23828898d35 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -106,7 +106,7 @@ _PyImport_FindSharedFuncptr(const char *prefix,
const char *error = dlerror();
if (error == NULL)
error = "unknown dlopen() error";
- error_ob = PyUnicode_FromString(error);
+ error_ob = PyUnicode_DecodeLocale(error, "surrogateescape");
if (error_ob == NULL)
return NULL;
mod_name = PyUnicode_FromString(shortname);
@@ -114,7 +114,7 @@ _PyImport_FindSharedFuncptr(const char *prefix,
Py_DECREF(error_ob);
return NULL;
}
- path = PyUnicode_FromString(pathname);
+ path = PyUnicode_DecodeFSDefault(pathname);
if (path == NULL) {
Py_DECREF(error_ob);
Py_DECREF(mod_name);