On 2023-06-19, Inada Naoki <songofaca...@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. -- https://mail.python.org/mailman/listinfo/python-list