From cb3f4e856bc013507757cec0227a49407005fe9e Mon Sep 17 00:00:00 2001 From: Florent de Labarre Date: Fri, 21 Jul 2023 22:10:29 +0200 Subject: [PATCH] [FIX] doesn't work in multi user env (#532) 1/ launch code with user A, a temp dir is create with user A 2/ launch code with user B --> permission denied --- src/escpos/capabilities.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/escpos/capabilities.py b/src/escpos/capabilities.py index 02ae57b..4b31de8 100644 --- a/src/escpos/capabilities.py +++ b/src/escpos/capabilities.py @@ -8,7 +8,7 @@ import time import six import yaml -from tempfile import gettempdir +from tempfile import mkdtemp import platform from typing import Any, Dict @@ -16,7 +16,7 @@ from typing import Any, Dict logging.basicConfig() logger = logging.getLogger(__name__) -pickle_dir = environ.get("ESCPOS_CAPABILITIES_PICKLE_DIR", gettempdir()) +pickle_dir = environ.get("ESCPOS_CAPABILITIES_PICKLE_DIR", mkdtemp()) pickle_path = path.join( pickle_dir, "{v}.capabilities.pickle".format(v=platform.python_version()) )