mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-12 09:48:50 +01:00
except the python UnicodeDecodeError in Emulator
This commit is contained in:
parent
ce72585632
commit
ed8699d6d4
@ -129,8 +129,11 @@ class FavListPage(Page):
|
||||
stats = os.stat(v)
|
||||
if stats.st_gid != self._Parent._FavGID: ## only favs
|
||||
continue
|
||||
try:
|
||||
dirmap["gamedir"] = v.decode("utf8","ignore")
|
||||
except:
|
||||
dirmap["gamedir"] = v.decode("ascii","ignore")
|
||||
|
||||
dirmap["gamedir"] = v.decode("utf8")
|
||||
ret.append(dirmap)
|
||||
if os.path.isfile(v) and self._Emulator["FILETYPE"] == "file":
|
||||
stats = os.stat(v)
|
||||
@ -141,7 +144,11 @@ class FavListPage(Page):
|
||||
pieces = bname.split(".")
|
||||
if len(pieces) > 1:
|
||||
if pieces[ len(pieces)-1 ].lower() in self._Emulator["EXT"]:
|
||||
dirmap["file"] = v.decode("utf8")
|
||||
try:
|
||||
dirmap["file"] = v.decode("utf8","ignore")
|
||||
except:
|
||||
dirmap["file"] = v.decode("ascii","ignore")
|
||||
|
||||
ret.append(dirmap)
|
||||
|
||||
# else:
|
||||
|
||||
@ -143,7 +143,11 @@ class RomListPage(Page):
|
||||
continue
|
||||
|
||||
if FileExists(v+"/"+gameshell_bat):
|
||||
dirmap["gamedir"] = v.decode("utf8")
|
||||
try:
|
||||
dirmap["gamedir"] = v.decode("utf8","ignore")
|
||||
except:
|
||||
dirmap["gamedir"] = v.decode("ascii","ignore")
|
||||
|
||||
ret.append(dirmap)
|
||||
if os.path.isfile(v) and self._Emulator["FILETYPE"] == "file":
|
||||
stats = os.stat(v)
|
||||
@ -162,7 +166,11 @@ class RomListPage(Page):
|
||||
pieces = bname.split(".")
|
||||
if len(pieces) > 1:
|
||||
if pieces[ len(pieces)-1 ].lower() in self._Emulator["EXT"]:
|
||||
dirmap["file"] = v.decode("utf8")
|
||||
try:
|
||||
dirmap["file"] = v.decode("utf8","ignore")
|
||||
except:
|
||||
dirmap["file"] = v.decode("ascii","ignore")
|
||||
|
||||
ret.append(dirmap)
|
||||
# else:
|
||||
# print("not file or dir")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user