Issue 8630: Keepends param in codec readline(s) (original) (raw)

Created on 2010-05-05 16:38 by amccampos, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
codecs.py amccampos,2010-05-06 12:07 new codecs.py fixing the issue
Issue8630.patch BreamoreBoy,2014-06-15 20:09 Patch to add missing keepends parameters review
45139b30afef.diff jeffrey.falgout,2014-06-22 18:17 Adds missing parameters to readline and readlines. Adds tests to test_codecs.py review

| Repositories containing patches | | | | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | | | | https://bitbucket.org/bloomberg/cpython#issue8630 | | | |

Messages (8)
msg105056 - (view) Author: André M. C. Campos (amccampos) Date: 2010-05-05 16:38
Some methods in StreamReaderWriter class (codecs library) has different signatures from StreamReader methods. More precisely it's missing the keepends parameter in readline and readlines methods. So, we cannot code: fp = codecs.open(fileName, "r", "utf-8") lines = fp.readlines(keepends=False) or line = fp.readline(keepends=False)
msg105128 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2010-05-06 07:53
We can add those to 3.2. Not sure about 2.7 - it's already in feature freeze.
msg105132 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2010-05-06 10:22
Benjamin: Would the added parameter be a new feature or not ? It looks like an oversight when adding the parameter to the standard codec classes, so could be viewed as a bug.
msg105133 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2010-05-06 10:23
André: Could you provide a patch ? Thanks.
msg105140 - (view) Author: André M. C. Campos (amccampos) Date: 2010-05-06 12:06
The parameter would not be a new feature since the codecs docs states that: "The StreamReaderWriter allows wrapping streams which work in both read and write modes". The reader (StreamReader) accepts the parameter, so it's expected that StreamReaderWriter does the same. I'm not sure how to submit a patch. So, I'm submitting a new codecs.py file through the issue track interface (issue 8630). If it's not that in that way, could you please tell me the path? André. 2010/5/6 Marc-Andre Lemburg <report@bugs.python.org>: > > Marc-Andre Lemburg <mal@egenix.com> added the comment: > > André: Could you provide a patch ? > > Thanks. > > ---------- > assignee: benjamin.peterson -> > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue8630> > _______________________________________ >
msg105324 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-05-08 18:36
I think this can qualify as a bug fix.
msg220668 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-15 20:09
As codecs.py has changed I've generated a patch file which adds the missing parameters. I looked at test_codecs.py but could only find one reference to the StreamReaderWriter class in WithStmtTest. I'm sorry but I'll have to leave writing tests for StreamReaderWriter to somebody that's better qualified than myself.
msg221291 - (view) Author: Jeffrey Falgout (jeffrey.falgout) * Date: 2014-06-22 18:11
Wrote tests
History
Date User Action Args
2022-04-11 14:57:00 admin set github: 52876
2019-03-15 23:41:27 BreamoreBoy set nosy: - BreamoreBoy
2014-06-24 09:47:51 serhiy.storchaka set versions: + Python 3.4, Python 3.5, - Python 3.2
2014-06-22 18:17:03 jeffrey.falgout set files: + 45139b30afef.diff
2014-06-22 18:11:44 jeffrey.falgout set hgrepos: + hgrepo259messages: + nosy: + jeffrey.falgout
2014-06-15 20:09:10 BreamoreBoy set files: + Issue8630.patchnosy: + BreamoreBoymessages: + keywords: + patch
2010-05-08 18:36:49 benjamin.peterson set messages: +
2010-05-06 12:07:58 amccampos set files: + codecs.py
2010-05-06 12:06:34 amccampos set messages: +
2010-05-06 10:23:31 lemburg set assignee: benjamin.peterson -> messages: +
2010-05-06 10:22:59 lemburg set assignee: benjamin.petersonmessages: + nosy: + benjamin.peterson
2010-05-06 07:53:21 lemburg set messages: + versions: + Python 2.7, Python 3.2, - Python 2.6
2010-05-05 18:08:50 r.david.murray set nosy: + lemburg
2010-05-05 16:38:14 amccampos create