Merge lp:~max-rabkin/ibid/weather-unicode-898058 into lp:ibid

Proposed by Max Rabkin
Status: Merged
Approved by: Stefano Rivera
Approved revision: 1042
Merged at revision: 1043
Proposed branch: lp:~max-rabkin/ibid/weather-unicode-898058
Merge into: lp:ibid
Diff against target: 15 lines (+4/-1)
1 file modified
ibid/plugins/geography.py (+4/-1)
To merge this branch: bzr merge lp:~max-rabkin/ibid/weather-unicode-898058
Reviewer Review Type Date Requested Status
Keegan Carruthers-Smith Approve
Stefano Rivera Approve
Review via email: mp+84507@code.launchpad.net

Commit message

encode place name in utf-8

To post a comment you must log in.
Revision history for this message
Stefano Rivera (stefanor) :
review: Approve
Revision history for this message
Keegan Carruthers-Smith (keegan-csmith) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/geography.py'
2--- ibid/plugins/geography.py 2011-11-20 14:59:09 +0000
3+++ ibid/plugins/geography.py 2011-12-05 17:33:26 +0000
4@@ -253,7 +253,10 @@
5 if place.lower() in self.places:
6 place = self.places[place.lower()]
7
8- soup = get_html_parse_tree('http://m.wund.com/cgi-bin/findweather/getForecast?brand=mobile_metric&query=' + quote(place))
9+ soup = get_html_parse_tree(
10+ 'http://m.wund.com/cgi-bin/findweather/getForecast?'
11+ + urlencode({'brand': 'mobile_metric',
12+ 'query': place.encode('utf-8')}))
13
14 if soup.body.center and soup.body.center.b.string == 'Search not found:':
15 raise Weather.WeatherException(u'City not found')

Subscribers

People subscribed via source and target branches

to all changes: