Follow-up Comment #8, bug #31091 (project weechat): I can reproduce the this problem on my Fedora 21 based system, using * WeeChat 1.0.1, ncurses client * PyGTK version 2.24.0 * Python 2.7.8 * "anotify.py" script, version 1.0.1 when reloading "anotify" (as described in comment #6).
@SebastiƩn: Which version of lnotify have you been using? It seems that lnotify has changed and does not use pynotify anymore, at least not since version 0.2.0. This problem is related to the use of Python sub-interpreters, which seem to have trouble with native modules like gtk._gtk that modify the module directory as part of their initialization code: [https://docs.python.org/2/c-api/init.html#bugs-and-caveats] It seems like dynamic objects (_gtk.so) are loaded only once per _process_, which is why the initialization code is not re-run the second time the import is triggered (by importing pynotify, which imports gtk, which imports _gtk), and thus the module directory of the new interpreter state is not populated with the "gdk" module. Comment #6 was on the right track suspecting the "weird magic" that is involved in loading "gdk", and that there is at least _something_ on the WeeChat side (using sub-interpreters within a single process) that triggers this bug (gtk being unable to find the "virtual" gdk module). This bug will also be triggered if two more more different Python scripts are are importing the "gtk" module -- only the first one will succeed. However, if anything, it can be considered a bug in Python, or in the implementation details of PyGTK (not allowing for proper reloading), but it is definitely not a bug in WeeChat. I am not sure if there is a workaround that does not involve chancing either Python or PyGTK. _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?31091> _______________________________________________ Message sent via/by Savannah http://savannah.nongnu.org/ _______________________________________________ Weechat-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/weechat-dev
