mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
ce0f709391
commit
fc0bbaf796
@ -65,10 +65,12 @@ def base_dir():
|
||||
_base_dir = tempfile.mkdtemp(prefix=prefix, dir=base)
|
||||
atexit.register(remove_dir, _base_dir)
|
||||
|
||||
# Tell the tempfile module to in future always use our temp dir
|
||||
# This also means that it will return unicode paths, instead of
|
||||
# bytestrings. This is particularly important on windows.
|
||||
tempfile.tempdir = _base_dir
|
||||
try:
|
||||
tempfile.gettempdir()
|
||||
except:
|
||||
# Widows temp vars set to a path not encodable in mbcs
|
||||
# Use our temp dir
|
||||
tempfile.tempdir = _base_dir
|
||||
|
||||
return _base_dir
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user