diff --git a/PyInstaller/depend/utils.py b/PyInstaller/depend/utils.py index baffb2a9f3a..95846f39d53 100644 --- a/PyInstaller/depend/utils.py +++ b/PyInstaller/depend/utils.py @@ -399,6 +399,18 @@ def load_ldconfig_cache(): for line in text: # :fixme: this assumes libary names do not contain whitespace m = pattern.match(line) + + # Sanitize away any abnormal lines of output. + if m is None: + # Warn about it then skip the rest of this iteration. + if re.search("Cache generated by:", line): + # See #5540. This particular line is harmless. + pass + else: + logger.warning( + "Unrecognised line of output %r from ldconfig", line) + continue + path = m.groups()[-1] if is_freebsd or is_openbsd: # Insert `.so` at the end of the lib's basename. soname