[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2021-02-22 Thread Christoph Anton Mitterer
Christoph Anton Mitterer added the comment: btw, just something for the record: I think the example given in msg109117 above is wrong: Depending on the read size it will produce different results, given how split() works: Imagine a byte sequence: >>> b"\0foo\0barbaz\0\0abcd".split(b"\0") [b

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2021-02-22 Thread Christoph Anton Mitterer
Christoph Anton Mitterer added the comment: Oh, what a pity,... Seemed like a pretty common use case, which is unnecessarily prone to buggy or inefficient (user-)implementations. -- ___ Python tracker _

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2021-02-22 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> later stage: needs patch -> resolved status: open -> closed ___ Python tracker ___ _

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2021-02-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't think so. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2021-02-21 Thread Christoph Anton Mitterer
Christoph Anton Mitterer added the comment: Just wondered whether this is still being considered? Cheers, Chris. -- nosy: +calestyo ___ Python tracker ___ _

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2019-08-25 Thread Géry
Change by Géry : -- nosy: +maggyero ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-09-04 Thread Martin Panter
Martin Panter added the comment: Related: * Issue 563491: 2002 proposal for parameter to readline, rejected at the time * Issue 17083: Newline is hard coded for binary file readline Fixing this issue for binary files would probably also satisfy Issue 17083. -- _

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-28 Thread Akira Li
Akira Li added the comment: > Akira, your patch does this: > > -self._writetranslate = newline != '' > -self._writenl = newline or os.linesep > +self._writetranslate = newline in (None, '\r', '\r\n') > +self._writenl = newline if newline is not None else os.linesep

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-27 Thread Andrew Barnert
Andrew Barnert added the comment: Akira, your patch does this: -self._writetranslate = newline != '' -self._writenl = newline or os.linesep +self._writetranslate = newline in (None, '\r', '\r\n') +self._writenl = newline if newline is not None else os.linesep Any

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-26 Thread Akira Li
Akira Li added the comment: > As a side-effect it also fixes the bug in line_buffering=True > behavior, see issue22069O. It should be issue22069 "TextIOWrapper(newline="\n", line_buffering=True) mistakenly treat \r as a newline" Reuploaded the patch so that it applies cleanly on the current ti

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-26 Thread Phil Connell
Changes by Phil Connell : -- nosy: +pconnell ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-25 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-25 Thread Akira Li
Akira Li added the comment: To make the discussion more specific, here's a patch that adds support for alternative newlines in _pyio.TextIOWrapper. It aslo updates the documentation and adds more io tests. It does not provide C implementation or the extended newline support for binary files. As

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-20 Thread Andrew Barnert
Changes by Andrew Barnert : Added file: http://bugs.python.org/file36009/pep-peek.txt ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-20 Thread Andrew Barnert
Changes by Andrew Barnert : Added file: http://bugs.python.org/file36008/pep-newline.txt ___ Python tracker ___ ___ Python-bugs-list mailing

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-20 Thread Wolfgang Maier
Changes by Wolfgang Maier : -- nosy: +wolma ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-19 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-19 Thread Andrew Barnert
Andrew Barnert added the comment: One last thing, a quick & dirty solution that works today, if you don't mind accessing private internals of stdlib classes, and don't mind giving up the performance of _io for _pyio, and don't need a solution for binary files: class MyTextIOWrapper(_pyio.TextI

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-19 Thread Andrew Barnert
Andrew Barnert added the comment: While we're at it, Douglas Alan's solution wouldn't be an ideal solution even if it were a builtin. A fileLineIter obviously doesn't support the stream API. It means you end up with two objects that share the same file, but have separate buffers and out-of-syn

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-19 Thread Andrew Barnert
Andrew Barnert added the comment: http://thread.gmane.org/gmane.comp.python.ideas/28310 discusses the same idea. Guido raised a serious problem with either adding an argument to readline and friends, or adding new methods readrecord and friends: It means the hundreds of existing file-like obje

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2012-08-19 Thread Nick Coghlan
Changes by Nick Coghlan : -- title: Enhance file.readlines by making line separator selectable -> Add support for reading records with arbitrary separators to the standard IO stack versions: +Python 3.4 -Python 3.2 ___ Python tracker