mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -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)
|
_base_dir = tempfile.mkdtemp(prefix=prefix, dir=base)
|
||||||
atexit.register(remove_dir, _base_dir)
|
atexit.register(remove_dir, _base_dir)
|
||||||
|
|
||||||
# Tell the tempfile module to in future always use our temp dir
|
try:
|
||||||
# This also means that it will return unicode paths, instead of
|
tempfile.gettempdir()
|
||||||
# bytestrings. This is particularly important on windows.
|
except:
|
||||||
tempfile.tempdir = _base_dir
|
# Widows temp vars set to a path not encodable in mbcs
|
||||||
|
# Use our temp dir
|
||||||
|
tempfile.tempdir = _base_dir
|
||||||
|
|
||||||
return _base_dir
|
return _base_dir
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user