Repository navigation
Fix SyntaxError on Python 3.13 (Home Assistant before 2026.3) - #179
Merged
Merged
Conversation
`except ValueError, OverflowError:` is only valid from Python 3.14 (PEP 758), so 1.4.0 fails to import on Home Assistant 2025.8-2026.2, which run on Python 3.13 and which hacs.json still allows. Restore the parentheses. Keep ruff on py313 for the integration so it neither writes nor accepts 3.14-only syntax; the tests stay on py314 because their dependencies need it and they rely on lazy annotations. Add a CI job that compiles the integration with Python 3.13. Fixes custom-components#178 Co-Authored-By: Claude Opus 5.5 <[email protected]>
iantrich
approved these changes
Nov 16, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #178.
1.4.0 doesn't import on Python 3.13, so it breaks on Home Assistant 2025.8–2026.2, which
hacs.jsonstill allows. This PR:reader.py: restoresexcept (ValueError, OverflowError):. The unparenthesized form came in with Fetch feeds through an optional HTTP or SOCKS proxy #175 and only parses on Python 3.14 (PEP 758).target-versiontopy313for the integration, so ruff neither writes nor accepts 3.14-only syntax. Withpy313, ruff reports the line above as a syntax error.tests/stays onpy314throughper-file-target-version, because the test dependencies need 3.14 andtests/feedsource.pyrelies on lazy annotations.compilealloncustom_components. The full test suite can't run on 3.13, sincepytest-homeassistant-custom-componentpins HA 2026.10.Raising the
hacs.jsonminimum to2026.3.0would also avoid the crash, but it would drop users on older HA. I left that decision open.Verification
master,reader.pyfails withSyntaxError: multiple exception types must be parenthesized.pytest testson Python 3.14: 239 passed, 2 deselected.pre-commit runon the changed files passes (ruff 0.12.12, black, mypy, pretty-format-toml).🤖 Generated with Claude Code