Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EAGAIN when sys.stdin.readline() #39696

Closed
frallan mannequin opened this issue Dec 11, 2003 · 5 comments
Closed

EAGAIN when sys.stdin.readline() #39696

frallan mannequin opened this issue Dec 11, 2003 · 5 comments
Labels
extension-modules C modules in the Modules dir

Comments

@frallan
Copy link
Mannequin

frallan mannequin commented Dec 11, 2003

BPO 858253
Nosy @gaul, @hyeshik, @tiran

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-01-20.19:02:40.971>
created_at = <Date 2003-12-11.13:12:22.000>
labels = ['extension-modules']
title = 'EAGAIN when sys.stdin.readline()'
updated_at = <Date 2008-01-20.19:02:40.969>
user = 'https://bugs.python.org/frallan'

bugs.python.org fields:

activity = <Date 2008-01-20.19:02:40.969>
actor = 'christian.heimes'
assignee = 'none'
closed = True
closed_date = <Date 2008-01-20.19:02:40.971>
closer = 'christian.heimes'
components = ['Extension Modules']
creation = <Date 2003-12-11.13:12:22.000>
creator = 'frallan'
dependencies = []
files = []
hgrepos = []
issue_num = 858253
keywords = []
message_count = 5.0
messages = ['60434', '60435', '60436', '60437', '61330']
nosy_count = 4.0
nosy_names = ['gaul', 'frallan', 'hyeshik.chang', 'christian.heimes']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue858253'
versions = ['Python 2.3']

@frallan
Copy link
Mannequin Author

frallan mannequin commented Dec 11, 2003

$ cat test.py
import sys
print sys.stdin.readline()
$ python test.py | python test.py
Traceback (most recent call last):
  File "test.py", line 2, in ?
    print sys.stdin.readline()
IOError: [Errno 35] Resource temporarily unavailable

This happens about 3 times out of 5.
It happens under FreeBSD 5.1-RELEASE (SMP) and:
python-2.1.3
python-2.2.3
python-2.3.2
python-2.3.3c1

It does _not_ happen under Debian 3.0 or
FreeBSD 4.7-RELEASE (SMP).

According to read(2) this "error" should occur only when
the descriptor is in non-blocking mode. However as you
can see from the program it isn't. Further I have caught
the IOError and run fcntl(F_GETFL) on sys.stdin.fileno()
and the only flag set is O_RDWR.

@frallan frallan mannequin added extension-modules C modules in the Modules dir labels Dec 11, 2003
@gaul
Copy link
Mannequin

gaul mannequin commented Dec 12, 2003

Logged In: YES
user_id=139865

Same on OpenBSD:

$ uname -a
OpenBSD owl 3.2 GENERIC#25 i386
$ python -V
Python 2.2.1
$ python test.py | python test.py
Traceback (most recent call last):
  File "test.py", line 2, in ?
    print sys.stdin.readline()
IOError: [Errno 35] Resource temporarily unavailable

@hyeshik
Copy link
Contributor

hyeshik commented Dec 13, 2003

Logged In: YES
user_id=55188

I could not reproduce the error on several versions of FreeBSD:

5.2-BETA Thu Dec 4 21:59:16 KST 2003 i386 (non-SMP)
5.2-CURRENT Sat Dec 13 08:02:47 PST 2003 alpha (SMP)
5.2-CURRENT Tue Dec 9 02:39:36 PST 2003 ia64 (SMP)
5.2-CURRENT Sat Dec 13 07:52:29 PST 2003 i386 (SMP)
5.1-RELEASE Sat Jun 14 05:13:38 KST 2003 i386 (SMP)

Do you have any uncommon factor of environment?
(and did you install the python via ports?)

@frallan
Copy link
Mannequin Author

frallan mannequin commented Dec 14, 2003

Logged In: YES
user_id=639616

All my python versions are compiled from source.

Further, since the problem only occur some of the time and
only on some of the platforms, it's natural to suspect foul play
from the runtime environment (i.e shell, OS) and that it might
not be a bug in python. It's not like blocking input should be a
black art.

I refuse to believe that this issue has never been raised
before and subsequently solved. It's just a matter of finding
the right mailing list archive. The alternative seems to be
hacking the interpreter and try to narrow it down.

@tiran
Copy link
Member

tiran commented Jan 20, 2008

The bug is probably outdated. Please create a new issue if the bug still
occurs for you with newer versions of Python and your OS.

@tiran tiran closed this as completed Jan 20, 2008
@tiran tiran closed this as completed Jan 20, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir
Projects
None yet
Development

No branches or pull requests

2 participants