GNOME Bugzilla – Bug 737341
Changed behavior of g_win32_get_package_installation_directory_of_module()
Last modified: 2015-08-29 18:04:02 UTC
Changes in glib\gwin32.c at g_win32_get_package_installation_directory_of_module() (version 2.41.3 till current) cause it returns path of interpreter (python.exe) instead of cleaned up hmodule path. If added printouts such: ... gchar * g_win32_get_package_installation_directory_of_module (gpointer hmodule) { gchar *filename; gchar *retval; gchar *p; wchar_t wc_fn[MAX_PATH]; /* NOTE: it relies that GetModuleFileNameW returns only canonical paths */ if (!GetModuleFileNameW (hmodule, wc_fn, MAX_PATH)) return NULL; filename = g_utf16_to_utf8 (wc_fn, -1, NULL, NULL, NULL); printf(filename); if ((p = strrchr (filename, G_DIR_SEPARATOR)) != NULL) *p = '\0'; retval = g_strdup (filename); do { p = strrchr (retval, G_DIR_SEPARATOR); printf(retval); if (p == NULL) break; *p = '\0'; if (g_ascii_strcasecmp (p + 1, "bin") == 0 || g_ascii_strcasecmp (p + 1, "lib") == 0) break; } while (p != NULL); if (p == NULL) { g_free (retval); retval = filename; } else g_free (filename); #ifdef G_WITH_CYGWIN /* In Cygwin we need to have POSIX paths */ { gchar tmp[MAX_PATH]; cygwin_conv_to_posix_path (retval, tmp); g_free (retval); retval = g_strdup (tmp); } #endif printf (retval); return retval; } ... returns: C:\Python34\Lib\site-packages\gnome\libgirepository-1.0-1.dll C:\Python34\Lib\site-packages\gnome C:\Python34\Lib\site-packages C:\Python34\Lib C:\Python34 It show that initial hmodule path is correct but inside the loop it keep cut till C:\python34 C:\Python34\Lib\site-packages\gnome in inside PATH environment, doesnt have "bin" subfulder but have "lib" subfolder and is the expected retval. This bug reproduced in python mode. In windows this causes GI fail to find relative typelibs repo. So this bug is critical.
*** This bug has been marked as a duplicate of bug 739835 ***