Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RSS] Throws error on fetch #449

Closed
walliski opened this issue Feb 11, 2014 · 4 comments
Closed

[RSS] Throws error on fetch #449

walliski opened this issue Feb 11, 2014 · 4 comments
Labels
Bug Things to squish; generally used for issues

Comments

@walliski
Copy link

When trying to .rss fetch with http://www.teamfortress.com/rss.xml as URL for a feed, the bot gives the following error:

 Traceback (most recent call last):
   File "/usr/local/lib/python2.7/dist-packages/willie/bot.py", line 719, in     call
     exit_code = func(willie, trigger)
   File "/home/%USERNAME%/.willie/modules/rss.py", line 129, in manage_rss
     bot.memory['rss_manager'].manage_rss(bot, trigger)
   File "/home/%USERNAME%/.willie/modules/rss.py", line 161, in manage_rss
     if getattr(self, '_rss_' + text[1])(bot, trigger, conn.cursor()):
   File "/home/%USERNAME%/.willie/modules/rss.py", line 337, in _rss_fetch
     read_feeds(bot, True)
   File "/home/%USERNAME%/.willie/modules/rss.py", line 413, in read_feeds
     feed.name, fp.bozo_exception.getMessage()), 'warning')
 AttributeError: 'CharacterEncodingOverride' object has no attribute             'getMessage'

It might be specific to the Teamfortress feed, but what makes it want to throw an error, and why doesn't it succeed?

@tyrope tyrope added the Bug label Mar 7, 2014
@d0cx
Copy link

d0cx commented May 10, 2014

I'm having this exact issue

@d0cx
Copy link

d0cx commented May 10, 2014

#534

@d0cx
Copy link

d0cx commented May 10, 2014

After digging the code myself last night, I was able to make the feeds I was having issue with to work. I simply commented out the lines belonging to the bozo_exception check, which are from 412 thru 417, and then the feeds worked.

Not the prettiest thing, but a least the feeds started working.

@walliski
Copy link
Author

I haven't had time to look at it myself... But I think this might have something to do with it:
if character encoding is wrong, try several common ones before falling back to regexes (if this works, bozo_exception is set to CharacterEncodingOverride

And then I gave up and did a similar approach as d0cx. Added a "try" that catches AttributeError...

maxpowa pushed a commit to maxpowa/Inumuta that referenced this issue Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Things to squish; generally used for issues
Projects
None yet
Development

No branches or pull requests

3 participants