推荐学习书目
› 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
maga
V2EX  ›  Python

MySQLdb driver 返回 utf8, 不返回 unicode 的一个坑

  •  
  •   maga · Jul 13, 2014 · 4125 views
    This topic created in 4466 days ago, the information mentioned may be changed or developed.
    之前用mysqldb 连接数据库,尽管用 charset='utf8', use_unicode=True 参数了,但driver返回还是utf8,不是python默认使用的unicode。发现原来这是<= 1.2.3版本的一个bug, 版本>=1.2.4 fix 这个bug.
    赶紧升级:
    pip install --upgrade MySQL-python


    问题找了很久,今天终于水落石出,立贴为证。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2339 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 09:13 · PVG 17:13 · LAX 02:13 · JFK 05:13
    ♥ Do have faith in what you're doing.