From 91ff83e5066e8ab262b1c1ae6d71acf46763ca84 Mon Sep 17 00:00:00 2001 From: Justin Vieira Date: Wed, 29 May 2019 11:21:20 -0400 Subject: [PATCH] Update to use pyyaml safe_load(), as load() is unsafe and disabled on some systems --- AUTHORS | 1 + src/escpos/capabilities.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 6000080..af7e937 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,6 +11,7 @@ Dmytro Katyukha Gerard Marull-Paretas Hark Joel Lehtonen +Justin Vieira kennedy Kristi ldos diff --git a/src/escpos/capabilities.py b/src/escpos/capabilities.py index 0cf76e1..c4b6ab5 100644 --- a/src/escpos/capabilities.py +++ b/src/escpos/capabilities.py @@ -38,7 +38,7 @@ else: if full_load: logger.debug('Loading and pickling capabilities') with open(capabilities_path) as cp, open(pickle_path, 'wb') as pp: - CAPABILITIES = yaml.load(cp) + CAPABILITIES = yaml.safe_load(cp) pickle.dump(CAPABILITIES, pp, protocol=2) logger.debug('Finished loading capabilities took %.2fs', time.time() - t0)