Workaround delete all empty lines to avoid vobject parsing errors

This commit is contained in:
Peter Bieringer
2026-01-22 21:33:50 +01:00
parent b3ccd39d11
commit a143c5d765

View File

@@ -56,6 +56,8 @@ def read_components(s: str) -> List[vobject.base.Component]:
# * 0x0A Line Feed
# * 0x0D Carriage Return
s = re.sub(r'[\x00-\x08\x0B\x0C\x0E-\x1F]', '', s)
# Workaround delete all empty lines to avoid vobject parsing errors
s = re.sub(r'(?m)^[ \t]*\r?\n', '', s)
return list(vobject.readComponents(s, allowQP=True))