Comment 3 for bug 224686

Revision history for this message
John (jc453) wrote :

Attempting the same tests in a console reveal the problem to be here:

 def search(self, search_string):
        """
        Searchs Yahoo for location in search_string and returns list of tuples
        @param search_string String
        @return list(tuple(location_id String, PlaceName String))
        """
        response = self.find_weather_search_results_page(search_string)

        if response.status == 302:
            redirect_url = response.getheader('location', '')
            the_code = redirect_url[10:len(redirect_url)-5]

            the_placename = self.get_location_from_id(the_code)

            return [(the_code, the_placename)]
        else:
            return []

The actual response.status is 301, although simply changing the if statement to 301 does not fix it. I did not investigate it further.