Skip to content

Commit 6c5e652

Browse files
committed
read bad words file in binary mode because the body is also bytes
1 parent 7532bae commit 6c5e652

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sogs/filtration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def should_drop_message_with_body(body):
77
body = message_body(body)
88
"""return true if we should drop a message given its body"""
99
if os.path.exists(config.BAD_WORDS_FILE):
10-
with open(config.BAD_WORDS_FILE, 'r') as f:
10+
with open(config.BAD_WORDS_FILE, 'rb') as f:
1111
for line in f:
1212
word = line.rstrip()
1313
if word in body:

0 commit comments

Comments
 (0)