Serhiy Storchaka <storch...@gmail.com> added the comment:

> Forget other filelike objects. The FileInput class only works with actual 
> files,

No. sys.stdin can be reassigned before using FileInput. And FileInput
has openhook parameter (for read compressed files or get files from Web,
for example).

>  so the readlines function should always return at least as many bytes as its 
> first parameter. Is this assumption wrong?

qwert
'qwert\n'

You type five characters "qwert" end press <Enter>. Python immediately
receives these six characters, and returns a result of
sys.stdin.readline(1000). Only six characters, and no one symbol more,
because more characters you have not entered yet.

I believe that for such questions will be more appropriate to use a
mailing list (python-l...@python.org, or newsgroup
gmane.comp.python.general on news://news.gmane.org), and not bugtracker.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15068>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to