Skip to content

Commit

Permalink
fix: Replace backslash in regex used as ignore and include paths
Browse files Browse the repository at this point in the history
It seems that from Python version 3.7 onwards
backslashes are interpreted as escape characters
by the re module.
This causes problems in Windows paths.

Closes: #1930
  • Loading branch information
mdengra committed Sep 27, 2021
1 parent 8a9f4a1 commit bc610a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deps/wazuh_testing/wazuh_testing/qa_docs/doc_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def __init__(self, config):
self.__id_counter = 0
self.ignore_regex = []
for ignore_regex in self.conf.ignore_paths:
self.ignore_regex.append(re.compile(ignore_regex))
self.ignore_regex.append(re.compile(ignore_regex.replace('\\','/')))
self.include_regex = []
if self.conf.mode == mode.DEFAULT:
for include_regex in self.conf.include_regex:
self.include_regex.append(re.compile(include_regex))
self.include_regex.append(re.compile(include_regex.replace('\\','/')))

def is_valid_folder(self, path):
"""
Expand Down

0 comments on commit bc610a3

Please sign in to comment.