[mythtv-users] MythTV v31 and Python v3 Heads Up

Bill Meek keemllib at gmail.com
Wed Jan 8 21:58:04 UTC 2020


On 1/8/20 3:37 PM, Jim Abernathy wrote:
> 
> On 1/8/20 4:22 PM, Bill Meek wrote:
>> Those building on master will have noticed that Python version 3
>> support has been added. Python version 2 reached End Of Life
>> 2020-1-1.
>>
>> Distributions have started removing python2, although it _may_ be
>> available from them.
>>
>> Now would be a great time to start converting Python scripts to
>> run on either version. If you put a script on the Wiki, consider
>> updating it. find_orphans.py, for example, has been converted.
>>
>> There are some hints here: https://www.mythtv.org/wiki/Python3_Conversion
>> Of course, the v31 Release Notes link to that page.
>>
>> The MythTV v31 default is now python3. Previously, it was just python.
>> The --python switch in configure remains. Thus, at the time MythTV is
>> built, either version can be selected (assuming the distribution supports
>> it.) If the switch isn't used, then python3 will be used.
>>
> I don't build from master, but want to move to v31 when it's reaches release status. Since I'll install from the ppa when it's time but remain 
> on Ubuntu 18.04 will I have to do anything related to python3??
> 
> Jim A

We expect the MythTV v31 ppa to be built with the python3 default. python3 exists in 18.04.
I'm running master on an 18.04 host OK.

If you have any local MythTV python scripts that depend on v2, they'll need to be updated.

At the very least, the shebang at the top of the file (#!/usr/bin/env python) becomes
#!/usr/bin/python3. Same goes for anything downloaded from the Wiki (or other sources.)
In both cases, that assumes that the script has line(s) like: import MythTV.

With the exception of the shebang above, python scripts can be converted *now* using the
tools on the previous post.

-- 
Bill


More information about the mythtv-users mailing list