DeprecationWarning on md5

Discussion in 'Python' started by Zeynel, Nov 19, 2009.

  1. Zeynel

    Zeynel Guest

    Hello,

    I am a newbie both in Scrapy and Python. When I create a project with
    Scrapy I get these errors:

    C:\Python26\lib\site-packages\twisted\python\filepath.py:12:
    DeprecationWarning: the sha module is deprecated; use the hashlib
    module instead import sha
    C:\Python26\lib\site-packages\twisted\spread\pb.py:30:
    DeprecationWarning: the md5 module is deprecated; use hashlib instead
    import md5
    C:\Python26\lib\site-packages\twisted\mail\smtp.py:10:
    DeprecationWarning: the MimeWriter module is deprecated; use the email
    package instead

    I found several references to this "bug" but I could not understand
    how to fix it. Can anyone help?

    Thanks
     
    Zeynel, Nov 19, 2009
    #1
    1. Advertising

  2. Zeynel

    Chris Rebert Guest

    On Wed, Nov 18, 2009 at 5:23 PM, Zeynel <> wrote:
    > Hello,
    >
    > I am a newbie both in Scrapy and Python. When I create a project with
    > Scrapy I get these errors:
    >
    > C:\Python26\lib\site-packages\twisted\python\filepath.py:12:
    > DeprecationWarning: the sha module is deprecated; use the hashlib
    > module instead import sha
    > C:\Python26\lib\site-packages\twisted\spread\pb.py:30:
    > DeprecationWarning: the md5 module is deprecated; use hashlib instead
    > import md5
    > C:\Python26\lib\site-packages\twisted\mail\smtp.py:10:
    > DeprecationWarning: the MimeWriter module is deprecated; use the email
    > package instead
    >
    > I found several references to this "bug" but I could not understand
    > how to fix it. Can anyone help?


    This is a "bug" in the version of Twisted you're using. What Python is
    saying is that Twisted is using some modules from the Python stdlib
    that are deprecated and will be removed in some future version of
    Python, thus Twisted will /eventually/ need to be changed to use the
    newer replacement library.
    However, this is only a warning, not an error; the code will run just
    fine until you update to the eventual Python version that removed said
    deprecated libraries (by which time a new Twisted version will
    probably be available with the necessary fixes made).

    So, basically you can safely ignore the warnings, unless you want to
    custom-patch your Twisted installation, which I wouldn't particularly
    recommend.
    It's also entirely possible your Twisted is outdated and a new version
    fixed to avoid using the deprecated modules is already available.

    If you want to suppress the output of the warnings, see the docs for
    the `warnings` module:
    http://docs.python.org/library/warnings.html

    Cheers,
    Chris
    --
    http://blog.rebertia.com
     
    Chris Rebert, Nov 19, 2009
    #2
    1. Advertising

  3. Zeynel

    Zeynel Guest

    Thanks. I tried the suppress it but no success. I need to read the
    documentation more carefully. But since this is not error, I will
    ignore them for now.


    On Nov 18, 9:12 pm, Chris Rebert <> wrote:
    > On Wed, Nov 18, 2009 at 5:23 PM, Zeynel <> wrote:
    > > Hello,

    >
    > > I am a newbie both in Scrapy and Python. When I create a project with
    > > Scrapy I get these errors:

    >
    > > C:\Python26\lib\site-packages\twisted\python\filepath.py:12:
    > > DeprecationWarning: the sha module is deprecated; use the hashlib
    > > module instead import sha
    > > C:\Python26\lib\site-packages\twisted\spread\pb.py:30:
    > > DeprecationWarning: the md5 module is deprecated; use hashlib instead
    > > import md5
    > > C:\Python26\lib\site-packages\twisted\mail\smtp.py:10:
    > > DeprecationWarning: the MimeWriter module is deprecated; use the email
    > > package instead

    >
    > > I found several references to this "bug" but I could not understand
    > > how to fix it. Can anyone help?

    >
    > This is a "bug" in the version of Twisted you're using. What Python is
    > saying is that Twisted is using some modules from the Python stdlib
    > that are deprecated and will be removed in some future version of
    > Python, thus Twisted will /eventually/ need to be changed to use the
    > newer replacement library.
    > However, this is only a warning, not an error; the code will run just
    > fine until you update to the eventual Python version that removed said
    > deprecated libraries (by which time a new Twisted version will
    > probably be available with the necessary fixes made).
    >
    > So, basically you can safely ignore the warnings, unless you want to
    > custom-patch your Twisted installation, which I wouldn't particularly
    > recommend.
    > It's also entirely possible your Twisted is outdated and a new version
    > fixed to avoid using the deprecated modules is already available.
    >
    > If you want to suppress the output of the warnings, see the docs for
    > the `warnings` module:http://docs.python.org/library/warnings.html
    >
    > Cheers,
    > Chris
    > --http://blog.rebertia.com
     
    Zeynel, Nov 19, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pierre Rouleau
    Replies:
    7
    Views:
    382
    David Bolen
    Oct 6, 2003
  2. Tim Peters
    Replies:
    2
    Views:
    406
    Pierre Rouleau
    Oct 3, 2003
  3. Tim Peters
    Replies:
    1
    Views:
    341
    Pierre Rouleau
    Oct 3, 2003
  4. Replies:
    9
    Views:
    17,203
    John Salerno
    May 8, 2006
  5. Peter Woodsky

    create a md5 / md5 passwd with a salt

    Peter Woodsky, Nov 20, 2008, in forum: Ruby
    Replies:
    6
    Views:
    240
    Brian Candler
    Nov 21, 2008
Loading...

Share This Page