# Buggy code
def when(self, matches, context):
    """Evaluate the rule.

    :param matches:
    :type matches: rebulk.match.Matches
    :param context:
    :type context: dict
    :return:
    """
    # only for shows that seems to be animes
    if (
        context.get("show_type") == "normal"
        or not matches.tagged("anime")
        or not matches.tagged("weak-duplicate")
        or matches.tagged("newpct")
    ):
        return

    fileparts = matches.markers.named("path")
    for filepart in marker_sorted(fileparts, matches):
        season = matches.range(
            filepart.start,
            filepart.end,
            index=0,
            predicate=lambda match: match.name == "season" and match.raw.isdigit(),
        )
        episode = matches.next(
            season,
            index=0,
            predicate=lambda match: (
                match.name == "episode"
                and match.end <= filepart.end
                and match.raw.isdigit()
            ),
        )

        # there should be season and episode and the episode should start right after the season and both raw values
        # should be digit
        if season and episode and season.end == episode.start:
            # then make them an absolute episode:
            absolute_episode = copy.copy(episode)
            absolute_episode.name = "absolute_episode"
            # raw value contains the season and episode altogether
            absolute_episode.value = int(
                episode.parent.raw if episode.parent else episode.raw
            )

            # always keep episode (subliminal needs it)
            corrected_episode = copy.copy(absolute_episode)
            corrected_episode.name = "episode"

            to_remove = [season, episode]
            to_append = [absolute_episode, corrected_episode]
            return to_remove, to_append


