[issue1395] py3k: duplicated line endings when using read(1)

Raghuram Devarakonda report at bugs.python.org
Wed Nov 7 18:08:57 CET 2007


Raghuram Devarakonda added the comment:

I am attaching another  patch (io2.diff). Please review. I am not sure
whether _adjust_chunk() should also adjust "readahead".

BTW, PEP 3116 says:

"If universal newlines without translation are requested on input (i.e.
newline=''), if a system read operation returns a buffer ending in '\r',
another system read operation is done to determine whether it is
followed by '\n' or not. In universal newlines mode with translation,
the second system read operation may be postponed until the next read
request, and if the following system read operation returns a buffer
starting with '\n', that character is simply discarded."

I suppose this issue is mainly talking about the latter (newline is
None). I don't understand what is meant by "enabling universal new line
mode without translation". Isn't the purpose of enabling universal new
line mode is to translate line endings? I may be missing something
basic, of course.

Added file: http://bugs.python.org/file8706/io2.diff

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1395>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: io2.diff
Type: text/x-patch
Size: 4790 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-bugs-list/attachments/20071107/70289176/attachment-0001.bin 


More information about the Python-bugs-list mailing list