[Python-Dev] Can't have unbuffered text I/O in Python 3.0?

Fabio Zadrozny fabiofz at gmail.com
Sun Dec 21 12:28:39 CET 2008


>> It appears that this bug was already reported: http://bugs.python.org/issue4705
>>
>> Any chance that it gets in the next 3.0.x bugfix release?
>>
>> Just as a note, if I do: sys.stdout._line_buffering = True, it also
>> works, but doesn't seem right as it's accessing an internal attribute.
>>
>> Note 2: the solution that said to pass 'wb' does not work, because I
>> need the output as text and not binary or text becomes garbled when
>> it's not ascii.
>>
>
> Can't you decode the bytes after you receive them?
>

Well, in short, no (long answer is that I probably could if I spent a
long time doing my own console instead of relying on what's already
done and working in Eclipse for all the current available languages it
supports, but that just doesn't seem right).

Also, it's seems easily solvable (enabling line buffering for the
python streams when -u is passed) in the Python side... My current
workaround is doing that on a custom site-initialization when a Python
3 interpreter is found, but I find that this is not the right way for
doing it, and it really feels like a Python bug.

-- Fabio


More information about the Python-Dev mailing list