Skip to content

Commit 984d915

Browse files
authored
bots: Fix RSS bot for Python 3.x support.
- Call `super()` in the init method. - Change return hashlib.md5 syntax to encode properly for Python 3 Signed-off-by: Manu LN <[email protected]>
1 parent 59a0a91 commit 984d915

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

zulip/integrations/rss/rss-bot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def log_error_and_exit(error: str) -> None:
111111

112112
class MLStripper(HTMLParser):
113113
def __init__(self) -> None:
114+
super().__init__()
114115
self.reset()
115116
self.fed = [] # type: List[str]
116117

@@ -128,7 +129,7 @@ def strip_tags(html: str) -> str:
128129
def compute_entry_hash(entry: Dict[str, Any]) -> str:
129130
entry_time = entry.get("published", entry.get("updated"))
130131
entry_id = entry.get("id", entry.get("link"))
131-
return hashlib.md5(entry_id + str(entry_time)).hexdigest()
132+
return hashlib.md5((entry_id + str(entry_time)).encode()).hexdigest()
132133

133134
def unwrap_text(body: str) -> str:
134135
# Replace \n by space if it is preceded and followed by a non-\n.

0 commit comments

Comments
 (0)