Python2.x中支持unicode的configparser

Python2.x中支持unicode的configparser

by cnDenis http://cndenis.iteye.com 2013年1月16日

Python2.x中许多内置模块不支持unicode,确实是很烦的事。configparser就是其中之一。

解决方法是使用Python3.x中configparser的backport,http://pypi.python.org/pypi/configparser,下载后解压,把其中的configparser.pyconfigparser_helpers.py放到你的代码所在文件夹中。然后在import时把

1
import ConfigParser

改成

1
import configparser

就可以了。

参考:http://bugs.python.org/issue11597

你可能感兴趣的:(unicode,python,configparser)