Message392626
| Author |
piwi |
| Recipients |
agthorr, loewis, mwh, piwi |
| Date |
2021年05月01日.20:08:58 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1619899739.01.0.403683286222.issue512981@roundup.psfhosted.org> |
| In-reply-to |
| Content |
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? |
|
History
|
|---|
| 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 |
|