New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keepends param in codec readline(s) #52876
Comments
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: |
We can add those to 3.2. Not sure about 2.7 - it's already in feature freeze. |
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. |
André: Could you provide a patch ? Thanks. |
The parameter would not be a new feature since the codecs docs states that: The reader (StreamReader) accepts the parameter, so it's expected that I'm not sure how to submit a patch. 2010/5/6 Marc-Andre Lemburg <report@bugs.python.org>:
|
I think this can qualify as a bug fix. |
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. |
Wrote tests |
I stumbled across this too: I have an input file with contents
I want to get the contents of this file, as a list of lines, with the trailing newlines removed. There is only one reference to a
But I cannot find how to invoke this method with
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: