[Python-ideas] Fix default encodings on Windows

Random832 random832 at fastmail.com
Fri Aug 12 14:35:13 EDT 2016


On Fri, Aug 12, 2016, at 12:24, Adam Bartoš wrote:
> There is no buffer just on those wrapping streams because the bytes I
> have are not in UTF-8. Adding one would mean a fake buffer that just
> decodes and writes to the text stream. AFAIK there is no guarantee
> that sys.std* objects have buffer attribute and any code relying on
> that is incorrect. But I inderstand that there may be such code and we
> may want to be compatible.

Yes that's what I meant, I just think it needs to be considered if we're
thinking about making it (or something like it) the default python
sys.std*. Maybe the decision will be that maintaining compatibility with
these cases isn't important.

> > - The sys.stdout obtained via streams.enable does not support
> >   .buffer / .buffer.raw / .detach
> > - All of these objects provide a fileno() interface.
>
> Is this wrong? If I remember, I provide it because of some check --
> maybe in input() -- to be viewed as a stdio stream.

I don't know if it's *wrong* per se (same with the no buffer/raw thing
etc), I'm just concerned about the possible effects on code that is
written against the current implementation.


More information about the Python-ideas mailing list