From 44f01a212bd0a464ced7d78664d55d01909ee1c2 Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Sun, 8 Oct 2017 20:31:59 +0200 Subject: [PATCH] fix docs failing due to pickle protocol in mixed env When executing a tox-run a pickle file will be created. If the docs are built after the py3 task, it will fail due to incompatible pickle-protocols. See https://stackoverflow.com/a/25843743/4244236 for reference. --- src/escpos/capabilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/escpos/capabilities.py b/src/escpos/capabilities.py index 979bfc7..177029c 100644 --- a/src/escpos/capabilities.py +++ b/src/escpos/capabilities.py @@ -38,7 +38,7 @@ 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) - pickle.dump(CAPABILITIES, pp) + pickle.dump(CAPABILITIES, pp, protocol=2) logger.debug('Finished loading capabilities took %.2fs', time.time() - t0)