Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#13565 closed Patch - Bug Fix (fixed)

Fix recorded markup handling in python3 bindings

Reported by: rcrdnalor Owned by: Bill Meek
Priority: minor Milestone: 31.0
Component: Bindings - Python Version: Master Head
Severity: medium Keywords: python3
Cc: Ticket locked: no

Description

With python3, the following methods of the Python Bindings return now a generator, in opposite to python2, where they return a list:

Recorded.markup.getskiplist()
Recorded.markup.getunskiplist()
Recorded.markup.getcutlist()
Recorded.markup.getuncutlist()

This will break almost all home-made transcoding scripts, once called with python3. Found during debugging of #13562.

Luckily, this is easy to fix, patch attached. It works for python2 and python3 as well.

Without the patch:

$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
>>> from MythTV import MythDB, Recorded
>>> db = MythDB()
>>> rec = Recorded((3002,20200120201100), db = db)
>>> rec.markup.getcutlist()
<zip object at 0x7f63ee572d88>       <--- this is the generator
>>> list(rec.markup.getcutlist())
[(0, 13204), (159325, 9999999)]
>>> 

With patch:

$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
>>> from MythTV import MythDB, Recorded
>>> db = MythDB()
>>> rec = Recorded((3002,20200120201100), db = db)
>>> rec.markup.getcutlist()
[(0, 13204), (159325, 9999999)]
>>> 

Attachments (1)

Fix_recorded_markup_handling_in_python3_bindings.patch (585 bytes) - added by rcrdnalor 4 years ago.
Patcg to fix recorded markup handling in python3 bindings

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by rcrdnalor

Patcg to fix recorded markup handling in python3 bindings

comment:1 Changed 4 years ago by Bill Meek

Milestone: needs_triage31.0
Status: newaccepted

comment:2 Changed 4 years ago by Roland Ernst <rcrernst@…>

Resolution: fixed
Status: acceptedclosed

In 20827d1bc/mythtv:

MythArchive?: Python v2/v3 changes.

Solution for 13562 - Transition to python3 breaks MythArchive?
Includes 13306 - MythArchive? fails during DVD Menu creation from: jreiser
Includes 13565 - Fix recorded markup handling in python3 bindings

Plus two of typos in: mytharchivehelper/main.cpp

Closes: #13562
Closes: #13306
Closes: #13565

Signed-off-by: Bill Meek <billmeek@…>

comment:3 Changed 4 years ago by Roland Ernst <rcrernst@…>

In 9337b830c/mythtv:

Python Bindings: fix recorded markup handling in python3 bindings

Missed in commit 20827d1bc

Refs: #13565

Signed-off-by: Bill Meek <billmeek@…>

Note: See TracTickets for help on using tickets.