Skip to content

fix(io): fall back to plain input on prompt_toolkit PermissionError - #5698

Open
FOWEPJF255 wants to merge 2 commits into
Aider-AI:mainfrom
FOWEPJF255:fix/io-permissionerror-fallback-5695
Open

fix(io): fall back to plain input on prompt_toolkit PermissionError#5698
FOWEPJF255 wants to merge 2 commits into
Aider-AI:mainfrom
FOWEPJF255:fix/io-permissionerror-fallback-5695

Conversation

@FOWEPJF255

Copy link
Copy Markdown

Summary

  • Catch PermissionError / OSError from prompt_session.prompt in confirm_ask and prompt_ask (Windows socketpair / WinError 10013).
  • Clear prompt_session and fall back to builtins.input so file-mention confirms no longer crash.
  • Add regression tests for the fallback path.

Fixes #5695

Test plan

  • python -m pytest tests/basic/test_io.py::TestInputOutput::test_confirm_ask_falls_back_when_prompt_session_raises_permission_error tests/basic/test_io.py::TestInputOutput::test_prompt_ask_falls_back_when_prompt_session_raises_permission_error -q
  • Manual: on Windows with a denied socketpair, trigger a confirm prompt and verify plain-input fallback instead of an uncaught exception

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncaught PermissionError in socket.py line 633

2 participants