[issue38485] BUG Modules/_io/texio.c

2019-10-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +IO
nosy: +benjamin.peterson, stutzbach
type:  -> behavior
versions: +Python 2.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38485] BUG Modules/_io/texio.c

2019-10-15 Thread Jim Carroll


New submission from Jim Carroll :

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

--
messages: 354733
nosy: jamercee
priority: normal
severity: normal
status: open
title: BUG Modules/_io/texio.c
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com