Eryk Sun <eryk...@gmail.com> added the comment:
> '\r' is not handled, though it is documented that it > should be supported. Where is it documented that sys.stdin uses universal newlines mode? The newline behavior isn't documented in the sys module [1], though it should be. It's hard coded in create_stdio() in Python/pylifecycle.c [2]. In Windows it uses universal-translated mode. On all other platforms, it uses "\n", which includes "\r\n" but not "\r". --- [1] https://docs.python.org/3/library/sys.html#sys.stdin [2] https://github.com/python/cpython/blob/v3.10.0/Python/pylifecycle.c#L2216 ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45617> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com