[mythtv-users] Errors from myhproto when using mythvidexport.py

Roland Ernst rcrernst at gmail.com
Tue Aug 25 20:04:53 UTC 2020


On Tue, Aug 25, 2020 at 4:49 PM Jay Harbeston <jharbestonus at gmail.com>
wrote:

>
>
> On Aug 25, 2020, at 6:18 AM, Roland Ernst <rcrernst at gmail.com> wrote:
>
>
> On Tue, Aug 25, 2020 at 11:48 AM Stephen Worthington <
> stephen_agent at jsw.gen.nz> wrote:
>
>> On Mon, 24 Aug 2020 13:25:27 -0400, you wrote:
>>
>> >
>> >Any ideas where I need to check? Or?
>> >
>>
>>
> This seems to be a leftover from the python3 conversion
> for mythtv v31+.
>
> If the storage groups of the recording and video is local,
> i.e.: on the same PC mythvidexport is running, please try
> the following:
>
> - locate the installed file mythproto.py from the Python
>   Bindings (mine is in the location below)
>
> - in terminal, run the following commands
>   (change the path to mythproto.patch)
>
> {{{
> $ cd /usr/lib/python3/dist-packages/MythTV/
> $ ls ./mythproto.py
> $ sudo cp ./mythproto.py ./mythproto.org
> $ sudo patch < /path/to/mythproto.patch
> $ sudo python3 -m compileall ./mythproto.py
> }}}
>
> Note, that this will be overwritten again when updating
> mythtv.
>
> Please report back the result.
> On success, I will update the Python Bindings asap.
>
>
>
> I found earlier that I needed to add a ‘/‘ between the path and the file
> name to avoid the error below.  I tried setting the path with a leading ‘/‘
> to avoid the issue, but that didn’t work as the ‘/‘ was stripped off
> earlier.
>
>     FileNotFoundError: [Errno 2] No such file or directory:
> '/var/lib/mythtv/recordings44303_20200811220000.mp4’
>
>
> I tweaked the open statement to put in +’/‘ immediately after the
> sg.dirname to add the ‘/‘  separator and it works great!
>
> If you can add the directory separator into the code somewhere, all will
> be good!
>
> Thanks!
>
> Jay
>
>
You are describing two different failures / bugs:

1) The trailing path separator is missing on some entries in the
storagegroup :
Please post the output of
{{{
MariaDB [mythconverg]> select * from storagegroup;
}}}
Until v.30, all storage group entries had a trailing slash ('/') in the
database.
My test setup for v31 shows a mixed scenario, with and without trailing
slashes.
Everything was set up by the 'mythtv-setup' program, no direct sql edits.
This would affect all mythtv versions, regardless if they use python2 or
python3.
Finding all occurrences of this missing separator inside the Python
Bindings could be a lot of work.
I do not know if php/mythweb and perl bindings are affected here, too.
The correct python fix will be something like
{{{
os.path.join(sg.dirname, filename)
}}}

2) Opening a file with the MythTV Python Bindings is not done in binary
mode.
This only affects python3 and mythtv v31+

Roland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20200825/179bbbdf/attachment.htm>


More information about the mythtv-users mailing list