Comments (4)
The library uses text memcache protocol, that's why keys and values are URF-8 encoded.
You can apply base64 encoding as a workaround.
from aiomcache.
I changed code to
resp = 'some message'
res = zlib.compress(resp.encode())
z = base64.b64encode(res)
mc = aiomcache.Client("slivei_memcached", 11211)
await mc.set(key, z, 60)
await mc.close()
but get an error:
'bytes' object has no attribute 'encode'
from aiomcache.
Indeed it hasn't. Convert z
into a str
.
from aiomcache.
It works, thanks a lot.
res = zlib.compress(an.encode())
z = base64.b64encode(z).decode()
from aiomcache.
Related Issues (20)
- get() actually issues "gets" command on the wire HOT 3
- aiomcache not support chinese bytes as a key HOT 1
- Drop python 3.4 support HOT 3
- Client does not support flags HOT 1
- Cannot await stats() HOT 6
- Example on using aiomcache for a cluster HOT 4
- Passing loop argument to asyncio.Queue is deprecated since Python 3.8 HOT 4
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- pytest 6 error Direct construction of Function has been deprecated, please use Function.from_parent. HOT 1
- [WinError 121] The semaphore timeout period has expired HOT 1
- Getting many errors when under load HOT 1
- Encryption via TLS HOT 1
- IndexError in get() HOT 2
- UNIX Socket Support HOT 1
- Please make it possible to run tests without Docker HOT 1
- Let's put `aiomcache` under the `aio-libs` org on PyPI
- Update all `secret: ` values in `.travis.yml` HOT 2
- connection does not close HOT 1
- [feature] add timeout support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiomcache.