[FIX] doesn't work in multi user env

1/ launch code with user A, a temp dir is create with user A
2/ launch code with user B --> permission denied
This commit is contained in:
Florent de Labarre 2023-07-21 12:55:25 +02:00
parent 756bf2c6c2
commit 74a912abce

View File

@ -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())
)