This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python3 interactive shell hangs on
Type: behavior Stage: resolved
Components: Build Versions: Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Occasionally check for Ctrl-C in long-running operations like sum
View: 26351
Assigned To: Nosy List: Nixawk, eryksun, r.david.murray, rhettinger
Priority: normal Keywords:

Created on 2017-01-10 06:32 by Nixawk, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg285093 - (view) Author: Vex Woo (Nixawk) * Date: 2017-01-10 06:32
I'v tested the following steps against python3.5 and python3.6. Python shell hangs on.

$ python3.6
Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import itertools
>>> counter = itertools.count()
>>> next(counter)
0
>>> next(counter)
1
>>> 'count' in counter




^C^C^C^C^C^C^C^C



^C^C^C


^D
^Z
[1]  + 47254 suspended  python3.6
~ ->> fg
[1]  + 47254 continued  python3.6


^C^C^Z
[1]  + 47254 suspended  python3.6
msg285094 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-01-10 06:54
This is an instance of the the problem discussed in Issue 26351.
msg285097 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2017-01-10 07:41
As a workaround, the platform's default Ctrl+C handler should allow killing the process:

    >>> signal.signal(signal.SIGINT, signal.SIG_DFL)
    <built-in function default_int_handler>

    >>> counter = itertools.count()
    >>> 'count' in counter
    ^C

But it's nowhere near as useful as a KeyboardInterrupt exception, if something ever gets implemented to resolve issue 26351.
History
Date User Action Args
2022-04-11 14:58:41adminsetgithub: 73408
2017-01-10 07:41:04eryksunsetstatus: open -> closed
nosy: + eryksun
messages: + msg285097

2017-01-10 06:54:33r.david.murraysetnosy: + r.david.murray
messages: + msg285094
resolution: duplicate

superseder: Occasionally check for Ctrl-C in long-running operations like sum
stage: resolved
2017-01-10 06:40:44serhiy.storchakasetnosy: + rhettinger
2017-01-10 06:32:23Nixawkcreate