Skip to content

Commit 15c46dc

Browse files
andersktimabbott
authored andcommitted
sync-public-streams: Fix for Python 3.
bytes are not JSON serializable. Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 42aecf6 commit 15c46dc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

zulip/integrations/zephyr/sync-public-streams

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import zulip
1313

1414
from typing import Set, Optional
1515

16-
def fetch_public_streams() -> Optional[Set[bytes]]:
16+
def fetch_public_streams() -> Optional[Set[str]]:
1717
public_streams = set()
1818

1919
try:
@@ -31,10 +31,10 @@ def fetch_public_streams() -> Optional[Set[bytes]]:
3131
stream_name = stream["name"]
3232
# Zephyr class names are canonicalized by first applying NFKC
3333
# normalization and then lower-casing server-side
34-
canonical_cls = unicodedata.normalize("NFKC", stream_name).lower().encode("utf-8")
35-
if canonical_cls in [b'security', b'login', b'network', b'ops', b'user_locate',
36-
b'mit', b'moof', b'wsmonitor', b'wg_ctl', b'winlogger',
37-
b'hm_ctl', b'hm_stat', b'zephyr_admin', b'zephyr_ctl']:
34+
canonical_cls = unicodedata.normalize("NFKC", stream_name).lower()
35+
if canonical_cls in ['security', 'login', 'network', 'ops', 'user_locate',
36+
'mit', 'moof', 'wsmonitor', 'wg_ctl', 'winlogger',
37+
'hm_ctl', 'hm_stat', 'zephyr_admin', 'zephyr_ctl']:
3838
# These zephyr classes cannot be subscribed to by us, due
3939
# to MIT's Zephyr access control settings
4040
continue

0 commit comments

Comments
 (0)