Bug 1656633 - Python plugins do not load
Summary: Python plugins do not load
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: weechat
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Paul P Komkoff Jr
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1656632 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-05 22:05 UTC by Gerry Agbobada
Modified: 2020-11-03 20:26 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-03 20:26:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Gerry Agbobada 2018-12-05 22:05:23 UTC
Description of problem:
Weechat does not load its Python plugin -> therefore no python script can be used any more

Version-Release number of selected component (if applicable):
weechat.x86_64                               2.3-1.fc30                                @rawhide

How reproducible:
Always

Steps to Reproduce:
1. start Weechat

Actual results:
23:01   ___       __         ______________        _____ 
23:01   __ |     / /___________  ____/__  /_______ __  /_
23:01   __ | /| / /_  _ \  _ \  /    __  __ \  __ `/  __/
23:01   __ |/ |/ / /  __/  __/ /___  _  / / / /_/ // /_  
23:01   ____/|__/  \___/\___/\____/  /_/ /_/\__,_/ \__/  
23:01 WeeChat 2.3 [compiled on Nov 28 2018 15:17:42]
23:01 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
23:01 ? Error: unable to load plugin "/usr/lib64/weechat/plugins/python.so": /usr/lib64/weechat/plugins/python.so: undefined symbol: _Py_NoneStruct
23:01 ? If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...)
23:01 perl scripts loaded: highmon
23:01 lua scripts loaded: emoji
23:01 script: 358 scripts for WeeChat 2.3
23:01 Plugins loaded: alias, aspell, buflist, charset, exec, fifo, fset, guile, irc, logger, lua, perl, relay, ruby, script, tcl, trigger, xfer

Expected results:
Python plugin load (so it is listed in plugins loaded:) and I see my python scripts loaded


Additional info:
It used to work, but I don't remember what exactly happened to make it not work now

Comment 1 Gerry Agbobada 2018-12-05 22:22:50 UTC
*** Bug 1656632 has been marked as a duplicate of this bug. ***

Comment 2 Gerry Agbobada 2018-12-05 22:27:41 UTC
I found a little more info, and maybe this is supposed to be an upstream bug, maybe not, you will tell me I suppose : 

Following the report on an older opened bug on upstream github repo : https://github.com/weechat/weechat/issues/420

I found out that the linking info for the python plugin was way shorter than the one for the perl one for example :
$ ldd /usr/lib64/weechat/plugins/python.so                                        
        linux-vdso.so.1 (0x00007fff6ed9b000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f4e6dc17000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4e6de4d000)
$ ldd /usr/lib64/weechat/plugins/perl.so                                          
        linux-vdso.so.1 (0x00007ffd1f119000)
        libperl.so.5.28 => /lib64/libperl.so.5.28 (0x00007f7de8559000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f7de8393000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f7de8371000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f7de836b000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f7de8226000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f7de81eb000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f7de88fb000)

Therefore, I tried, like in the github issue I mentioned, to use LD_PRELOAD to force the issue :

$ LD_PRELOAD=/lib64/libpython2.7.so weechat

And now the symbol that weechat/plugins/python.so struggles to find actually changes (message is in french below) :

23:21 ⚠ Erreur : impossible de charger l'extension "/usr/lib64/weechat/plugins/python.so" : /usr/lib64/weechat/plugins/python.so: undefined symbol: PyUnicode_AsUTF8String

So I suppose this is an issue of correctly setting link dependencies when compiling, just as mentioned on the github issue, but I don't really know how to fix it, and why I started just now having issues with this python extension (I use 2 python scripts since I started using weechat, so I know it worked before)

Comment 3 Gerry Agbobada 2018-12-05 23:03:41 UTC
And now I've found out how to make them work again : 

$ LD_PRELOAD=/lib64/libpython3.7m.so.1.0 weechat

starts without issue. No idea if there's anything to change to avoid having to preload the library.

Comment 4 Gerry Agbobada 2019-02-04 16:57:06 UTC
I updated the package on rawhide and I still have the issue on

weechat.x86_64  2.3-2.fc30  @rawhide

Comment 5 Michele Baldessari 2019-02-22 17:05:24 UTC
diff -up weechat-2.4/cmake/FindPython.cmake.orig weechat-2.4/cmake/FindPython.cmake
--- weechat-2.4/cmake/FindPython.cmake.orig	2019-02-22 17:58:30.307952375 +0100
+++ weechat-2.4/cmake/FindPython.cmake	2019-02-22 17:58:43.763103598 +0100
@@ -67,7 +67,7 @@ if(PYTHON_EXECUTABLE)
     )
   if(ENABLE_PYTHON3)
     find_library(PYTHON_LIBRARY
-      NAMES python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
+      NAMES python3.7m python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
       HINTS ${PYTHON_POSSIBLE_LIB_PATH}
       )
   else()

Fixes it for me.

Comment 6 Ankur Sinha (FranciscoD) 2019-04-14 10:09:44 UTC
Seeing this on F30 that is now in beta. Could we get an update with the fix please?

weechat-2.3-3.fc30.x86_64

Comment 7 Ankur Sinha (FranciscoD) 2019-04-14 10:33:30 UTC
Opened a PR that updates to 2.4.1 and includes the fix Michele provided: https://src.fedoraproject.org/rpms/weechat/pull-request/6

Comment 8 Fedora Update System 2019-04-15 23:00:26 UTC
weechat-2.4-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-bb4f83f667

Comment 9 Fedora Update System 2019-04-15 23:00:33 UTC
weechat-2.4-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2019-9dc1c8a671

Comment 10 Fedora Update System 2019-04-15 23:00:40 UTC
weechat-2.4-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-582e7a757b

Comment 11 Fedora Update System 2019-04-16 01:35:55 UTC
weechat-2.4-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-582e7a757b

Comment 12 Fedora Update System 2019-04-16 02:54:20 UTC
weechat-2.4-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-9dc1c8a671

Comment 13 Fedora Update System 2019-04-16 04:34:53 UTC
weechat-2.4-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-bb4f83f667

Comment 14 Fedora Update System 2019-04-24 22:58:41 UTC
weechat-2.4-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2019-04-25 01:33:34 UTC
weechat-2.4-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2019-04-27 21:25:10 UTC
weechat-2.4-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Ben Cotton 2019-08-13 17:12:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 18 Ben Cotton 2019-08-13 19:26:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 19 Ben Cotton 2020-11-03 16:51:14 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.


Note You need to log in before you can comment on or make changes to this bug.