mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
d58de47f0e
commit
df3896d585
@ -48,6 +48,18 @@ fcntl = None if iswindows else importlib.import_module('fcntl')
|
|||||||
|
|
||||||
filesystem_encoding = sys.getfilesystemencoding()
|
filesystem_encoding = sys.getfilesystemencoding()
|
||||||
if filesystem_encoding is None: filesystem_encoding = 'utf-8'
|
if filesystem_encoding is None: filesystem_encoding = 'utf-8'
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
if codecs.lookup(filesystem_encoding).name == 'ascii':
|
||||||
|
filesystem_encoding = 'utf-8'
|
||||||
|
# On linux, unicode arguments to os file functions are coerced to an ascii
|
||||||
|
# bytestring if sys.getfilesystemencoding() == 'ascii', which is
|
||||||
|
# just plain dumb. So issue a warning.
|
||||||
|
print ('WARNING: You do not have the LANG environment variable set. '
|
||||||
|
'This will cause problems with non-ascii filenames. '
|
||||||
|
'Set it to something like en_US.UTF-8.\n')
|
||||||
|
except:
|
||||||
|
filesystem_encoding = 'utf-8'
|
||||||
|
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user