2010/10/19 David Coppa <[email protected]>:
> On Tue, Oct 19, 2010 at 2:30 PM, Tasmanian Devil
> <[email protected]> wrote:
>> Hello, list!
>>
>> Since the upgrade to Python 2.6 sysutils/tentakel shows these warnings
>> above the usual output:
>>
>>
>> /usr/local/lib/python2.6/site-packages/lekatnet/config.py:55:
>> DeprecationWarning: The popen2 module is deprecated.  Use the
>> subprocess module.
>>  import popen2
>> /usr/local/lib/python2.6/site-packages/lekatnet/plugins/rsh.py:29:
>> DeprecationWarning: the md5 module is deprecated; use hashlib instead
>>  import md5
>>
>>
>> So I searched a bit on the web and found a way to suppress these
>> warnings. I don't know anything about Python unfortunately, so my
>> patch might not be correct or the location where I add the code
>> (config.py) might be wrong, but so far it works just fine for me.
>
> You're only suppressing the warnings, not fixing the code in the right way.

Yes, I thought about that, but I think as long as there's Python 2.6,
the deprecated modules are still there, so it's ok for now and doesn't
involve learning Python... ;-)

> For md5 is simple:
>
> try:
>    from hashlib import md5
> except ImportError:
>    from md5 import new as md5
>
> Replacing popen2.popen3 with subprocess.Popen is a little more
> complicated, but it's full of examples out there...
>
> ciao,
> david
>

Reply via email to