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: Python readline module
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, frenzisys, gvanrossum, steven.daprano
Priority: normal Keywords:

Created on 2021-01-05 10:19 by frenzisys, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
io_console.py frenzisys, 2021-01-05 20:03
Messages (4)
msg384379 - (view) Author: Marco Franzo (frenzisys) Date: 2021-01-05 10:19
It would be better to write at the end of the program this:

os.system('stty sane')

because when you import readline, at the end of program, the console remains unusable
msg384380 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2021-01-05 10:38
> when you import readline, at the end of program, the console remains unusable

I cannot replicate that. I've been using readline in versions of Python starting from 2.4 to 3.9 and it has not left the console in an unusual state.

Can you give an example of how to reproduce that? What OS and shell are you using? Which terminal application?

Can you show an example of this bug? Preferably by coping and pasting text, but if necessary a screen shot.
msg384424 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2021-01-05 18:42
This should be discussed on a user forum, not in our bug tracker.
msg384428 - (view) Author: Marco Franzo (frenzisys) Date: 2021-01-05 20:03
So, I use Ubuntu 20.10 and the terminal
is the one distributed with the system.

I think this problem born in my code here:

def generate_input():
    while True:
        str = input().strip()
        yield helloworld_pb2.Operazione(operazione = str)


I think the string

os.system('stty sane')

it can be very useful for those who have the shell unusable at the end of the program.

If i remove import readline, I no longer have any problems, but i need 
the features of readline
History
Date User Action Args
2022-04-11 14:59:39adminsetgithub: 86994
2021-01-05 20:03:09frenzisyssetfiles: + io_console.py

messages: + msg384428
2021-01-05 18:42:18gvanrossumsetstatus: open -> closed

nosy: + gvanrossum
messages: + msg384424

resolution: rejected
stage: resolved
2021-01-05 10:38:02steven.dapranosetnosy: + steven.daprano
messages: + msg384380
2021-01-05 10:19:01frenzisyscreate