[New-bugs-announce] [issue43771] [Windows] stdin line buffer size

Andrey Moiseev report at bugs.python.org
Thu Apr 8 05:33:51 EDT 2021

New submission from Andrey Moiseev <o2g.org.ru at gmail.com>:

sys.stdin.readline() in Windows console only allows 512 characters on input per line. So large pastes are truncated at 512 chars, which is a bit inconvenient for prototyping.

The buffer size seems to be determined by BUFSIZ compile time constant:

In C, I am able to set a larger buffer at runtime with setvbuf() call:
setvbuf(stdin, NULL, 0, 2024);

But I can't seem to make it work through ctypes.cdll.msvcrt.setvbuf

components: Windows
messages: 390518
nosy: Andrey Moiseev, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [Windows] stdin line buffer size
type: enhancement
versions: Python 3.9

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list