PDA

View Full Version : python xmpp module deprecationWarning's



ja660k
June 29th, 2010, 09:59 AM
hey all, i downloaded python module 'xmpp' from apt-get
but when i try to use it... i get these warnings




/usr/lib/python2.6/dist-packages/xmpp/auth.py:24: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import sha,base64,random,dispatcher,re
/usr/lib/python2.6/dist-packages/xmpp/auth.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5



what should be done?
should i just get the newest source for 'xmpp'?

km0r3
June 30th, 2010, 12:47 AM
hey all, i downloaded python module 'xmpp' from apt-get
but when i try to use it... i get these warnings




/usr/lib/python2.6/dist-packages/xmpp/auth.py:24: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import sha,base64,random,dispatcher,re
/usr/lib/python2.6/dist-packages/xmpp/auth.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5



what should be done?
should i just get the newest source for 'xmpp'?

Actually, those warnings do not mean that something is really broken. They are just warnings.

In this case those warnings tell you that the modules are deprecated because you're using the `md5` module, but there's the `hashlib` library which is better.
Unless you don't have the standard Python interpreter everything should still work.

I think it's safe to say, that you can ignore those messages at the moment.

StephenF
June 30th, 2010, 03:04 AM
Actually, those warnings do not mean that something is really broken. They are just warnings.
I have first hand experience of once case where all functionality was gutted from a deprecated function.

-grubby
June 30th, 2010, 03:35 AM
I have first hand experience of once case where all functionality was gutted from a deprecated function.

In Python? I doubt it.

jpkotta
June 30th, 2010, 07:59 AM
In Python? I doubt it.

They're deprecated for a reason. They'll be removed eventually. Python 3.x has no sha or md5 module. I admire the fact that Python actually removes cruft.


hey all, i downloaded python module 'xmpp' from apt-get
but when i try to use it... i get these warnings




/usr/lib/python2.6/dist-packages/xmpp/auth.py:24: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import sha,base64,random,dispatcher,re
/usr/lib/python2.6/dist-packages/xmpp/auth.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5



what should be done?
should i just get the newest source for 'xmpp'?

You can prevent the messages with the following:


import warnings

with warnings.catch_warnings():
warnings.simplefilter("ignore", category=DeprecationWarning)
import xmpp