beznogno / pyicqt

Automatically exported from code.google.com/p/pyicqt
GNU General Public License v2.0
0 stars 0 forks source link

md5 and sha module will be deprecated in python 2.6 #149

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
/etc/init.d/pyicqt start
Starting PyICQ-t transport: 

/usr/share/pyicqt/src/avatar.py:9: DeprecationWarning: the sha module is 
deprecated; use the hashlib module instead
  import sha
/usr/share/pyicqt/src/tlib/oscar.py:23: DeprecationWarning: the md5 module 
is deprecated; use hashlib instead
  import md5

I propose to patch:

-import md5, sha
+try:
+    from hashlib import md5, sha1 as sha
+except ImportError:
+    from md5 import md5
+    from sha import sha

and:

- var=md5.new()
+ var=md5()

etc...

Original issue reported on code.google.com by m.surkiz on 22 Dec 2008 at 3:52

GoogleCodeExporter commented 9 years ago
Affected files:

pyicqt> find ./src -name '*.py' |xargs grep 'import md5'
./src/tlib/oscar.py:import md5
./src/legacy/buddies.py:import md5
./src/legacy/glue.py:import md5
./src/legacy/icqt.py:import md5

pyicqt> find ./src -name '*.py' |xargs grep 'import sha'
./src/avatar.py:import sha
./src/contact.py:import sha
./src/twistfix/words/xish/xmlstream.py:    import sha

Original comment by m.surkiz on 22 Dec 2008 at 3:56

GoogleCodeExporter commented 9 years ago
I think prepare to Py3k still don't need. Currently only first set of a fixes 
for 2.6
branch available. It too raw yet

Original comment by r000ns...@gmail.com on 22 Dec 2008 at 4:03

GoogleCodeExporter commented 9 years ago
And yeah, Twisted shall rewritten to 2.6 first

Original comment by r000ns...@gmail.com on 22 Dec 2008 at 4:11

GoogleCodeExporter commented 9 years ago
Yes, but openSUSE 11.1 include python 2.6 by default and not have old version 
of 
package 

:-(

Original comment by m.surkiz on 22 Dec 2008 at 4:32

GoogleCodeExporter commented 9 years ago
May be possible install 2.5.2 from 11.0?

Original comment by r000ns...@gmail.com on 22 Dec 2008 at 4:44

GoogleCodeExporter commented 9 years ago
Deprecated not obsoleted. Deprecated should work.
I tested python 2.6.1 + pyicq 0.8.1beta3 + twisted 8.1.0 + zope.interface 3.5.0 
on
windows xp and it worked for me.
I had to update only zope.interface in my environment.
I believe pyicq should work on python 2.6.x without any regressions.

Original comment by maxim.br...@gmail.com on 22 Dec 2008 at 8:48

GoogleCodeExporter commented 9 years ago
> May be possible install 2.5.2 from 11.0?

I tried it, unfortunately did not succeed, because many packages in 
openSUSE_11.1 
depend on python >= 2.6 :(

> I had to update only zope.interface in my environment.

I do not understand what the link between the deprecated modules in python and 
zope.interface? 
r000nster, how do you think?

Original comment by m.surkiz on 23 Dec 2008 at 6:20

GoogleCodeExporter commented 9 years ago
[After some investigation]

Zope-interface used in Twisted. 

Maxim done testing of transport with Python 2.6.1 and his installation worked a 
one
day without any problems.

hashlib module was added in 2.5.
md5 and sha modules were deprecated since 2.5, and in 2.6 were added
DeprecationWarnings for them. These modules really removed only in 3.0. 

Therefore even removing of stable Python from SUSE distribution don't shall be a
problem for running of transport. Just ignore these warnings

Original comment by r000ns...@gmail.com on 23 Dec 2008 at 8:19

GoogleCodeExporter commented 9 years ago
Patch to fix deprecation warnings. I have not made it compatible with python 
2.4, but
I think that should be fine.

Original comment by hanno@hboeck.de on 7 Jun 2010 at 10:26

Attachments: