# Buggy code
def _ignore_details(self, path, is_dir):
    result = []
    for ignore, pattern in zip(self.regex_pattern_list, self.pattern_list):
        regex = re.compile(ignore[0])
        # skip system pattern
        if not pattern.file_info:
            continue
        if is_dir:
            path_dir = f"{path}/"
            if regex.match(path) or regex.match(path_dir):
                result.append(pattern.file_info)
        else:
            if regex.match(path):
                result.append(pattern.file_info)
    return result


# Traceback (dvc.output.base.OutputIsIgnoredError)
dvc status -v
2020-11-28 16:41:28,063 DEBUG: Check for update is enabled.
2020-11-28 16:41:28,069 DEBUG: fetched: [(3,)]
2020-11-28 16:41:28,073 DEBUG: fetched: [(1404595,)]
2020-11-28 16:41:28,154 ERROR: Path 'fms_unit.csv' is ignored by
.dvcignore:1:/*
------------------------------------------------------------
Traceback (most recent call last):
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/command/status.py", line 58, in run
recursive=self.args.recursive,
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/repo/__init__.py", line 60, in wrapper
return f(repo, *args, **kwargs)
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/repo/status.py", line 152, in status
self, targets, with_deps=with_deps, recursive=recursive
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/repo/status.py", line 36, in _local_status
return _joint_status(pairs)
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/repo/status.py", line 16, in _joint_status
for stage, filter_info in pairs:
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/repo/status.py", line 33, in <genexpr>
for t in targets
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/repo/__init__.py", line 358, in collect_granular
return [(stage, None) for stage in self.stages]
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/funcy/objects.py", line 28, in __get__
res = instance.__dict__[self.fget.__name__] = self.fget(instance)
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/repo/__init__.py", line 493, in stages
return self._collect_stages()
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/repo/__init__.py", line 501, in _collect_stages
new_stages = self.get_stages(os.path.join(root, file_name))
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/repo/__init__.py", line 290, in get_stages
return list(dvcfile.stages.values())
File "/usr/lib/python3.7/_collections_abc.py", line 762, in __iter__
yield self._mapping[key]
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/stage/loader.py", line 153, in __getitem__
self.dvcfile, deepcopy(self.stage_data), self.stage_text
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/stage/loader.py", line 164, in load_stage
stage.outs = output.loadd_from(stage, d.get(Stage.PARAM_OUTS) or [])
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/output/__init__.py", line 150, in loadd_from
desc=desc,
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/output/__init__.py", line 126, in _get
desc=desc,
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/output/local.py", line 24, in __init__
super().__init__(stage, path, *args, **kwargs)
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/output/base.py", line 109, in __init__
self._validate_output_path(path, stage)
File "/home/anotherbugmaster/.virtualenvs/PTR/lib/python3.7/site-packages/dvc/output/base.py", line 535, in _validate_output_path
raise cls.IsIgnoredError(check)
dvc.output.base.OutputIsIgnoredError: Path 'fms_unit.csv' is ignored by
.dvcignore:1:/*
------------------------------------------------------------
2020-11-28 16:41:28,214 DEBUG: Analytics is enabled.
2020-11-28 16:41:28,251 DEBUG: Trying to spawn '['daemon', '-q', 'analytics', '/tmp/tmp0m393p29']'
2020-11-28 16:41:28,252 DEBUG: Spawned '['daemon', '-q', 'analytics', '/tmp/tmp0m393p29']'

# Fixed code
def _ignore_details(self, path, is_dir: bool):
    result = []
    for (regex, _), pattern_info in list(
        zip(self.regex_pattern_list, self.pattern_list)
    ):
        # skip system pattern
        if not pattern_info.file_info:
            continue

        regex = re.compile(regex)

        matches = bool(regex.match(path))
        if is_dir:
            matches |= bool(regex.match(f"{path}/"))

        if matches:
            result.append(pattern_info.file_info)

    return result