# Traceback (AttributeError)
2016-09-12 22:29:42 INFO     Thread-21 :: [9c6346b] PostProcessing Path: C:\Users\uTorrentVM\Downloads\Complete\SB
2016-09-12 22:29:44 ERROR    Thread-21 :: [9c6346b] Failed doing web ui callback: Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\core\base.py", line 270, in async_call
    result = function(**kwargs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\home\post_process.py", line 50, in processEpisode
    is_priority=argToBool(is_priority), delete_on=argToBool(delete_on), failed=argToBool(failed), proc_type=type, ignore_subs=argToBool(ignore_subs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 303, in processDir
    process_media(processPath, videoFiles, nzbName, process_method, force, is_priority, ignore_subs, result)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 571, in process_media
    if already_postprocessed(processPath, cur_video_file, force, result):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 531, in already_postprocessed
    parse_result = NameParser(try_indexers=True).parse(dirName)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 235, in parse
    result = self._parse_string(name)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 62, in _parse_string
    guess = guessit.guessit(name, dict(show_type=self.show_type))
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\guessit_parser.py", line 99, in guessit
    return default_api.guessit(name, options=final_options)
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 113, in guessit
    raise GuessitException(string, options)
GuessitException: An internal error has occured in guessit.
===================== Guessit Exception Report =====================
version=2.1.0.dev0
string=C:\Users\uTorrentVM\Downloads\Complete\SB\[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_mkv_[5_7]_-_`[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_vol03+04_par2`
options={'allowed_languages': ['ru', 'hu', 'en', 'nl', 'pt', 'de', 'jp', 'sv', 'it', 'fr', 'es', 'uk', 'ro', 'pl', 'he'], 'expected_group': ['re:\\bCDD\\b', 're:\\bF4ST3R\\b', 're:\\bTGNF4ST\\b', 're:\\bNovaRip\\b', 're:\\bRiPRG\\b', 're:\\bPtM\\b', 're:\\bbyEMP\\b', 're:\\b4EVERHD\\b', 're:\\bPOURMOi\\b', 're:\\bPARTiCLE\\b', 're:\\bTV2LAX9\\b', 're:\\bCDP\\b', 're:\\bELITETORRENT\\b', 're:\\bRipPourBox\\b', 're:\\bF4ST\\b', 're:\\bHDD\\b'], 'expected_title': ['re:(?<![^/\\\\])\\w+ it\\b', 're:\\bMob +Psycho +100\\b'], 'allowed_countries': ['gb', 'us'], 'episode_prefer_number': False, 'show_type': None, 'type': u'episode', 'implicit': True}
--------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 102, in guessit
    matches = self.rebulk.matches(string, options)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 275, in matches
    self._execute_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 306, in _execute_rules
    rules.execute_all_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 318, in execute_all_rules
    when_response = execute_rule(rule, matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 339, in execute_rule
    when_response = rule.when(matches, context)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\rules\rules.py", line 1006, in when
    predicate=lambda match: (match.name == 'episode' and
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\match.py", line 115, in next
    current = match.start + 1
AttributeError: 'NoneType' object has no attribute 'start'
--------------------------------------------------------------------
Please report at https://github.com/guessit-io/guessit/issues.
====================================================================
Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\core\base.py", line 270, in async_call
    result = function(**kwargs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\home\post_process.py", line 50, in processEpisode
    is_priority=argToBool(is_priority), delete_on=argToBool(delete_on), failed=argToBool(failed), proc_type=type, ignore_subs=argToBool(ignore_subs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 303, in processDir
    process_media(processPath, videoFiles, nzbName, process_method, force, is_priority, ignore_subs, result)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 571, in process_media
    if already_postprocessed(processPath, cur_video_file, force, result):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 531, in already_postprocessed
    parse_result = NameParser(try_indexers=True).parse(dirName)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 235, in parse
    result = self._parse_string(name)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 62, in _parse_string
    guess = guessit.guessit(name, dict(show_type=self.show_type))
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\guessit_parser.py", line 99, in guessit
    return default_api.guessit(name, options=final_options)
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 113, in guessit
    raise GuessitException(string, options)
GuessitException: An internal error has occured in guessit.
===================== Guessit Exception Report =====================
version=2.1.0.dev0
string=C:\Users\uTorrentVM\Downloads\Complete\SB\[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_mkv_[5_7]_-_`[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_vol03+04_par2`
options={'allowed_languages': ['ru', 'hu', 'en', 'nl', 'pt', 'de', 'jp', 'sv', 'it', 'fr', 'es', 'uk', 'ro', 'pl', 'he'], 'expected_group': ['re:\\bCDD\\b', 're:\\bF4ST3R\\b', 're:\\bTGNF4ST\\b', 're:\\bNovaRip\\b', 're:\\bRiPRG\\b', 're:\\bPtM\\b', 're:\\bbyEMP\\b', 're:\\b4EVERHD\\b', 're:\\bPOURMOi\\b', 're:\\bPARTiCLE\\b', 're:\\bTV2LAX9\\b', 're:\\bCDP\\b', 're:\\bELITETORRENT\\b', 're:\\bRipPourBox\\b', 're:\\bF4ST\\b', 're:\\bHDD\\b'], 'expected_title': ['re:(?<![^/\\\\])\\w+ it\\b', 're:\\bMob +Psycho +100\\b'], 'allowed_countries': ['gb', 'us'], 'episode_prefer_number': False, 'show_type': None, 'type': u'episode', 'implicit': True}
--------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 102, in guessit
    matches = self.rebulk.matches(string, options)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 275, in matches
    self._execute_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 306, in _execute_rules
    rules.execute_all_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 318, in execute_all_rules
    when_response = execute_rule(rule, matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 339, in execute_rule
    when_response = rule.when(matches, context)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\rules\rules.py", line 1006, in when
    predicate=lambda match: (match.name == 'episode' and
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\match.py", line 115, in next
    current = match.start + 1
AttributeError: 'NoneType' object has no attribute 'start'
--------------------------------------------------------------------
Please report at https://github.com/guessit-io/guessit/issues.
====================================================================
2016-09-12 22:30:09 INFO     TORNADO :: [9c6346b] User logged into the Medusa web interface
2016-09-12 22:30:11 INFO     Thread-19 :: [9c6346b] PostProcessing Path: C:\Users\uTorrentVM\Downloads\Complete\sb
2016-09-12 22:30:13 ERROR    Thread-19 :: [9c6346b] Failed doing web ui callback: Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\core\base.py", line 270, in async_call
    result = function(**kwargs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\home\post_process.py", line 50, in processEpisode
    is_priority=argToBool(is_priority), delete_on=argToBool(delete_on), failed=argToBool(failed), proc_type=type, ignore_subs=argToBool(ignore_subs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 303, in processDir
    process_media(processPath, videoFiles, nzbName, process_method, force, is_priority, ignore_subs, result)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 571, in process_media
    if already_postprocessed(processPath, cur_video_file, force, result):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 531, in already_postprocessed
    parse_result = NameParser(try_indexers=True).parse(dirName)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 235, in parse
    result = self._parse_string(name)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 62, in _parse_string
    guess = guessit.guessit(name, dict(show_type=self.show_type))
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\guessit_parser.py", line 99, in guessit
    return default_api.guessit(name, options=final_options)
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 113, in guessit
    raise GuessitException(string, options)
GuessitException: An internal error has occured in guessit.
===================== Guessit Exception Report =====================
version=2.1.0.dev0
string=C:\Users\uTorrentVM\Downloads\Complete\sb\[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_mkv_[5_7]_-_`[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_vol03+04_par2`
options={'allowed_languages': ['ru', 'hu', 'en', 'nl', 'pt', 'de', 'jp', 'sv', 'it', 'fr', 'es', 'uk', 'ro', 'pl', 'he'], 'expected_group': ['re:\\bCDD\\b', 're:\\bF4ST3R\\b', 're:\\bTGNF4ST\\b', 're:\\bNovaRip\\b', 're:\\bRiPRG\\b', 're:\\bPtM\\b', 're:\\bbyEMP\\b', 're:\\b4EVERHD\\b', 're:\\bPOURMOi\\b', 're:\\bPARTiCLE\\b', 're:\\bTV2LAX9\\b', 're:\\bCDP\\b', 're:\\bELITETORRENT\\b', 're:\\bRipPourBox\\b', 're:\\bF4ST\\b', 're:\\bHDD\\b'], 'expected_title': ['re:(?<![^/\\\\])\\w+ it\\b', 're:\\bMob +Psycho +100\\b'], 'allowed_countries': ['gb', 'us'], 'episode_prefer_number': False, 'show_type': None, 'type': u'episode', 'implicit': True}
--------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 102, in guessit
    matches = self.rebulk.matches(string, options)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 275, in matches
    self._execute_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 306, in _execute_rules
    rules.execute_all_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 318, in execute_all_rules
    when_response = execute_rule(rule, matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 339, in execute_rule
    when_response = rule.when(matches, context)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\rules\rules.py", line 1006, in when
    predicate=lambda match: (match.name == 'episode' and
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\match.py", line 115, in next
    current = match.start + 1
AttributeError: 'NoneType' object has no attribute 'start'
--------------------------------------------------------------------
Please report at https://github.com/guessit-io/guessit/issues.
====================================================================
Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\core\base.py", line 270, in async_call
    result = function(**kwargs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\home\post_process.py", line 50, in processEpisode
    is_priority=argToBool(is_priority), delete_on=argToBool(delete_on), failed=argToBool(failed), proc_type=type, ignore_subs=argToBool(ignore_subs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 303, in processDir
    process_media(processPath, videoFiles, nzbName, process_method, force, is_priority, ignore_subs, result)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 571, in process_media
    if already_postprocessed(processPath, cur_video_file, force, result):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 531, in already_postprocessed
    parse_result = NameParser(try_indexers=True).parse(dirName)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 235, in parse
    result = self._parse_string(name)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 62, in _parse_string
    guess = guessit.guessit(name, dict(show_type=self.show_type))
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\guessit_parser.py", line 99, in guessit
    return default_api.guessit(name, options=final_options)
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 113, in guessit
    raise GuessitException(string, options)
GuessitException: An internal error has occured in guessit.
===================== Guessit Exception Report =====================
version=2.1.0.dev0
string=C:\Users\uTorrentVM\Downloads\Complete\sb\[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_mkv_[5_7]_-_`[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_vol03+04_par2`
options={'allowed_languages': ['ru', 'hu', 'en', 'nl', 'pt', 'de', 'jp', 'sv', 'it', 'fr', 'es', 'uk', 'ro', 'pl', 'he'], 'expected_group': ['re:\\bCDD\\b', 're:\\bF4ST3R\\b', 're:\\bTGNF4ST\\b', 're:\\bNovaRip\\b', 're:\\bRiPRG\\b', 're:\\bPtM\\b', 're:\\bbyEMP\\b', 're:\\b4EVERHD\\b', 're:\\bPOURMOi\\b', 're:\\bPARTiCLE\\b', 're:\\bTV2LAX9\\b', 're:\\bCDP\\b', 're:\\bELITETORRENT\\b', 're:\\bRipPourBox\\b', 're:\\bF4ST\\b', 're:\\bHDD\\b'], 'expected_title': ['re:(?<![^/\\\\])\\w+ it\\b', 're:\\bMob +Psycho +100\\b'], 'allowed_countries': ['gb', 'us'], 'episode_prefer_number': False, 'show_type': None, 'type': u'episode', 'implicit': True}
--------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 102, in guessit
    matches = self.rebulk.matches(string, options)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 275, in matches
    self._execute_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 306, in _execute_rules
    rules.execute_all_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 318, in execute_all_rules
    when_response = execute_rule(rule, matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 339, in execute_rule
    when_response = rule.when(matches, context)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\rules\rules.py", line 1006, in when
    predicate=lambda match: (match.name == 'episode' and
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\match.py", line 115, in next
    current = match.start + 1
AttributeError: 'NoneType' object has no attribute 'start'
--------------------------------------------------------------------
Please report at https://github.com/guessit-io/guessit/issues.
====================================================================
2016-09-12 22:30:19 INFO     TORNADO :: [9c6346b] User logged into the Medusa web interface
2016-09-12 22:30:20 INFO     Thread-19 :: [9c6346b] PostProcessing Path: C:\Users\uTorrentVM\Downloads\Complete\sb
2016-09-12 22:30:22 ERROR    Thread-19 :: [9c6346b] Failed doing web ui callback: Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\core\base.py", line 270, in async_call
    result = function(**kwargs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\home\post_process.py", line 50, in processEpisode
    is_priority=argToBool(is_priority), delete_on=argToBool(delete_on), failed=argToBool(failed), proc_type=type, ignore_subs=argToBool(ignore_subs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 303, in processDir
    process_media(processPath, videoFiles, nzbName, process_method, force, is_priority, ignore_subs, result)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 571, in process_media
    if already_postprocessed(processPath, cur_video_file, force, result):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 531, in already_postprocessed
    parse_result = NameParser(try_indexers=True).parse(dirName)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 235, in parse
    result = self._parse_string(name)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 62, in _parse_string
    guess = guessit.guessit(name, dict(show_type=self.show_type))
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\guessit_parser.py", line 99, in guessit
    return default_api.guessit(name, options=final_options)
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 113, in guessit
    raise GuessitException(string, options)
GuessitException: An internal error has occured in guessit.
===================== Guessit Exception Report =====================
version=2.1.0.dev0
string=C:\Users\uTorrentVM\Downloads\Complete\sb\[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_mkv_[5_7]_-_`[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_vol03+04_par2`
options={'allowed_languages': ['ru', 'hu', 'en', 'nl', 'pt', 'de', 'jp', 'sv', 'it', 'fr', 'es', 'uk', 'ro', 'pl', 'he'], 'expected_group': ['re:\\bCDD\\b', 're:\\bF4ST3R\\b', 're:\\bTGNF4ST\\b', 're:\\bNovaRip\\b', 're:\\bRiPRG\\b', 're:\\bPtM\\b', 're:\\bbyEMP\\b', 're:\\b4EVERHD\\b', 're:\\bPOURMOi\\b', 're:\\bPARTiCLE\\b', 're:\\bTV2LAX9\\b', 're:\\bCDP\\b', 're:\\bELITETORRENT\\b', 're:\\bRipPourBox\\b', 're:\\bF4ST\\b', 're:\\bHDD\\b'], 'expected_title': ['re:(?<![^/\\\\])\\w+ it\\b', 're:\\bMob +Psycho +100\\b'], 'allowed_countries': ['gb', 'us'], 'episode_prefer_number': False, 'show_type': None, 'type': u'episode', 'implicit': True}
--------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 102, in guessit
    matches = self.rebulk.matches(string, options)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 275, in matches
    self._execute_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 306, in _execute_rules
    rules.execute_all_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 318, in execute_all_rules
    when_response = execute_rule(rule, matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 339, in execute_rule
    when_response = rule.when(matches, context)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\rules\rules.py", line 1006, in when
    predicate=lambda match: (match.name == 'episode' and
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\match.py", line 115, in next
    current = match.start + 1
AttributeError: 'NoneType' object has no attribute 'start'
--------------------------------------------------------------------
Please report at https://github.com/guessit-io/guessit/issues.
====================================================================
Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\core\base.py", line 270, in async_call
    result = function(**kwargs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\server\web\home\post_process.py", line 50, in processEpisode
    is_priority=argToBool(is_priority), delete_on=argToBool(delete_on), failed=argToBool(failed), proc_type=type, ignore_subs=argToBool(ignore_subs)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 303, in processDir
    process_media(processPath, videoFiles, nzbName, process_method, force, is_priority, ignore_subs, result)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 571, in process_media
    if already_postprocessed(processPath, cur_video_file, force, result):
  File "C:\Users\uTorrentVM\SickRage\sickbeard\processTV.py", line 531, in already_postprocessed
    parse_result = NameParser(try_indexers=True).parse(dirName)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 235, in parse
    result = self._parse_string(name)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\parser.py", line 62, in _parse_string
    guess = guessit.guessit(name, dict(show_type=self.show_type))
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\guessit_parser.py", line 99, in guessit
    return default_api.guessit(name, options=final_options)
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 113, in guessit
    raise GuessitException(string, options)
GuessitException: An internal error has occured in guessit.
===================== Guessit Exception Report =====================
version=2.1.0.dev0
string=C:\Users\uTorrentVM\Downloads\Complete\sb\[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_mkv_[5_7]_-_`[HorribleSubs]_Mob_Psycho_100_-_10_[1080p]_vol03+04_par2`
options={'allowed_languages': ['ru', 'hu', 'en', 'nl', 'pt', 'de', 'jp', 'sv', 'it', 'fr', 'es', 'uk', 'ro', 'pl', 'he'], 'expected_group': ['re:\\bCDD\\b', 're:\\bF4ST3R\\b', 're:\\bTGNF4ST\\b', 're:\\bNovaRip\\b', 're:\\bRiPRG\\b', 're:\\bPtM\\b', 're:\\bbyEMP\\b', 're:\\b4EVERHD\\b', 're:\\bPOURMOi\\b', 're:\\bPARTiCLE\\b', 're:\\bTV2LAX9\\b', 're:\\bCDP\\b', 're:\\bELITETORRENT\\b', 're:\\bRipPourBox\\b', 're:\\bF4ST\\b', 're:\\bHDD\\b'], 'expected_title': ['re:(?<![^/\\\\])\\w+ it\\b', 're:\\bMob +Psycho +100\\b'], 'allowed_countries': ['gb', 'us'], 'episode_prefer_number': False, 'show_type': None, 'type': u'episode', 'implicit': True}
--------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\uTorrentVM\SickRage\lib\guessit\api.py", line 102, in guessit
    matches = self.rebulk.matches(string, options)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 275, in matches
    self._execute_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rebulk.py", line 306, in _execute_rules
    rules.execute_all_rules(matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 318, in execute_all_rules
    when_response = execute_rule(rule, matches, context)
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\rules.py", line 339, in execute_rule
    when_response = rule.when(matches, context)
  File "C:\Users\uTorrentVM\SickRage\sickbeard\name_parser\rules\rules.py", line 1006, in when
    predicate=lambda match: (match.name == 'episode' and
  File "C:\Users\uTorrentVM\SickRage\lib\rebulk\match.py", line 115, in next
    current = match.start + 1
AttributeError: 'NoneType' object has no attribute 'start'
--------------------------------------------------------------------
Please report at https://github.com/guessit-io/guessit/issues.
====================================================================

# Fixed code
def when(self, matches, context):
    """Evaluate the rule.

    :param matches:
    :type matches: rebulk.match.Matches
    :param context:
    :type context: dict
    :return:
    """
    # only for shows that seems to be animes
    if (
        context.get("show_type") == "normal"
        or not matches.tagged("anime")
        or not matches.tagged("weak-duplicate")
        or matches.tagged("newpct")
    ):
        return

    fileparts = matches.markers.named("path")
    for filepart in marker_sorted(fileparts, matches):
        season = matches.range(
            filepart.start,
            filepart.end,
            index=0,
            predicate=lambda match: match.name == "season" and match.raw.isdigit(),
        )
        if not season:
            continue

        episode = matches.next(
            season,
            index=0,
            predicate=lambda match: (
                match.name == "episode"
                and match.end <= filepart.end
                and match.raw.isdigit()
            ),
        )

        # there should be season and episode and the episode should start right after the season and both raw values
        # should be digit
        if season and episode and season.end == episode.start:
            # then make them an absolute episode:
            absolute_episode = copy.copy(episode)
            absolute_episode.name = "absolute_episode"
            # raw value contains the season and episode altogether
            absolute_episode.value = int(
                episode.parent.raw if episode.parent else episode.raw
            )

            # always keep episode (subliminal needs it)
            corrected_episode = copy.copy(absolute_episode)
            corrected_episode.name = "episode"

            to_remove = [season, episode]
            to_append = [absolute_episode, corrected_episode]
            return to_remove, to_append