From 47b4d41b28b37348a09f8e2d2c05203be3f777ff Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Sun, 13 May 2018 18:51:38 +0200 Subject: [PATCH] use package for tempdir cherry-picked from 8494cca526af7ae86af6ed1303224bbb229054ac in #274 --- .mailmap | 1 + src/escpos/capabilities.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index 79b93c4..5b909f6 100644 --- a/.mailmap +++ b/.mailmap @@ -8,6 +8,7 @@ Cody (Quantified Code Bot) Cody Renato.Lorenzi Ahmed Tahri TAHRI Ahmed Michael Elsdörfer Michael Elsdörfer +Juanmi Taboada Juanmi Taboada csoft2k Sergio Pulgarin reck31 diff --git a/src/escpos/capabilities.py b/src/escpos/capabilities.py index c3f718b..9272c01 100644 --- a/src/escpos/capabilities.py +++ b/src/escpos/capabilities.py @@ -7,12 +7,12 @@ import time import six import yaml +from tempfile import gettempdir logging.basicConfig() logger = logging.getLogger(__name__) - -pickle_dir = environ.get('ESCPOS_CAPABILITIES_PICKLE_DIR', '/tmp/') +pickle_dir = environ.get('ESCPOS_CAPABILITIES_PICKLE_DIR', gettempdir()) pickle_path = path.join(pickle_dir, 'capabilities.pickle') capabilities_path = environ.get( 'ESCPOS_CAPABILITIES_FILE',