fix: work around asyncssh/fido2 AttributeError on Python 3.14 non-Windows#23
Draft
fix: work around asyncssh/fido2 AttributeError on Python 3.14 non-Windows#23
Conversation
…n 3.14 Agent-Logs-Url: https://github.com/gensyn/ssh_command/sessions/40be7829-f1be-4b60-83c3-b24fe786b4a8 Co-authored-by: gensyn <36128035+gensyn@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gensyn/ssh_command/sessions/40be7829-f1be-4b60-83c3-b24fe786b4a8 Co-authored-by: gensyn <36128035+gensyn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix AttributeError in SSH Command integration on Python 3.14
fix: work around asyncssh/fido2 AttributeError on Python 3.14 non-Windows
Apr 18, 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.
On Python 3.14,
ctypes.HRESULTwas removed for non-Windows platforms. Whenfido2is installed in the HA environment,asyncssh'ssk.pyattemptsfrom fido2.client.windows import WindowsClientinside atry/except ImportErrorblock — butfido2/client/win_api.pyraisesAttributeErrorat module level (HRESULT = ctypes.HRESULT), which goes uncaught and blows up the entireasyncsshimport.Fix
Pre-attempt the problematic import in
coordinator.pybeforeasyncsshis loaded. On failure, writeNoneintosys.modules["fido2.client.windows"]— Python's negative-cache mechanism — so that asyncssh's subsequent import attempt raisesImportErrorinstead, which it already handles gracefully (disabling Windows WebAuthn support).This is a targeted workaround for a bug in asyncssh's exception handling (
except ImportErrorshould beexcept (ImportError, AttributeError)). No functional behaviour changes on Windows or in environments wherefido2is absent or fully compatible.