[mythtv-commits] Ticket #13546: Hardcoded call to 'python' from mythtv-programs for lyrics
MythTV
noreply at mythtv.org
Mon Dec 30 16:00:20 UTC 2019
#13546: Hardcoded call to 'python' from mythtv-programs for lyrics
------------------------------------+--------------------------
Reporter: rcrdnalor | Owner: paulh
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: needs_triage
Component: Plugin - MythMusic | Version: Master Head
Severity: medium | Keywords: python3
Ticket locked: 0 |
------------------------------------+--------------------------
MythTV is on the way to switch to python3. But some programs
use to call 'python <script-name> <options>' for grabbing lyrics
for the MythTV-Music plugin (note the hardcoded 'python' call).
Note: Pythons PEP 394 states that
"The python command should always invoke Python 2".
But python2 is not available on modern linux installations, because
python2 is deprecated and EOF starting with January 1st, 2020.
Latest releases of various linux distributions do not install python by
default,
only python3 (like Ubuntu 19.10).
Use the following command to identify those hardcoded calls to python:
{{{
$ grep -nHIrF --include=*.cpp -- QString\(\"python
mythtv/programs/mythutil/musicmetautils.cpp:494:
p.start(QString("python %1 -v").arg(scripts.at(x)));
mythtv/programs/mythutil/musicmetautils.cpp:538:
p.start(QString("python %1 --artist=\"%2\" --album=\"%3\" --title=\"%4\"
--filename=\"%5\"")
mythtv/programs/mythbackend/mainserver.cpp:6951:
p.start(QString("python %1 -v").arg(scripts.at(x)));
}}}
Once these lyric scripts are able to speak python3 as well (see #13545),
we can use the configured python version (i.e.: either python2 or
python3).
The attached patch uses the configured python version to call
these lyric grabber scripts.
Note: This patch is compile time tested only.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13546>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list