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: Python version of TextIOWrapper ignores "write_through" arg
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, chris.jerdonek, ncoghlan, python-dev
Priority: normal Keywords: patch

Created on 2012-08-07 05:27 by ncoghlan, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue-15571-1.patch chris.jerdonek, 2012-08-07 08:10 review
Messages (6)
msg167603 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2012-08-07 05:27
In discussing #15216, I noticed that the write_through parameter is completely unused in the Python implementation of TextIOWrapper.

That also means we have a hole in the test coverage: there is no test that is run on both the C and Python versions to ensure that the data is being written directly through to the underlying buffer (e.g. by passing in a mock buffer object).
msg167606 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-08-07 07:30
The fact that the Python implementation doesn't look at write_through doesn't necessarily mean that it's not respected.  It could always write through.  Indeed, it looks like this is the case and was discussed at one point:

http://bugs.python.org/issue12591#msg141006

Also, it appears that there is a test in both cases (the test class is subclassed twice), though I could be wrong:

http://hg.python.org/cpython/file/0eeffeadaa1e/Lib/test/test_io.py#l2453

In any case, this could probably at least use a code comment.
msg167607 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2012-08-07 07:44
Ah, thanks. Yes, that could definitely use a comment :)
msg167608 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-08-07 08:10
Attaching patch.
msg168102 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-08-13 13:10
New changeset ba055ccd99ef by Andrew Svetlov in branch 'default':
Issue #15571: comment the fact what python impl of TextIOWrapper always works in write_throuth mode
http://hg.python.org/cpython/rev/ba055ccd99ef
msg168104 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-08-13 13:12
Patch applied
History
Date User Action Args
2022-04-11 14:57:33adminsetgithub: 59776
2017-05-19 15:08:22serhiy.storchakalinkissue29611 superseder
2012-08-13 13:12:25asvetlovsetstatus: open -> closed

nosy: + asvetlov
messages: + msg168104

resolution: fixed
stage: needs patch -> resolved
2012-08-13 13:10:11python-devsetnosy: + python-dev
messages: + msg168102
2012-08-07 08:10:43chris.jerdoneksetfiles: + issue-15571-1.patch
keywords: + patch
messages: + msg167608
2012-08-07 07:44:05ncoghlansetpriority: release blocker -> normal
type: behavior -> enhancement
messages: + msg167607

stage: test needed -> needs patch
2012-08-07 07:30:03chris.jerdoneksetnosy: + chris.jerdonek
messages: + msg167606
2012-08-07 05:27:36ncoghlancreate