Bug 253943 - net-p2p/qbittorrent: Python not detected
Summary: net-p2p/qbittorrent: Python not detected
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL: https://github.com/qbittorrent/qBitto...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-01 18:06 UTC by Dries Michiels
Modified: 2021-03-02 12:05 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dries Michiels 2021-03-01 18:06:23 UTC
Hi, I just configured qbittorrent-nox on my server and when I try to use the search plugin I can see in the log; "Python not detected", "Plugin X is not supported".

I tracked it down to this piece of code which can't seem to find the python path on a FreeBSD system.

https://github.com/qbittorrent/qBittorrent/blob/master/src/base/utils/foreignapps.cpp

I have not yet found the cause. Will look into this a bit more later.
Comment 1 Yuri Victorovich freebsd_committer 2021-03-01 18:16:15 UTC
Hi Dries,


It is looking for a 'python3' executable (src/base/utils/foreignapps.cpp) If you would create a symbolic link to a real python executable it should be fine.

The net-p2p/qbittorrent port doesn't depend on python, this is some "foreign app" lookup that qbittorrent does.


Yuri
Comment 2 Dries Michiels 2021-03-01 18:20:34 UTC
Hi Yuri,

I installed the python3 and python packages which are simple metaports that install that symlink for me. Weird thing: it doesn't work (I also thought that would have fixed it, but sadly this was not the case). Thanks for looking into this though.
Comment 3 Yuri Victorovich freebsd_committer 2021-03-01 18:32:37 UTC
(In reply to Dries Michiels from comment #2)

qbittorent feeds "python3" to QProcess::start() which expects a full path name.

This is a bug in qbittorrent itself. They should wrap the command line in  '/bin/sh -c {cmdline}' for PATH lookup to take place.

Otherwise the 'python3' symlink has to be located in a current dir for the running process.

Please report this bug to qbittorrent's bug report site @ https://github.com/qbittorrent/qBittorrent/issues

The easiest workaround for you is to patch the source with a full path of the python3 executable and rebuild. (copy foreignapps.cpp to foreignapps.cpp.orig, change foreignapps.cpp, run 'make makepatch', make deinstall install FLAVOR=nox)

Please let me know if you need further advice.

Yuri
Comment 4 Yuri Victorovich freebsd_committer 2021-03-01 18:35:23 UTC
I've created the bug report.
Comment 5 commit-hook freebsd_committer 2021-03-01 19:33:11 UTC
A commit references this bug:

Author: yuri
Date: Mon Mar  1 19:32:23 UTC 2021
New revision: 566898
URL: https://svnweb.freebsd.org/changeset/ports/566898

Log:
  net-p2p/qbittorrent: Add the PYTHON option to support some optional plugin functionality

  PR:		253943
  Reported by:	Dries Michiels <driesm.michiels@gmail.com>

Changes:
  head/net-p2p/qbittorrent/Makefile
Comment 6 Yuri Victorovich freebsd_committer 2021-03-01 19:33:42 UTC
Dries,

You can rebuild with the new option PYTHON=on and it should find python by itself.

Please report if you still have problems.


Best,
Yuri
Comment 7 Dries Michiels 2021-03-02 12:05:06 UTC
Works great man, thanks!