Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 995 by filip.noetzel: Mac OS X: IOError: [Errno 35] Resource temporarily unavailable
http://code.google.com/p/robotframework/issues/detail?id=995

Hey guys,

from time to time I encounter this error, often when the root suite setup fails with a fatal error (on Mac OS X Lion with CPython 2.7):

Unexpected error: IOError: [Errno 35] Resource temporarily unavailable
Traceback (most recent call last):
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/__init__.py", line 88, in _execute
    suite = method(*datasources, **options)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/__init__.py", line 125, in run
    suite.run(output)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/running/model.py", line 116, in run
    self._run_sub_suites(context)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/running/model.py", line 160, in _run_sub_suites
    suite.run(context.output, self, self.run_errors)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/running/model.py", line 116, in run
    self._run_sub_suites(context)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/running/model.py", line 160, in _run_sub_suites suite.run(context.output, self, sel File "/Users/filip/workspace/myproject/bin/robotframework", line 24, in <module> robot.run_from_cli(["-A", "/Users/filip/workspace/myproject/etc/robotframework/robotframework.args"] + sys.argv[1:], robot.runner.__doc__) File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/__init__.py", line 60, in run_from_cli
    return _run_or_rebot_from_cli(run, args, usage, pythonpath='pythonpath')
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/__init__.py", line 78, in _run_or_rebot_from_cli
    return _execute(method, datasources, options)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/__init__.py", line 97, in _execute
    _report_error('Unexpected error: %s' % error, details)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/__init__.py", line 164, in _report_error
    LOGGER.error(message)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/output/loggerhelper.py", line 55, in error
    self.write(msg, 'ERROR')
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/output/loggerhelper.py", line 58, in write
    self.message(Message(message, level, html))
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/output/logger.py", line 95, in message
    logger.message(msg)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/output/monitor.py", line 54, in message
    stream=sys.__stderr__)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/output/monitor.py", line 93, in _write_with_highlighting
    self._write(after, newline=newline, stream=stream)
File "/Users/filip/.buildout/eggs/robotframework-2.6.1-py2.7.egg/robot/output/monitor.py", line 84, in _write
    stream.write(utils.encode_output(message).replace('\t', ' '*8))
IOError: [Errno 35] Resource temporarily unavailable

There seems to be a race condition between writing the last bits to sys.stdout and closing sys.stdout, but you know the internals better than I do.

Doing some research, this seems to be similar to this bug in the trac project:

"Well, apparently FreeBSD's threading library automatically sets stdin and stdout to be non-blocking. I guess for C apps this wouldn't be a big deal since it'd only occur when you explicitly use threading, but since threading support in Python needs compiled in at the interpreter level this will always happen, regardless of whether the Python app itself is threaded." [http://trac.edgewall.org/ticket/2066]


Reply via email to