V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
carsonlee32
V2EX  ›  Python

求救, Python2.x, zlib 库中解压字符串报错问题

  •  
  •   carsonlee32 · 2017-11-06 11:12:56 +08:00 · 2091 次点击
    这是一个创建于 2383 天前的主题,其中的信息可能已经有所发展或是发生改变。
    遇到了一个难题;
    今天用 python 读取 Redis 里的中文字符串后使用 zlib 解压,
    结果一直报 [ zlib.error: Error -3 while decompressing data: incorrect header check ] 这个错误,
    跪求 dalao 救命。

    ---------------------------------------乱入的分界线--------------------------------------------------------------------

    Redis 用 python 读取出来的 type 是 str,
    使用 encode 后再使用 decompress 报的错是 [ UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in range(128)]
    难道是 Redis 中存储错误?
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5336 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 01:15 · PVG 09:15 · LAX 18:15 · JFK 21:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.