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.

Author v+python
Recipients r.david.murray, susurrus, v+python
Date 2013-02-01.19:20:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359746431.81.0.148386907107.issue17083@psf.upfronthosting.co.za>
In-reply-to
Content
I think Bryant's request is reasonable, for consistency in functionality. If line oriented operations are allowed on binary files, then a binary newline value should be permitted at the time of open.

I think, for handling binary files, that it would also be interesting to have a version of readline that takes a binary newline file as a parameter to each readline call, because in binary files, the concept of newline can vary from section to section of the file... here, null-terminated records, there CR LF terminated encoded text records, elsewhere fixed-length records, and another place might have records delimited by some binary token of one or more bytes.  Readline with a newline parameter could be useful in three of those cases, read in the fixed-length case.  But this paragraph would be a new feature.

However, simpler binary files, which may have only one type of "terminated" records, could effectively use the operations Bryant is suggesting, which seems quite reasonable to me, along with a mix of read calls for non-delimited data, fixed-length data, or data requiring complex logic to decode.
History
Date User Action Args
2013-02-01 19:20:31v+pythonsetrecipients: + v+python, r.david.murray, susurrus
2013-02-01 19:20:31v+pythonsetmessageid: <1359746431.81.0.148386907107.issue17083@psf.upfronthosting.co.za>
2013-02-01 19:20:31v+pythonlinkissue17083 messages
2013-02-01 19:20:31v+pythoncreate