Skip to content

Commit

Permalink
Fix invalid escape sequences in regular expressions (closes vinifmor#379
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Boria138 committed Dec 23, 2024
1 parent b1ea479 commit 445776c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bauh/gems/arch/pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def read_repository_from_info(name: str) -> Optional[str]:

repository = None

for o in new_subprocess(['grep', '-Po', "Repository\s+:\s+\K.+"], stdin=info.stdout).stdout:
for o in new_subprocess(['grep', '-Po', r"Repository\s+:\s+\K.+"], stdin=info.stdout).stdout:
if o:
line = o.decode().strip()

Expand Down Expand Up @@ -343,7 +343,7 @@ def read_provides(name: str) -> Set[str]:

provides = None

for out in new_subprocess(['grep', '-Po', 'Provides\s+:\s\K(.+)'], stdin=dep_info.stdout).stdout:
for out in new_subprocess(['grep', '-Po', r'Provides\s+:\s\K(.+)'], stdin=dep_info.stdout).stdout:
if out:
provided_names = [p.strip() for p in out.decode().strip().split(' ') if p]

Expand Down Expand Up @@ -372,7 +372,7 @@ def read_dependencies(name: str) -> Set[str]:
raise PackageNotFoundException(name)

depends_on = set()
for out in new_subprocess(['grep', '-Po', 'Depends\s+On\s+:\s\K(.+)'], stdin=dep_info.stdout).stdout:
for out in new_subprocess(['grep', '-Po', r'Depends\s+On\s+:\s\K(.+)'], stdin=dep_info.stdout).stdout:
if out:
line = out.decode().strip()

Expand Down
2 changes: 1 addition & 1 deletion bauh/gems/debian/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class ApplicationsMapper:
def __init__(self, logger: Logger, workers: int = 10):
self._log = logger
self._re_desktop_file = re.compile(r'(.+):\s+(/usr/share/applications/.+\.desktop)')
self._re_desktop_file_fields = re.compile('(Exec|TryExec|Icon|Categories|NoDisplay|Terminal)\s*=\s*(.+)')
self._re_desktop_file_fields = re.compile(r'(Exec|TryExec|Icon|Categories|NoDisplay|Terminal)\s*=\s*(.+)')
self._workers = workers

def _read_file(self, file_path: str) -> Optional[str]:
Expand Down
2 changes: 1 addition & 1 deletion bauh/gems/flatpak/flatpak.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

RE_SEVERAL_SPACES = re.compile(r'\s+')
RE_COMMIT = re.compile(r'(Latest commit|Commit)\s*:\s*(.+)')
RE_REQUIRED_RUNTIME = re.compile(f'Required\s+runtime\s+.+\(([\w./]+)\)\s*.+\s+remote\s+([\w+./]+)')
RE_REQUIRED_RUNTIME = re.compile(r'Required\s+runtime\s+.+\(([\w./]+)\)\s*.+\s+remote\s+([\w+./]+)')
OPERATION_UPDATE_SYMBOLS = {'i', 'u'}


Expand Down

0 comments on commit 445776c

Please sign in to comment.