[mythtv] Is MythTV ready for Python 3.9?

Roland Ernst rcrernst at gmail.com
Tue Jun 23 21:08:29 UTC 2020


On Mon, Jun 22, 2020 at 8:11 PM Roland Ernst <rcrernst at gmail.com> wrote:

>
> On Sun, Jun 21, 2020 at 7:19 PM Bill Meek <keemllib at gmail.com> wrote:
>
>>
>>
>> Ansible works OK now. The only error I'm seeing with the
>> Python bindings in 3.9 is:
>>
>>    File "/usr/local/lib/python3.9/site-packages/MythTV/dataheap.py", line
>> 18, in <module>
>>      import xml.etree.cElementTree as etree
>> ModuleNotFoundError: No module named 'xml.etree.cElementTree'
>>
>> There's a simple solution, but is cElementTree an
>> example of something that will show up in the
>> future? Any script that uses: from MythTV import MythDB
>> will fail.
>>
>> --
>> Bill
>>
>>
> That's not the only error:
> Python3.9 moved the 'Abstract Base Classes' from 'collections' to
> 'collections.abc'.
> Affected grabber modules:
>   - tmdb.py
>   - tvdb.py
> The classes 'Sequence', 'Iterator', 'Iterable' are now members of
> 'collections.abc'
>
> The module 'xml' removed the methods 'getchildren()' and other methods.
> I need to check if pythons 'lxml' module does the same.
>
> I will set up a 'Python Virtual Environment' for Python3.9 with the
> modules selected for fedora33:
>  - python3-mysqlclient-1.4.6-2.fc33.x86_64.rpm
>  - python3-lxml-4.5.1-1.fc33.x86_64.rpm
>  - python3-requests-2.23.0-4.fc33.noarch.rpm
>  - python3-requests-cache-0.5.1-5.fc33.noarch.rpm
>  - python3-future-0.18.2-6.fc33.noarch.rpm
>  - python3-simplejson-3.17.0-4.fc33.x86_64.rpm
>  - python3-urllib3-1.25.8-3.fc33.noarch.rpm
> and run my tests with it.
>
> See the bug tacker for python3 at fedora at
> https://bugzilla.redhat.com/show_bug.cgi?id=1785415
> for the changes the fedora maintainers raised: It's quite a lot that broke.
>
> BTW: Though 'xml.etree.cElementTree' was deprecated for a long time, it
> never raised a
> 'deprecation warning' in my tests. Therefore, it is hard to find it up
> front.
>
> Roland
>
>
I need to revoke my last mail.
Please excuse the noise.

According to the latest documentation,  python3.9 only emits a deprecation
warning
if 'Abstract Base Classes' from 'collections 'are imported instead of
'collections.abc'.
No error is reported.

See https://docs.python.org/3.9/whatsnew/3.9.html

$ python3 -W default
Python 3.9.0b3 (default, Jun 10 2020, 06:01:41)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import Sequence
<stdin>:1: DeprecationWarning: Using or importing the ABCs from
'collections'
instead of from 'collections.abc' is deprecated since Python 3.3, and in
3.10 it will stop working

And pythons 'lxml' module 4.5.1 for python3.9 still allows the method
'getchildren()'.
Tested with python3-lxml-4.5.1 and current master of MythTV.

So far, so good ( at least, for python3.9 ).

I will resolve this deprecation warning soon.

Roland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20200623/0e1744c0/attachment.htm>


More information about the mythtv-dev mailing list