We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 166e27a + e08cbf1 commit 0a4efbeCopy full SHA for 0a4efbe
src/_tkagg.cpp
@@ -309,8 +309,8 @@ load_tkinter_funcs()
309
module = py::module_::import("_tkinter"); // CPython
310
}
311
auto py_path = module.attr("__file__");
312
- py::bytes py_path_b = py_path.attr("encode")(
313
- Py_FileSystemDefaultEncoding, Py_FileSystemDefaultEncodeErrors);
+ auto py_path_b = py::reinterpret_steal<py::bytes>(
+ PyUnicode_EncodeFSDefault(py_path.ptr()));
314
std::string path = py_path_b;
315
auto tkinter_lib = dlopen(path.c_str(), RTLD_LAZY);
316
if (!tkinter_lib) {
0 commit comments