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

Resolve #926 #927

Merged
merged 5 commits into from
Nov 15, 2015
Merged

Resolve #926 #927

merged 5 commits into from
Nov 15, 2015

Conversation

maxpowa
Copy link
Contributor

@maxpowa maxpowa commented Nov 2, 2015

Also cleaned up dict value retrieval a little, the .get() calls were a bit unnecessary.

Also cleaned up dict value retrieval a little, the .get() calls were a bit unnecessary.
@dgw
Copy link
Member

dgw commented Nov 2, 2015

Should probably be squashed into a single commit that says "Removed feedparser dependency (closes #926)" or something like that. But 👍

@maxpowa
Copy link
Contributor Author

maxpowa commented Nov 2, 2015

But muh commiting from github web

@dgw
Copy link
Member

dgw commented Nov 2, 2015

That sounds painful lol

@embolalia
Copy link
Contributor

The get calls are necessary, because the result will not always have those keys in it. get will return None, rather than raising a KeyError.

@maxpowa
Copy link
Contributor Author

maxpowa commented Nov 14, 2015

Ah good call, didn't even think about that. Should I edit this PR or create a new one to add them back in?

@embolalia
Copy link
Contributor

You can just edit this one. Thanks!

There's some places where there were already try catch blocks for KeyError, so I left those ones.
@embolalia
Copy link
Contributor

I got this exception while testing this with .weather new york, ny:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/xmltodict.py", line 246, in parse
    parser.ParseFile(xml_input)
TypeError: argument must have 'read' attribute

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/embo/src/willie/sopel/bot.py", line 262, in call
    exit_code = func(sopel, trigger)
  File "/home/embo/src/willie/sopel/modules/weather.py", line 147, in weather
    parsed = xmltodict.parse(url).get('rss')
  File "/usr/local/lib/python3.4/dist-packages/xmltodict.py", line 248, in parse
    parser.Parse(xml_input, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 5

@maxpowa
Copy link
Contributor Author

maxpowa commented Nov 15, 2015

Yeaaaah, don't ask how that one slipped through.

embolalia added a commit that referenced this pull request Nov 15, 2015
@embolalia embolalia merged commit 5c94984 into sopel-irc:master Nov 15, 2015
@embolalia
Copy link
Contributor

Thanks!

@maxpowa maxpowa deleted the patch-2 branch November 16, 2015 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants