我试图让我的应用程序运行带有 Unicode 字符的文件,但为此,您必须在它们之前解码。为此,我正在使用 ConfigObj.py。但是当我运行该应用程序时,出现以下错误:
Traceback (most recent call last):
File "GCW_Player.py", line 757, in <module>
epMEDIA ()
File "GCW_Player.py", line 89, in __ init__
self.keyhandler (event.key)
File "GCW_Player.py", line 133, in keyhandler
if key == K_RIGHT: self.k_goto ()
File "GCW_Player.py", line 211, in k_goto
self.go_to ()
File "GCW_Player.py", line 649, in go_to
self.list.generate (self.sec_ftypes)
File "/data/epm_core.py", line 114, in generate
inp = os.listdir (self.path)
TypeError: coercing to Unicode: need string or buffer, tuple found
下面,让app中对应的part文件:
def generate(self, filetypes):
self.data = []
inp = os.listdir(self.path)
inp.sort()
for line in inp:
file = File(os.path.join(self.path, line), filetypes)
if file.type != None:
self.data.append(file)
谁能帮我?我不知道在这种情况下该怎么办。我从来没有经历过这种情况。谢谢你。