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.

Author pitrou
Recipients Drekin, benjamin.peterson, brett.cannon, eric.araujo, georg.brandl, ncoghlan, pitrou, tshepang, vstinner
Date 2013-04-11.09:56:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> • interactive console doesn't use sys.stdin for input, why?

Modules/main.c calls PyRun_AnyFileFlags(stdin, "<stdin>", ...). At this point, sys.stdin *is* the same as C stdin by construction, so I'm not sure how you came to encounter the issue.

However, it's also true that if you later redirect sys.stdin, it will be ignored and the original C stdin (as passed to PyRun_InteractiveLoopFlags) will continue to be used. On the other hand, the input() implementation has dedicated logic to find out whether sys.stdin is the same as C stdin.

(by the way, the issue should also apply to 2.7)

> • it uses sys.stdin.encoding, shouldn't it rather use sys.__stdin__.encoding if anything?

Assuming the previous bug gets fixed, then no :-)
Date User Action Args
2013-04-11 09:56:37pitrousetrecipients: + pitrou, brett.cannon, georg.brandl, ncoghlan, vstinner, benjamin.peterson, eric.araujo, tshepang, Drekin
2013-04-11 09:56:36pitrousetmessageid: <>
2013-04-11 09:56:36pitroulinkissue17620 messages
2013-04-11 09:56:36pitroucreate