Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

md5 module error

I'm using an older version of PLY that uses the md5 module (among others):

import re, types, sys, cStringIO, md5, os.path

... although the script runs but not without this error:

DeprecationWarning: the md5 module is deprecated; use hashlib instead

How do I fix it so the error goes away?

Thanks

like image 472
eozzy Avatar asked Jan 18 '10 07:01

eozzy


2 Answers

I think the warning message is quite straightforward. You need to:

from hashlib import md5

or you can use python < 2.5, http://docs.python.org/library/md5.html

like image 105
Dyno Fu Avatar answered Sep 20 '22 07:09

Dyno Fu


That's not an error, that's a warning.

If you still insist on getting rid of it then modify the code so that it uses hashlib instead.

like image 35
Ignacio Vazquez-Abrams Avatar answered Sep 22 '22 07:09

Ignacio Vazquez-Abrams