This repository was archived by the owner on Jul 16, 2026. It is now read-only.
Repository navigation
Conversation
…compat
`str | None` union-type syntax (PEP 604) requires Python ≥ 3.10.
System Python on macOS Sequoia ships 3.9.6 (Xcode toolchain), so
`tests/slack-bridge-allowlist.test.py` failed at import time with:
unsupported operand type(s) for |: 'type' and 'NoneType'
`from __future__ import annotations` defers all annotation evaluation
to strings (PEP 563), making the syntax valid on 3.9+. No runtime
behaviour change — annotations are not evaluated at runtime in this file.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bassilkhilo-ag2
approved these changes
May 25, 2026
bassilkhilo-ag2
left a comment
There was a problem hiding this comment.
LGTM. Same fix as sutando OSS sonichi#1108.
from __future__ import annotations enables PEP 563 postponed annotation evaluation, making pipe-style union types (X | Y) work on Python 3.9 without a runtime error. 2-line change, no behavior impact.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
All three bridge files (
slack-bridge.py,discord-bridge.py,telegram-bridge.py) usestr | Noneanddict | Noneunion type syntax, which Python 3.9 raises aTypeErroron at module load time. This causes a crash-loop on every startup, silently dropping all Slack/Discord/Telegram messages.Root cause surfaces after upgrading from 0.3 → 0.3.2: the 0.3 installation had this patched locally. The 0.3.2 app bundle ships without the patch, so users on Python 3.9 (macOS default until Ventura) hit crash-loops immediately after the update.
Fix
Add
from __future__ import annotationsas the second line of each bridge file. This makes ALL annotations lazy strings in Python 3.9 — zero behavior change on 3.10+.Files changed:
src/slack-bridge.py— addedfrom __future__ import annotationssrc/telegram-bridge.py— addedfrom __future__ import annotationssrc/discord-bridge.py— already had the fix at line 8 (inside module docstring section)Reproduces on
Python 3.9.x (ships with macOS Monterey and older;
CommandLineTools/Library/Frameworks/Python3.framework/...).Impact after 0.3 → 0.3.2 upgrade
Users who upgraded from 0.3 to 0.3.2 found ALL messaging channels dead. The 0.3 build had local hotfixes not in the OSS base; 0.3.2 was built clean, so those patches were lost.
Notes
sonichi/sutando) already has all 3 fixes inmain— this brings stando to parity.from __future__ import annotationsis a well-understood Python stdlib import, fully backward compatible.