A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-November/136930.html below:

[Python-Dev] py34 makes it harder to read all of a pty

[Python-Dev] py34 makes it harder to read all of a ptyBuck Golemon buck.2019 at gmail.com
Wed Nov 12 23:16:50 CET 2014
This code works as expected in python <3.4 (printing 'ok' then an error),
but only gives an error in python3.4.

```
import os
read_fd, write_fd = os.openpty()
os.write(write_fd, b'ok\n')
os.close(write_fd)

read_file = os.fdopen(read_fd, 'rb', 0)
print("read: %r" % read_file.read())
print("read: %r" % read_file.read())
```

This is due to the fix for issue21090 <http://bugs.python.org/issue21090>,
which aimed to un-silence errors which previously went unheard. The fix is
for me, as a user, to write a loop that uses os.read and interpretes EIO as
EOF. This is what I had hoped file.read() would do for me, however, and
what it used to do in previous pythons.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20141112/1e95c268/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4