PlanetPlanet

共1篇文章。

PlanetPlanet vs Python 2.6

• Development

On Python 2.6 we have a new hashlib module, which superseded older md5 and sha1 modules.

Therefore, importing md5 would give the following warning:

DeprecationWarning: the md5 module is deprecated; use hashlib instead

This is quite annoying if you run PlanetPlanet in a cron(8) job and receive e-mail reports. In order to solve that, we can do some simple sed(1) replace over PlanetPlanet’s __init__.py:

s/import md5/import hashlib/g
s/md5\.new/hashlib.md5/g

That’s it! And PlanetPlanet will now happily work with Python 2.6.

参与评论