mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-30 23:00:21 -04:00
ANother fix for #759
This commit is contained in:
parent
5cf66bc343
commit
86171e5f60
@ -55,6 +55,23 @@ def my_abspath(path, encoding=sys.getfilesystemencoding()):
|
|||||||
return res
|
return res
|
||||||
|
|
||||||
os.path.abspath = my_abspath
|
os.path.abspath = my_abspath
|
||||||
|
_join = os.path.join
|
||||||
|
def my_join(a, *p):
|
||||||
|
encoding=sys.getfilesystemencoding()
|
||||||
|
p = [a] + list(p)
|
||||||
|
_unicode = False
|
||||||
|
for i in p:
|
||||||
|
if isinstance(i, unicode):
|
||||||
|
_unicode = True
|
||||||
|
break
|
||||||
|
p = [i.encode(encoding) if isinstance(i, unicode) else i for i in p]
|
||||||
|
|
||||||
|
res = _join(*p)
|
||||||
|
if _unicode:
|
||||||
|
res = res.decode(encoding)
|
||||||
|
return res
|
||||||
|
|
||||||
|
os.path.join = my_join
|
||||||
|
|
||||||
def osx_version():
|
def osx_version():
|
||||||
if isosx:
|
if isosx:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user