Opened 6 years ago

Closed 6 years ago

Last modified 6 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 6 years ago.
Patcg to fix recorded markup handling in python3 bindings

Download all attachments as: .zip

Change History (4)

by rcrdnalor, 6 years ago

Patcg to fix recorded markup handling in python3 bindings

comment:1 by Bill Meek, 6 years ago

Milestone: needs_triage31.0
Status: newaccepted

comment:2 by Roland Ernst <rcrernst@…>, 6 years ago

Resolution: fixed
Status: acceptedclosed

In 20827d1bc/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:3 by Roland Ernst <rcrernst@…>, 6 years ago

In 9337b830c/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available
Note: See TracTickets for help on using tickets.