[Kimchi-devel] [RFC] upgrade CherryPy version.

Zhou Zheng Sheng zhshzhou at linux.vnet.ibm.com
Mon Mar 3 10:01:55 UTC 2014


于 2014年03月03日 17:50, Sheldon 写道:
> Now there's a issue:
> https://github.com/kimchi-project/kimchi/issues/333
> 
> The reason of this issue is because high level cherrpy version make some
> change about set_response.
> 
> The high level cherrpy encode the unicode error message by itself.
> 
> So the kimchi do not encode the unicode error message any more.
> 
> It is right, the cherrpy should encode the unicode error message.
> 
> Now we can require the cherrypy version to solve this problem.
> 
> we can also check the cherrypy version in kimchi code as follow in order
> to avoid to require the cherrypy version.
> 
> like:
> if cherrypy.__version__ << 3.2.5:
> return res
> else:
> return res.encode("utf-8")
> 

Maybe it's better to use distutils.version

 from distutils.version import LooseVersion

 if LooseVersion(cherrypy.__version__) < LooseVersion('3.2.5'):
     blah
 else:
     blah

-- 
Thanks and best regards!

Zhou Zheng Sheng / 周征晟
E-mail: zhshzhou at linux.vnet.ibm.com
Telephone: 86-10-82454397




More information about the Kimchi-devel mailing list