Ugh. Fix the new MessagePack serialiser to interface reliably with the msgpack library (gotta pass some flags and stuff) - also, actually depend on msgpack to make sure we have it

This commit is contained in:
Danielle McLean 2018-05-28 21:33:20 +10:00
parent 8d4444cfb9
commit 142e3eff2b
Signed by: 00dani
GPG key ID: 8EB789DDF3ABD240
3 changed files with 21 additions and 5 deletions

View file

@ -47,6 +47,7 @@ django-extensions = "*"
python-magic = "*" python-magic = "*"
pyup-django = "*" pyup-django = "*"
"jinja2" = "*" "jinja2" = "*"
msgpack = "*"
[dev-packages] [dev-packages]
ptpython = "*" ptpython = "*"

21
Pipfile.lock generated
View file

@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "a0fb5f4752579f5f354d4b55ffcf07ed67d716895e6f52b954c576b4424acaf5" "sha256": "dc9793063aa93db7b1b234778ef59289586a037dab65506c477f4e50ca5dc6df"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {
@ -461,10 +461,25 @@
"index": "pypi", "index": "pypi",
"version": "==0.5.0" "version": "==0.5.0"
}, },
"msgpack-python": { "msgpack": {
"hashes": [ "hashes": [
"sha256:378cc8a6d3545b532dfd149da715abae4fda2a3adb6d74e525d0d5e51f46909b" "sha256:0b3b1773d2693c70598585a34ca2715873ba899565f0a7c9a1545baef7e7fbdc",
"sha256:0bae5d1538c5c6a75642f75a1781f3ac2275d744a92af1a453c150da3446138b",
"sha256:0ee8c8c85aa651be3aa0cd005b5931769eaa658c948ce79428766f1bd46ae2c3",
"sha256:1369f9edba9500c7a6489b70fdfac773e925342f4531f1e3d4c20ac3173b1ae0",
"sha256:22d9c929d1d539f37da3d1b0e16270fa9d46107beab8c0d4d2bddffffe895cee",
"sha256:2ff43e3247a1e11d544017bb26f580a68306cec7a6257d8818893c1fda665f42",
"sha256:31a98047355d34d047fcdb55b09cb19f633cf214c705a765bd745456c142130c",
"sha256:8767eb0032732c3a0da92cbec5ac186ef89a3258c6edca09161472ca0206c45f",
"sha256:8acc8910218555044e23826980b950e96685dc48124a290c86f6f41a296ea172",
"sha256:ab189a6365be1860a5ecf8159c248f12d33f79ea799ae9695fa6a29896dcf1d4",
"sha256:cfd6535feb0f1cf1c7cdb25773e965cc9f92928244a8c3ef6f8f8a8e1f7ae5c4",
"sha256:e274cd4480d8c76ec467a85a9c6635bbf2258f0649040560382ab58cabb44bcf",
"sha256:f86642d60dca13e93260187d56c2bef2487aa4d574a669e8ceefcf9f4c26fd00",
"sha256:f8a57cbda46a94ed0db55b73e6ab0c15e78b4ede8690fa491a0e55128d552bb0",
"sha256:fcea97a352416afcbccd7af9625159d80704a25c519c251c734527329bb20d0e"
], ],
"index": "pypi",
"version": "==0.5.6" "version": "==0.5.6"
}, },
"packaging": { "packaging": {

View file

@ -5,7 +5,7 @@ from django_redis.serializers.base import BaseSerializer
class MSGPackModernSerializer(BaseSerializer): class MSGPackModernSerializer(BaseSerializer):
def dumps(self, value): def dumps(self, value):
return msgpack.dumps(value) return msgpack.packb(value, use_bin_type=True)
def loads(self, value): def loads(self, value):
return msgpack.loads(value) return msgpack.unpackb(value, raw=False)