推荐学习书目
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 · 3868 views
    This topic created in 4350 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   ·   Solana   ·   3207 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 11:30 · PVG 19:30 · LAX 04:30 · JFK 07:30
    ♥ Do have faith in what you're doing.