Opened 4 years ago
Closed 4 years ago
Last modified 4 years ago
#13643 closed Patch - Bug Fix (fixed)
MacOS Python2.6 hard code breaks python bindings / metadatalookup
Reported by: | John Hoyt | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 31.1 |
Component: | MythTV - General | Version: | Unspecified |
Severity: | medium | Keywords: | MacOS Python |
Cc: | Ticket locked: | no |
Description
There is a hard code to python2.6 in
- mythtv/programs/mythbackend/main.cpp
- mythtv/programs/mythfrontend/main.cpp
- mythtv/programs/mythmetadatalookup/main.cpp
The suspect line in each file is
QString("%1/../Resources/lib/python2.6/site-packages:%2")
This should either be modified to python (per the attached path) or worked out to automatically extract the compile time python version.
Attachments (2)
Change History (6)
Changed 4 years ago by
Attachment: | macos.python26hardcode.diff added |
---|
comment:1 Changed 4 years ago by
Status: | new → infoneeded_new |
---|
John,
I see in compileMythfrontendAnsible.zsh: --python=/opt/local/bin/python3.8
That should end up in libs/libmythbase/mythconfig.h as: #define PYTHON_EXE "/opt/local/bin/python3.8"
Please test this, which removes the leading path info:
diff --git a/mythtv/programs/mythbackend/main.cpp b/mythtv/programs/mythbackend/main.cpp index 7cf7f5b644..1a6233a7ba 100644 --- a/mythtv/programs/mythbackend/main.cpp +++ b/mythtv/programs/mythbackend/main.cpp @@ -94,10 +94,13 @@ int main(int argc, char **argv) QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHBACKEND); #ifdef Q_OS_MAC + QFileInfo fi(PYTHON_EXE); + QString python_executable = fi.fileName(); QString path = QCoreApplication::applicationDirPath(); setenv("PYTHONPATH", - QString("%1/../Resources/lib/python2.6/site-packages:%2") + QString("%1/../Resources/lib/%2/site-packages:%3") .arg(path) + .arg(python_executable) .arg(QProcessEnvironment::systemEnvironment().value("PYTHONPATH")) .toUtf8().constData(), 1); #endif
comment:2 Changed 4 years ago by
I just tested this patch file successfully. I believe it still has your debug variable in it for all three files. I needed the mythtv/programs/mythmetadatalookup/main.cpp fix to test easily.
Verified the correct path is being generated by modifying the tmdb3.py script to print its sys.path to a file.
comment:3 Changed 4 years ago by
Owner: | set to Bill Meek <billmeek@…> |
---|---|
Resolution: | → fixed |
Status: | infoneeded_new → closed |
In 0add17779/mythtv:
potential patch for hardcoded python2.6