libmyth-python: Issue with national characters in filename
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mythtv (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
In MythTV/dataheap.py national characters in filename
causes an UnicodeEncodeError to be thrown in Video.open(),
in the statement:
return ftopen(
For me the problem can be fixed by ensuring that
the filename format string is unicode:
return ftopen(
The problem was actually experienced in mythvidexport.py,
from https:/
as modified in commit 0c6ebb4b78dd398
the fork https:/
The system had MythTV/dataheap.py installed from the
Ubuntu repositories from the package
libmyth-python 2:0.26.0+fixes.2012
mythtv@
2013-05-22 17:50:59.805274 I [16429] mythvidexport.py Using recording -- Wallander: Lækken - Svensk krimi fra 2009.Brændende biler og afspærrede motorveje. Ystad rammes af en række spektakulære røverier mod pengetransport
2013-05-22 17:50:59.824353 I [16429] mythvidexport.py Attempting TV export.
2013-05-22 17:51:00.014421 I [16429] mythvidexport.py Falling back to generic export.
2013-05-22 17:51:00.026309 I [16429] mythvidexport.py Import complete
2013-05-22 17:51:00.028494 I [16429] mythvidexport.py Copying myth://
2013-05-22 17:51:00.051557 I [16429] mythvidexport.py Checking for duplication of -- Wallander: Lækken - Svensk krimi fra 2009.Brændende biler og afspærrede motorveje. Ystad rammes af en række spektakulære røverier mod pengetransport
Traceback (most recent call last):
Traceback (most recent call last):
File "/usr/share/
main()
File "/usr/share/
export = VIDEO(opts)
File "/usr/share/
self.copy()
File "/usr/share/
dstfp = self.vid.open('w')
File "/usr/lib/
return ftopen(
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 19: ordinal not in range(128)
mythtv@
en_DK.UTF-8
Starting off in:
"Software should only work with Unicode strings internally,
converting to a particular encoding on output."
And noting that: "When it comes to unicode filenames in python,
on Unix systems, there will only be a filesystem encoding
if you’ve set the LANG or LC_CTYPE environment variables;
if you haven’t, the default encoding is ASCII.
When opening a file for reading or writing,
you can usually just provide the Unicode string as
the filename, and it will be automatically converted
to the right encoding for you."
I ended up believing that using an unicode format string
might be the right solution.