fix unicode problems (closes #624)

This commit is contained in:
Romain Bignon 2011-04-06 12:08:50 +02:00
commit 5e949f6426
2 changed files with 2 additions and 2 deletions

View file

@ -45,7 +45,7 @@ class MeteofranceBrowser(BaseBrowser):
BaseBrowser.__init__(self, *args, **kwargs)
def iter_city_search(self, pattern):
searchurl = self.CITY_SEARCH_URL.format(city_pattern=urllib.quote_plus(pattern))
searchurl = self.CITY_SEARCH_URL.format(city_pattern=urllib.quote_plus(pattern.encode('utf-8')))
self.location(searchurl)
if self.is_on_page(CityPage):

View file

@ -58,7 +58,7 @@ class YahooBackend(BaseBackend, ICapWeather):
# so i use a basic but efficient parsing
with self.browser:
content = self.browser.readurl((self.SEARCH_URL % pattern).replace(' ','+'))
content = self.browser.readurl((self.SEARCH_URL % pattern.encode('utf-8')).replace(' ','+'))
page=''
for line in content.split('\n'):