# Buggy code
def get_all_possible_names(self, season=-1):
    """Get every possible variation of the name for a particular show.

    Includes indexer name, and any scene exception names, and country code
    at the end of the name (e.g. "Show Name (AU)".

    show: a Series object that we should get the names of
    Returns: all possible show names
    """
    show_names = {
        exception.series_name for exception in get_scene_exceptions(self, season)
    }
    show_names.add(self.name)

    new_show_names = set()

    if not self.is_anime:
        country_list = {}
        # add the country list
        country_list.update(countryList)
        # add the reversed mapping of the country list
        country_list.update({v: k for k, v in viewitems(countryList)})

        for name in show_names:
            if not name:
                continue

            # if we have "Show Name Australia" or "Show Name (Australia)"
            # this will add "Show Name (AU)" for any countries defined in
            # common.countryList (and vice versa)
            for country in country_list:
                pattern_1 = " {0}".format(country)
                pattern_2 = " ({0})".format(country)
                replacement = " ({0})".format(country_list[country])
                if name.endswith(pattern_1):
                    new_show_names.add(name.replace(pattern_1, replacement))
                elif name.endswith(pattern_2):
                    new_show_names.add(name.replace(pattern_2, replacement))

    return show_names.union(new_show_names)


# Traceback (AttributeError)
2018-04-22 19:13:13 DEBUG    FINDPROPERS :: [6d54662] Starting new thread: FINDPROPERS
2018-04-22 19:13:13 INFO     FINDPROPERS :: [6d54662] Beginning the search for new propers
2018-04-22 19:13:13 INFO     FINDPROPERS :: [6d54662] Using proper search days: 2
2018-04-22 19:13:13 INFO     FINDPROPERS :: [Rarbg] :: [6d54662] Searching for any new PROPER releases from Rarbg
2018-04-22 19:13:13 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] 295647: Setter sets location to E:\TV\Blindspot\Season 3\Blindspot.S03E18.PROPER.720p.HDTV.x264-KILLERS.mkv
2018-04-22 19:13:13 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] Checking if E:\TV\Blindspot\Season 3\Blindspot.S03E18.PROPER.720p.HDTV.x264-KILLERS.nfo exists: True
2018-04-22 19:13:13 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] Checking if E:\TV\Blindspot\Season 3\Blindspot.S03E18.PROPER.720p.HDTV.x264-KILLERS-thumb.jpg exists: True
2018-04-22 19:13:14 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] GET URL: http://torrentapi.org/pubapi_v2.php?get_token=get_token&amp;app_id=medusa&amp;format=json [Status: 200]
2018-04-22 19:13:14 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] User-Agent: Medusa/0.2.2 (Windows; 7; 83ab66f0-4626-11e8-99e3-001fd0d1e3a5)
2018-04-22 19:13:14 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] Search mode: Episode
2018-04-22 19:13:14 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] Search string: Blindspot S03E18 {{PROPER|REPACK|REAL|RERIP}}
2018-04-22 19:13:14 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] Searching only ranked torrents
2018-04-22 19:13:19 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] GET URL: http://torrentapi.org/pubapi_v2.php?sort=seeders&amp;min_leechers=0&amp;min_seeders=1&amp;search_tvdb=295647&amp;app_id=medusa&amp;search_string=Blindspot+S03E18+%7B%7BPROPER%7CREPACK%7CREAL%7CRERIP%7D%7D&amp;ranked=1&amp;category=tv&amp;format=json_extended&amp;token=l7huma64or&amp;limit=100&amp;mode=search [Status: 200]
2018-04-22 19:13:19 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] User-Agent: Medusa/0.2.2 (Windows; 7; 83ab66f0-4626-11e8-99e3-001fd0d1e3a5)
2018-04-22 19:13:19 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] Found result: Blindspot.S03E18.PROPER.HDTV.x264-KILLERS[rartv] with 1049 seeders and 271 leechers
2018-04-22 19:13:19 DEBUG    FINDPROPERS :: [Rarbg] :: [6d54662] Found result: Blindspot.S03E18.PROPER.720p.HDTV.x264-KILLERS[rartv] with 695 seeders and 99 leechers
2018-04-22 19:13:19 ERROR    FINDPROPERS :: [Rarbg] :: [6d54662] Exception generated: 'unicode' object has no attribute 'series_name'
Traceback (most recent call last):
File "C:\Medusa\medusa\scheduler.py", line 93, in run
self.action.run(self.force)
File "C:\Medusa\medusa\search\proper.py", line 67, in run
propers = self._get_proper_results()
File "C:\Medusa\medusa\search\proper.py", line 126, in _get_proper_results
cur_propers = cur_provider.find_propers(recently_aired)
File "C:\Medusa\medusa\providers\generic_provider.py", line 203, in find_propers
search_strings = self._get_episode_search_strings(episode_obj, add_string=term)
File "C:\Medusa\medusa\providers\generic_provider.py", line 621, in _get_episode_search_strings
all_possible_show_names = episode.series.get_all_possible_names()
File "C:\Medusa\medusa\tv\series.py", line 2139, in get_all_possible_names
show_names = {exception.series_name for exception in get_scene_exceptions(self, season)}
File "C:\Medusa\medusa\tv\series.py", line 2139, in <setcomp>
show_names = {exception.series_name for exception in get_scene_exceptions(self, season)}
AttributeError: 'unicode' object has no attribute 'series_name'

# Fixed code
def get_all_possible_names(self, season=-1):
    """Get every possible variation of the name for a particular show.

    Includes indexer name, and any scene exception names, and country code
    at the end of the name (e.g. "Show Name (AU)".

    show: a Series object that we should get the names of
    Returns: all possible show names
    """
    show_names = get_scene_exceptions(self, season)
    show_names.add(self.name)

    new_show_names = set()

    if not self.is_anime:
        country_list = {}
        # add the country list
        country_list.update(countryList)
        # add the reversed mapping of the country list
        country_list.update({v: k for k, v in viewitems(countryList)})

        for name in show_names:
            if not name:
                continue

            # if we have "Show Name Australia" or "Show Name (Australia)"
            # this will add "Show Name (AU)" for any countries defined in
            # common.countryList (and vice versa)
            for country in country_list:
                pattern_1 = " {0}".format(country)
                pattern_2 = " ({0})".format(country)
                replacement = " ({0})".format(country_list[country])
                if name.endswith(pattern_1):
                    new_show_names.add(name.replace(pattern_1, replacement))
                elif name.endswith(pattern_2):
                    new_show_names.add(name.replace(pattern_2, replacement))

    return show_names.union(new_show_names)