From ea0b016e7d3780e64995e36ac0a01e5d178e3f1f Mon Sep 17 00:00:00 2001 From: Chung Wu Date: Thu, 18 Jan 2018 20:42:06 -0800 Subject: [PATCH] rfoo._rfoo._dumps uses marshal.version == 2 When marshal.version used is >= 3, we would fail the `buffer[0] != INTEGER` check in the Connection class, and so this commit always uses marshal.version of 2, which is the latest version that passes the check (and also the default version used by Python 2). The latest marshal.version is 2 for Python 2, and up to Python 3.3. Starting with Python 3.4, the latest marshal.version is 4. --- rfoo/_rfoo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfoo/_rfoo.py b/rfoo/_rfoo.py index 255bb35..59541cd 100644 --- a/rfoo/_rfoo.py +++ b/rfoo/_rfoo.py @@ -103,7 +103,7 @@ INTEGER = 'i'.encode()[0] _loads = _marshal.loads -_dumps = _marshal.dumps +_dumps = lambda x: _marshal.dumps(x, 2)