John Machin <sjmac...@users.sourceforge.net> added the comment: Before patching, could we discuss the requirements?
There are two different concepts: (1) "text" file (assume that CR and/or LF are line terminators, and provide methods for accessing a line at a time) versus "binary" file (no such assumptions, no such access) (2) reading the file as a raw undecoded "bytes" file or as a decoded "str" file. Options for 3.X: (1) caller uses mode 'rb', is given bytes objects back. (2) caller uses mode 'rt' and provides an encoding, is given str objects back. IMPORTANT: Option 2 must NOT not read the file as a collection of "lines"; it must process it (conceptually at least) a character at a time so that embedded CR and/or LF are not taken to be row terminators. Following the line that 3.X line should do what's best, not what we used to do, the implication is that we choose option 2. ---------- message_count: 10.0 -> 11.0 nosy: +skip.montanaro nosy_count: 6.0 -> 7.0 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4847> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com