[mythtv-users] Mythfs.py encoding and empty directory issues
Espen A. Fossen
espenaf at junta.no
Sun Apr 4 21:02:27 UTC 2010
Hi
Trying to get the mythfs.py script working. Have read all the posts in the dev
and users lists, and been doing a lot of trail en error. Unfortunately my
knowledge of python is rather limited, so debugging isn't going to well.
Running with the following:
python 2.6.5
mysql-python 1.2.3_rc1
fuse-python 0.2
gentoo 64 bit
mythtv-fixes-0.23 @ 23952
First of all, just basically running
python mythfs.py
Traceback (most recent call last):
File "mythfs.py", line 394, in <module>
main()
File "mythfs.py", line 390, in main
fs.prep()
File "mythfs.py", line 327, in prep
fmt = self.parser.largs[0].split(',',1)
IndexError: list index out of range
The command still functions so this isn't to important.
When trying to mount the Videos where one of the sub directories in the Videos
storage groups is empty, it gives me this error:
python mythfs.py Videos /mnt/mythtv -o ro,allow_other
Traceback (most recent call last):
File "mythfs.py", line 394, in <module>
main()
File "mythfs.py", line 390, in main
fs.prep()
File "mythfs.py", line 330, in prep
self.files.populate()
File "mythfs.py", line 83, in populate
for data,id in self.getData(full=True):
File "mythfs.py", line 209, in getData
files = self.walkSG('Videos')
File "mythfs.py", line 234, in walkSG
fdict.update(self.walkSG(group, MythBE(host[0], db=self.db)))
File "mythfs.py", line 241, in walkSG
fdict.update(self.walkSG(group, myth, base, ''))
File "mythfs.py", line 246, in walkSG
fdict.update(self.walkSG(group, myth, base, path+'/'+d))
File "mythfs.py", line 246, in walkSG
fdict.update(self.walkSG(group, myth, base, path+'/'+d))
File "mythfs.py", line 244, in walkSG
dirs, files, sizes = myth.getSGList(myth.hostname, group, base+'/'+path)
TypeError: 'int' object is not iterable
If i remove the directory or put something in it, it works.
When trying to mount my recordings I get this:
python ./mythfs.py Recordings,'%T/(%oY%-%om%-%od) %S' /mnt/mythtv/ -o
ro,allow_other
Traceback (most recent call last):
File "./mythfs.py", line 394, in <module>
main()
File "./mythfs.py", line 390, in main
fs.prep()
File "./mythfs.py", line 334, in prep
self.files.populate()
File "./mythfs.py", line 84, in populate
path = self.getPath(data)
File "./mythfs.py", line 267, in getPath
return data.formatPath(self.fmt, '-').encode('utf-8').\
File "/usr/lib64/python2.6/site-packages/MythTV/MythData.py", line 689, in
formatPath
tmp = str(self[data]).replace('/','-')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in position
6: ordinal not in range(128)
Looks like this might be related to my database previously having issues with
encoding, ref the whole UTF-8/latin1 encoding issues, especially on gentoo. I
know there might be some old recordings with some bad characters in the db.
The problem is that I don't know python that good enough to debug what data it
is failing on. I have tried setting MythLog._setlevel('all'), and setting
mysql to log all SQL's, but it still it's giving me a clue to where the error
is occurring.
Any help would be appreciated.
- Espen
More information about the mythtv-users
mailing list