Merge branch 'no-prefered-xml-parser'
authorW. Trevor King <wking@tremily.us>
Sat, 14 Sep 2013 15:47:16 +0000 (08:47 -0700)
committerW. Trevor King <wking@tremily.us>
Sat, 14 Sep 2013 15:47:16 +0000 (08:47 -0700)
* no-prefered-xml-parser:
  feed: Disable feedparser's PREFERRED_XML_PARSERS

Signed-off-by: W. Trevor King <wking@tremily.us>
1  2 
rss2email/feed.py

diff --combined rss2email/feed.py
index 3d9654f53243add7c53a14632a62e38af70e97d9,41ede76cbd787b2bd57457545c3b7ce7c9275145..164369dea6334b72543f081e504eb9dfb53fe765
@@@ -64,6 -64,10 +64,10 @@@ for e in ['error', 'herror', 'gaierror'
  del e  # cleanup namespace
  _SOCKET_ERRORS = tuple(_SOCKET_ERRORS)
  
+ # drv_libxml2 raises:
+ #   TypeError: 'str' does not support the buffer interface
+ _feedparser.PREFERRED_XML_PARSERS = []
  
  class Feed (object):
      """Utility class for feed manipulation and storage.
          elif isinstance(exc, _sax.SAXParseException):
              _LOG.error('sax parsing error: {}: {}'.format(exc, self))
              warned = True
 +        elif (parsed.bozo and
 +              isinstance(exc, _feedparser.CharacterEncodingOverride)):
 +            _LOG.warning(
 +                'incorrectly declared encoding: {}: {}'.format(exc, self))
 +            warned = True
          elif parsed.bozo or exc:
              if exc is None:
                  exc = "can't process"