Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't ask for confirmation when stdin isn't available #1288

Merged
merged 3 commits into from Jan 20, 2012

Conversation

takluyver
Copy link
Member

In the notebook, we can't ask the user to confirm actions with a y/n prompt, because stdin doesn't work. But they probably didn't type %reset by accident, so we may as well go ahead and do it.

Points to consider:

  • If the user types "exit", we don't wait for confirmation. reset is no more damaging than exit, so maybe we shouldn't wait for confirmation at all.
  • Is there any situation where the user might expect to have a reset variable in scope, and try to examine its value? One way round this would be to drop reset in the builtins (as an explanatory string), forcing them to explicitly type %reset. But I suspect this is overkill.

Closes gh-1268

@fperez
Copy link
Member

fperez commented Jan 18, 2012

This looks good to me. Let's wait a day or two so others have a chance to also look at it, but as far as I'm concerned, it can be merged.

@ivanov
Copy link
Member

ivanov commented Jan 19, 2012

looks good to me as well, i sent @takluyver a PR with an update to the docs, and to have the "Overwriting file." message be printed to all clients, not just the notebook interface

@fperez
Copy link
Member

fperez commented Jan 20, 2012

@ivanov, thanks for the improvements! This looks good to me and the tests pass, as well as working OK in interactive testing. Merging now.

fperez added a commit that referenced this pull request Jan 20, 2012
Don't ask for confirmation when stdin isn't available for actions like %reset or %history -f.  Since the change is applied only on the Stdin error, once the notebook gets a stdin, it will naturally work.
@fperez fperez merged commit c8d17d8 into ipython:master Jan 20, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Don't ask for confirmation when stdin isn't available for actions like %reset or %history -f.  Since the change is applied only on the Stdin error, once the notebook gets a stdin, it will naturally work.
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.

notebook %reset magic fails with StdinNotImplementedError
3 participants