Bug in io.TextIOWrapper?

Jon Ribbens jon+usenet at unequivocal.eu
Mon Jun 19 16:15:32 EDT 2023


On 2023-06-19, Inada Naoki <songofacandy at gmail.com> wrote:
> I checked TextIOWrapper source code and confirmed that it doesn't call
> encoder.write(text, finish=True) on close.
> Since TextIOWrapper allows random access, it is difficult to call it
> automatically. So please think it as just limitation rather than bug.
> Please use codec and binary file manually for now.

It could call it on seek() or flush(). It seems like a definite bug to
me, in that its behaviour appears clearly incorrect - it's just that
there isn't an entirely obvious "100% correct" behaviour to choose.


More information about the Python-list mailing list