<div dir="ltr">The builtin open() was replaced with io.open().<div>It's difference between file.readlines() and io.IOBase.readlines().</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 6, 2013 at 2:15 AM, Giampaolo Rodolą <span dir="ltr"><<a href="mailto:g.rodola@gmail.com" target="_blank">g.rodola@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">with open('test-xxx', 'w') as f:<br>
    f.write('aaa\nbbb\nccc')<br>
with open('test-xxx', 'r') as f:<br>
    print(f.readlines(1))<br>
<br>
On Python 3.3 I get:<br>
<br>
['aaa\n']<br>
<br>
...while on Python 2.7:<br>
<br>
['aaa\n', 'bbb\n', 'ccc']<br>
<br>
<br>
Is this a bug or I'm missing something?<br>
<br>
<br>
--- Giampaolo<br>
<a href="https://code.google.com/p/pyftpdlib/" target="_blank">https://code.google.com/p/pyftpdlib/</a><br>
<a href="https://code.google.com/p/psutil/" target="_blank">https://code.google.com/p/psutil/</a><br>
<a href="https://code.google.com/p/pysendfile/" target="_blank">https://code.google.com/p/pysendfile/</a><br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/songofacandy%40gmail.com" target="_blank">http://mail.python.org/mailman/options/python-dev/songofacandy%40gmail.com</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>INADA Naoki  <<a href="mailto:songofacandy@gmail.com">songofacandy@gmail.com</a>>
</div>