[mythtv-users] mythvidexport.py failing on one episode -- still the non-ascii bug?
Ian Evans
dheianevans at gmail.com
Thu May 17 19:10:57 UTC 2018
On Thu, May 17, 2018 at 2:45 PM, Jim <lists at morton.hrcoxmail.com> wrote:
> On 5/17/2018 1:25 PM, Ian Evans wrote:
>
>> On Wed, May 16, 2018 at 5:21 PM, Ian Evans <dheianevans at gmail.com
>> <mailto:dheianevans at gmail.com>> wrote:
>>
>> On Wed, May 16, 2018 at 4:46 PM, Nicolas Krzywinski
>> <myth2 at site7even.de <mailto:myth2 at site7even.de>> wrote:
>>
>> Am 15.05.2018 um 23:47 schrieb Ian Evans:
>>
>>>
>>> UnicodeEncodeError: 'ascii' codec can't encode character
>>> u'\xf1' in position 105: ordinal not in range(128)
>>> 2018-05-15 17:40:41.217882 D [23968] Python Database
>>> Connection database callback received -- 0x7f4c75b3e628
>>> 2018-05-15 17:40:41.218213 D [23968] Python Database
>>> Connection Releasing connection to pool
>>>
>>> Looking at github I see the script hasn't been updated in a
>>> few years. It's a great script but I don't know python.
>>> Anyway to patch it or should I just shrug and temporarily
>>> change the "Piñata" to "Pinata" and change it back after the
>>> export?
>>>
>>> Thanks.
>>>
>> Did you tried setting utf8 charset like this?
>>
>> PYTHONIOENCODING=utf-8 python /srv/bin/mythvidexport.py
>> --skiplist --listingonly --delete %JOBID%
>>
>>
>>
>> Took your suggestion and added PYTHONIOENCODING=utf-8 to the start
>> of the command line. Got the same result at the end of the logging:
>>
>> "UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1'
>> i"n position 105: ordinal not in range(128)"
>>
>>
>> A question about the error line about the ascii codec: is it being thrown
>> by is the error in line 428 of /usr/lib/python2.7/dist-packages/MythTV/logging.py
>> which is:
>>
>> message + (' -- {0}'.format(detail) if detail else '')))
>>
>> Assuming you meant 128 and not 428...
> 105 is the position of the character at issue. 128 is the range of ASCII
> characters (0-127) that the accented character is outside of.
>
> --
> Jim
>
>
>
No, I DID mean line 428 of logging.py as seen in the trace. Just curious is
that's the line that's causing the character in position 105 to trigger the
error. Forgot to include the line in my last message:
File "/usr/lib/python2.7/dist-packages/MythTV/logging.py", line 428, in
_logdatabase
message + (' -- {0}'.format(detail) if detail else '')))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in
position 105: ordinal not in range(128)
For completeness in the thread, here's the full traceback:
2018-05-15 17:40:41.157089 D [23968] Python Database Connection Acquiring
connection from pool
Traceback (most recent call last):
File "/usr/share/mythtv/mythvidexport.py", line 437, in <module>
main()
File "/usr/share/mythtv/mythvidexport.py", line 409, in main
export = VIDEO(opts)
File "/usr/share/mythtv/mythvidexport.py", line 77, in __init__
self.copy()
File "/usr/share/mythtv/mythvidexport.py", line 236, in copy
dstfp = self.vid.open('w', nooverwrite=True)
File "/usr/lib/python2.7/dist-packages/MythTV/dataheap.py", line 980, in
open
mode, False, nooverwrite, self._db)
File "/usr/lib/python2.7/dist-packages/MythTV/mythproto.py", line 297, in
ftopen
sg.dirname+filename)
File "/usr/lib/python2.7/dist-packages/MythTV/logging.py", line 431, in
__call__
self.log(mask, level, message, detail)
File "/usr/lib/python2.7/dist-packages/MythTV/logging.py", line 377, in
log
self._logdatabase(mask, level, message, detail)
File "/usr/lib/python2.7/dist-packages/MythTV/logging.py", line 428, in
_logdatabase
message + (' -- {0}'.format(detail) if detail else '')))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in
position 105: ordinal not in range(128)
2018-05-15 17:40:41.217882 D [23968] Python Database Connection database
callback received -- 0x7f4c75b3e628
2018-05-15 17:40:41.218213 D [23968] Python Database Connection Releasing
connection to pool
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20180517/7941a6cb/attachment.html>
More information about the mythtv-users
mailing list