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

Keying 'q' doesn't quit the interactive help in Wins7 #1591

Closed
andrewgohlk opened this issue Apr 13, 2012 · 6 comments · Fixed by #4084
Closed

Keying 'q' doesn't quit the interactive help in Wins7 #1591

andrewgohlk opened this issue Apr 13, 2012 · 6 comments · Fixed by #4084
Milestone

Comments

@andrewgohlk
Copy link

Hi,

When I use ? or %magic where there'll be a list of help text displayed, pressing the 'q' to quit the help text doesn't work. It will continue with the next section of help text of iPyhton3 in Wins7.

@takluyver
Copy link
Member

To clarify, is this with IPython at a command prompt, or in the Qt console?

@andrewgohlk
Copy link
Author

It's in the IPython command prompt. I didn't install Qt package.

In [1]: %magic
IPython's 'magic' functions
'===========================

The magic function system provides a series of functions which allow you to
control the behavior of IPython itself, plus a lot of system-type
features. All these functions are prefixed with a % character, but parameters
are given without parentheses or quotes.

NOTE: If you have 'automagic' enabled (via the command line option or with the
%automagic function), you don't need to type in the % explicitly. By default,
IPython ships with automagic on, so you should only rarely need the % escape.
:
:
---Return to continue, q to quit---

At the prompt, I key 'q' but it doesn't quit. The help text continue to list out help information.

@stonebig
Copy link
Contributor

Hello,

On windows vista 32bit, ipython1.0 , python3 , If I patch core\page.py to try to see what happens, I get a 'byte' to 'string' message "Can't convert 'bytes' object to str implicitly".

==> Isn't it the issue for the test that searches for a "q" answer never succeeding ?

C:\Users\parent\Desktop\winpython\WinPython-32bit-3.3.2.2\python-3.3.2\lib\site-
packages\IPython\core\page.py in page_more()
307 io.stdout.write('---Return to continue, q to quit---')
308 ans = msvcrt.getch()
--> 309 io.stdout.write('---'+ans+'---')
310 ans = msvcrt.getch()
311 if ans in ("q", "Q"):

TypeError: Can't convert 'bytes' object to str implicitly

@takluyver
Copy link
Member

Well found, @stonebig . It looks like msvcrt.getch() returns a byte b'q', which is not the same as a string 'q' on Python 3. Do you want to make a pull request to fix it?

@stonebig
Copy link
Contributor

Hi,

I would prefer you do it, if possible.

@takluyver
Copy link
Member

@stonebig : OK, can you test PR #4084? I'm not on Windows.

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants