From 5a81f4d1fcfecc20dc5f04fd5b2c26abca70655e Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Thu, 9 Dec 2010 13:09:01 -0600 Subject: [PATCH] fix spaces in city name --- modules/Weather.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/Weather.py b/modules/Weather.py index d0d42d6..4111646 100644 --- a/modules/Weather.py +++ b/modules/Weather.py @@ -22,6 +22,7 @@ import re from extlib import irclib from extlib import pywapi +from urllib import quote from urllib2 import URLError from Module import Module @@ -35,7 +36,7 @@ class Weather(Module): whats = what.split(' ') if whats[0] == "weather" and len(whats) >= 2: try: - google_weather = pywapi.get_weather_from_google(''.join(whats[1:])) + google_weather = pywapi.get_weather_from_google(quote(' '.join(whats[1:]))) city = google_weather['forecast_information']['city'].encode('utf-8') condition = google_weather['current_conditions']['condition'].encode('utf-8') temp_f = google_weather['current_conditions']['temp_f'].encode('utf-8')