1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-08-24 09:03:34 +00:00

[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
This commit is contained in:
Florent de Labarre
2023-07-21 22:10:29 +02:00
committed by GitHub
parent 756bf2c6c2
commit cb3f4e856b

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