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.
Created on 2011年03月31日 15:17 by ysj.ray, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg132678 - (view) | Author: ysj.ray (ysj.ray) | Date: 2011年03月31日 15:17 | |
Setting sys.stdin to an invalid input stream under interactive mode causes interpreter run loop forever: Python 3.3a0 (default:22ae2b002865+, Mar 30 2011, 21:17:03) [GCC 4.4.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys [57804 refs] >>> sys.stdin = None [57809 refs] [57809 refs] [57809 refs] [57809 refs] [57809 refs] ...... Not only setting to None but also to any other invalid input stream could cause this. It's because in the beginning of PyRun_InteractiveOneFlags(), in order to get stdin encoding, the code tries to get sys.stdin and check if it's valid(not NULL, not None, has "encoding" attribute), if not, return -1 directly, then the loop in PyRun_InteractLoopFlags() continues and does the same thing. I think this should be fixed by using the Py_FileSystemDefaultEncoding instead when sys.stdin is invalid. |
|||
| msg132789 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2011年04月02日 08:28 | |
I think that it is a duplicate of #8070. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:15 | admin | set | github: 55939 |
| 2011年04月02日 08:28:53 | vstinner | set | status: open -> closed resolution: duplicate messages: + msg132789 |
| 2011年04月02日 05:21:27 | ned.deily | set | nosy:
+ vstinner stage: test needed -> needs patch |
| 2011年04月02日 01:13:28 | terry.reedy | set | title: Setting sys.stdin to an invalid input stream causes interpreter run loop forever. -> Setting Invalid sys.stdin in interactive mode => loop forever. stage: test needed |
| 2011年03月31日 15:17:18 | ysj.ray | create | |