Message ID | 20241027-trailer-special-chars-v1-5-1bd180dba425@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Handle patch trailers with special characters | expand |
diff --git a/src/b4/__init__.py b/src/b4/__init__.py index cf112e3bce2911c78cff18aac267608f796957ab..0785be8ffcef08fb5cd4c484a40e6fe856446cfe 100644 --- a/src/b4/__init__.py +++ b/src/b4/__init__.py @@ -1061,10 +1061,8 @@ def __init__(self, name: Optional[str] = None, value: Optional[str] = None, exti self.type = 'person' self.addr = email.utils.parseaddr(value) # Normalize the value with parsed data - if self.addr[0]: - self.value = f'{self.addr[0]} <{self.addr[1]}>' - elif self.addr[1]: - self.value = self.addr[1] + if self.addr[0] or self.addr[1]: + self.value = email.utils.formataddr(self.addr) else: self.type = 'unknown' else: