Why doesn't "filterwarnings" suppress this message?

John Nagle nagle at animats.com
Fri Jan 29 03:41:54 EST 2010


    It turned out to be a loading order issue.  That message is generated
at import time, and "filterwarnings" hadn't been called yet.

					John Nagle

Peter Otten wrote:
> John Nagle wrote:
> 
>>     Feedparser isn't supported for Python 3.0, so in Python 2.6, many
>>     warning
>> messages appear.  I'm trying, in Python 2.6, to suppress the warning
>> message:
>>
>> ./feedparser\feedparser.py:69: DeprecationWarning:
>> the sgmllib module has been removed in Python 3.0
>> import sgmllib, re, sys, copy, urlparse, time, rfc822, types,
>> cgi, urllib, urllib2
>>
>> with this warning filter:
>>
>> warnings.filterwarnings(action='ignore',
>> category=DeprecationWarning, module='feedparser')
>>
>> The filter suppresses other deprecation warnings associated with
>> the feedparser module, but not that one.  How do I get rid of that
>> one?



More information about the Python-list mailing list