Summary: | pygtk.require sets wrong import directory for gtk python module | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Karol Szumski <mareviq> |
Component: | [OLD] Unspecified | Assignee: | Python Gentoo Team <python> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | dfnsonfsduifb, gnome, linuxnoob, spamlover |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://forums.gentoo.org/viewtopic-t-312800.html | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Karol Szumski
2005-06-01 01:55:24 UTC
Is there a work-around? I remove the symlink /usr/bin/gtk-2.0 but now success I've already checked this out. The problem is with pygtk.py _get_available_versions() function that search inside sys.path for subdirs that are named gtk-*. He always thinks that the first match is the right one and remove all other ones, even if they were previously on sys.path. Totally brainless. My suggestion is to completely replace this function, hardcoding /usr/lib/python*/site-packages/gtk-* on it. Or simple comment the "remove any pygtk dirst first" from it. As I said before, I think the correct answer to this is something in the line of (on src_unpack): sed -i -e "s:sys.path.remove(dir):pass:" ${S}/pygtk.py If noone comes with a better idea, I'll just add this on pygtk ebuilds. *** Bug 97858 has been marked as a duplicate of this bug. *** I don't think there is any other easy-to-do solution (the not-so-easy one would be writing a script that would verify that the directory really contains the python modules, and reporting their correct version, etc. I don't know anything about python so i'm not even sure this is possible). But as it isn't a _true_ solution (i mean, we just basically assume that there is only one set of those bindings installed, and they are already in the sys.path ... which is quite probable, unless someone installed those through other means than portage ...) so i'll leave it as WORKSFORME ... *** Bug 101499 has been marked as a duplicate of this bug. *** |