Opened 6 years ago
Closed 6 years ago
Last modified 6 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)
by , 6 years ago
| Attachment: | macos.python26hardcode.diff added |
|---|
comment:1 by , 6 years ago
| 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"
The following assumes that the --python switch has the version
of interest, not just python
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..ddbef2fa53 100644
--- a/mythtv/programs/mythbackend/main.cpp
+++ b/mythtv/programs/mythbackend/main.cpp
@@ -96,8 +96,9 @@ int main(int argc, char **argv)
#ifdef Q_OS_MAC
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(QFileInfo(PYTHON_EXE).fileName())
.arg(QProcessEnvironment::systemEnvironment().value("PYTHONPATH"))
.toUtf8().constData(), 1);
#endif
comment:2 by , 6 years ago
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 by , 6 years ago
| Owner: | set to |
|---|---|
| Resolution: | → fixed |
| Status: | infoneeded_new → closed |
In 0add17779/mythtv:

potential patch for hardcoded python2.6