This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: BUG Modules/_io/texio.c
Type: behavior Stage:
Components: IO Versions: Python 3.9, Python 3.8, Python 3.7, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, jamercee, stutzbach
Priority: normal Keywords:

Created on 2019-10-15 14:22 by jamercee, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg354733 - (view) Author: Jim Carroll (jamercee) * Date: 2019-10-15 14:22
The io.TextIOWrapper class initializes a codec.IncrementalEncoder and uses it to encode str, but it never calls the encoder's encode('', final=True). According to the docs https://docs.python.org/3.5/library/codecs.html#codecs.IncrementalEncoder.encode:  

``If this is the last call to encode() final must be true (the default is false).``

Without a call to encode('', final=True), codecs cannot be created that use codecs.BufferedIncrementalEncoder which depend on being called with final=True to flush any internal buffers.

Platform: Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
History
Date User Action Args
2022-04-11 14:59:21adminsetgithub: 82666
2019-10-15 15:42:43serhiy.storchakasetnosy: + benjamin.peterson, stutzbach

type: behavior
components: + IO
versions: + Python 2.7, Python 3.8, Python 3.9
2019-10-15 14:22:34jamerceecreate