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

Proposed by Max Rabkin on 2011-12-05
Status: Merged
Approved by: Stefano Rivera on 2011-12-13
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 on 2011-12-13
Stefano Rivera 2011-12-05 Approve on 2011-12-11
Review via email: mp+84507@code.launchpad.net

Commit message

encode place name in utf-8

To post a comment you must log in.
Stefano Rivera (stefanor) :
review: Approve
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: