[mythtv-commits] Ticket #12642: Python binding socket UnicodeEncodeError
MythTV
noreply at mythtv.org
Sun Feb 7 02:53:57 UTC 2016
#12642: Python binding socket UnicodeEncodeError
-------------------------+-------------------------------------------------
Reporter: | Owner: wagnerrp
angela.schmid@… |
Type: Patch - | Status: new
Bug Fix |
Priority: minor | Milestone: unknown
Component: | Version: 0.28-beta
Bindings - Python | Keywords: python binding mythproto socket
Severity: medium | send
Ticket locked: 0 |
-------------------------+-------------------------------------------------
When using Lossless Cut, i receive the following python error when the
downloaded screenshot filename contains umlaut characters:
{{{
Traceback (most recent call last):
File "/usr/share/lossless_cut/lossless_cut.py", line 1831, in <module>
LOSSLESS_CUT.cut_video_file()
File "/usr/share/lossless_cut/lossless_cut.py", line 513, in
cut_video_file
self._lossless_cut()
File "/usr/share/lossless_cut/lossless_cut.py", line 1335, in
_lossless_cut
self.mythtvinterface.add_to_mythvideo()
File "/usr/share/lossless_cut/importcode/mythtvinterface.py", line 1364,
in add_to_mythvideo
self.vid.importMetadata(self.metadata)
File "/usr/local/lib/python2.7/dist-packages/MythTV/dataheap.py", line
1074, in importMetadata
getattr(self, image.type).downloadFrom(image.url)
File "/usr/local/lib/python2.7/dist-packages/MythTV/dataheap.py", line
104, in downloadFrom
be.downloadTo(url, self.imagetype, self)
File "/usr/local/lib/python2.7/dist-packages/MythTV/mythproto.py", line
726, in downloadTo
'DOWNLOAD_FILE', url, storagegroup, filename))).\
File "/usr/local/lib/python2.7/dist-packages/MythTV/mythproto.py", line
155, in backendCommand
return self._conn.command.backendCommand(data)
File "/usr/local/lib/python2.7/dist-packages/MythTV/connections.py",
line 295, in backendCommand
self.socket.sendheader(data)
File "/usr/local/lib/python2.7/dist-packages/MythTV/utility/other.py",
line 392, in sendheader
self.send(data, flags)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in
position 109: ordinal not in range(128)
}}}
Socket.send takes a string (not unicode).
When Socket.send is called with an unicode string it tries to convert it
with the ascii codec converter, resulting in an UnicodeEncodeError.
Before calling Socket.send the data has to be converted to a non-unicode
string (UTF-8 encoded).
--
Ticket URL: <https://code.mythtv.org/trac/ticket/12642>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list