mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
38f86047cd
commit
34523ac958
@ -454,7 +454,14 @@ class DirContainer(object):
|
|||||||
path = os.path.join(self.rootdir, self._unquote(path))
|
path = os.path.join(self.rootdir, self._unquote(path))
|
||||||
except ValueError: #Happens if path contains quoted special chars
|
except ValueError: #Happens if path contains quoted special chars
|
||||||
return False
|
return False
|
||||||
|
try:
|
||||||
return os.path.isfile(path)
|
return os.path.isfile(path)
|
||||||
|
except UnicodeEncodeError:
|
||||||
|
# On linux, if LANG is unset, the os.stat call tries to encode the
|
||||||
|
# unicode path using ASCII
|
||||||
|
# To replicate try:
|
||||||
|
# LANG=en_US.ASCII python -c "import os; os.stat('Espa\xf1a')"
|
||||||
|
return os.path.isfile(path.encode(filesystem_encoding))
|
||||||
|
|
||||||
def namelist(self):
|
def namelist(self):
|
||||||
names = []
|
names = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user