Skip to content

Commit 89f1bfb

Browse files
yan12125Chih-Hsuan Yen
authored andcommitted
Make v4 cache compatible with msgpack 1.0 in the future
The `encoding` parameter in `msgpack.loads` is deprecated and will be removed in msgpack 1.0 [1]. Note that the `raw` parameter was called `raw_as_bytes` before 0.5.2 [2]. I add the version constraint to avoid API incompatibilities. [1] msgpack/msgpack-python#191 [2] msgpack/msgpack-python@5569a4e
1 parent c9db69c commit 89f1bfb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cachecontrol/serialize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def _loads_v3(self, request, data):
181181

182182
def _loads_v4(self, request, data):
183183
try:
184-
cached = msgpack.loads(data, encoding="utf-8")
184+
cached = msgpack.loads(data, raw=False)
185185
except ValueError:
186186
return
187187

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
include_package_data=True,
1818
description="httplib2 caching for requests",
1919
long_description=long_description,
20-
install_requires=["requests", "msgpack"],
20+
install_requires=["requests", "msgpack>=0.5.2"],
2121
extras_require={"filecache": ["lockfile>=0.9"], "redis": ["redis>=2.10.5"]},
2222
entry_points={"console_scripts": ["doesitcache = cachecontrol._cmd:main"]},
2323
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",

0 commit comments

Comments
 (0)