Skip to content

Commit 6739650

Browse files
committed
Fix AOL bouncer: decode get_payload(decode=True) bytes to str
In Python 3, get_payload(decode=True) always returns bytes. AOL.py was iterating over those bytes with string regex patterns, causing TypeError. Decode to str before iterating.
1 parent 8927a33 commit 6739650

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Mailman/Bouncers/AOL.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ def process(msg):
2929
return
3030
addrs = []
3131
found = False
32-
for line in msg.get_payload(decode=True).splitlines():
32+
payload = msg.get_payload(decode=True)
33+
if isinstance(payload, bytes):
34+
payload = payload.decode('us-ascii', errors='replace')
35+
for line in payload.splitlines():
3336
if scre.search(line):
3437
found = True
3538
continue

0 commit comments

Comments
 (0)