TMPDIR not random and more observed
tempfile module caches gettempdir() at startup, so we need to be explicit. refs #12
This commit is contained in:
parent
5b70da982a
commit
5c6f9b746f
1 changed files with 5 additions and 1 deletions
|
@ -40,7 +40,11 @@ class Larigira(object):
|
|||
|
||||
|
||||
def main():
|
||||
os.environ['TMPDIR'] = tempfile.mkdtemp(prefix='larigira')
|
||||
tempfile.tempdir = os.environ['TMPDIR'] = os.path.join(
|
||||
os.getenv('TMPDIR', '/tmp'),
|
||||
'larigira.%d' % os.getuid())
|
||||
if not os.path.isdir(os.environ['TMPDIR']):
|
||||
os.makedirs(os.environ['TMPDIR'])
|
||||
log_format = '%(asctime)s|%(levelname)s[%(name)s:%(lineno)d] %(message)s'
|
||||
logging.basicConfig(level=logging.DEBUG if get_conf()['DEBUG'] else logging.INFO,
|
||||
format=log_format,
|
||||
|
|
Loading…
Reference in a new issue