Message392626
I suggest to reopen this issue as there was a regression with python3.
import sys
sys.stdin = open("/dev/tty", "r")
import readline
print(input())
Write some text and press left.
Expected: the cursor goes left.
Actual: prints '^[[D' as is readline had not been imported.
bltinmodule.c checks that the current sys.stdin filno matches the C stdin fileno. When they are different, it falls back to the default input implementation.
https://github.com/python/cpython/blob/1e7b858575d0ad782939f86aae4a2fa1c29e9f14/Python/bltinmodule.c#L2097
I noticed that PyFile_AsFile no longer exists. Would calling `fdopen` be acceptable? |
|
Date |
User |
Action |
Args |
2021-05-01 20:08:59 | piwi | set | recipients:
+ piwi, mwh, loewis, agthorr |
2021-05-01 20:08:59 | piwi | set | messageid: <1619899739.01.0.403683286222.issue512981@roundup.psfhosted.org> |
2021-05-01 20:08:58 | piwi | link | issue512981 messages |
2021-05-01 20:08:58 | piwi | create | |
|