[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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import time
import six import six
import yaml import yaml
from tempfile import gettempdir from tempfile import mkdtemp
import platform import platform
from typing import Any, Dict from typing import Any, Dict
@ -16,7 +16,7 @@ from typing import Any, Dict
logging.basicConfig() logging.basicConfig()
logger = logging.getLogger(__name__) 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_path = path.join(
pickle_dir, "{v}.capabilities.pickle".format(v=platform.python_version()) pickle_dir, "{v}.capabilities.pickle".format(v=platform.python_version())
) )