Comment #10 on issue 995 by pekka.klarck: Mac OS X: IOError: [Errno 35] Resource temporarily unavailable
http://code.google.com/p/robotframework/issues/detail?id=995

I'm looking at this again after some time. It seems to me that the original problem and the problem in comment #6 are not the same. The former fails with error `IOError: [Errno 35] Resource temporarily unavailable` when writing to real stderr (actually __stderr__), and the latter fails with `ValueError: I/O operation on closed file` when writing to stdout (or stderr) replaced with StringIO that has been closed.

I'm still trying to understand do these problems occur because Robot does something stupid or are they caused by bugs/features in the underlying I/O implementation or some other external reasons. With the latter problem I think it's pretty fair to guess that the root cause is Robot bug but the former could also be caused by someone else.

The mechanism to start execution and how to open/close internal loggers have changed during RF 2.7 development. Some problems that could have caused at least the latter problem have been fixed. If the original problem was caused by our bug, it may also have been resolved.

Could you, Filip, try RF 2.7 beta 1 (or forthcoming beta 2) without your patches and see do you still encounter the problems you have reported? If you do, it would be great if you could try modifying the code of the framework like suggested in my above comment. That way we ought to get more information about the failure and hopefully understand it better. Based on the results we then can try to fix the actual problem or add your patch as a workaround for external bugs/features.

Notice that after the changes the code mentioned in the above comment has moved and now lives, refactored, in `robot/utils/application.py`. You should change its `_execute` method to contain this:

    def _execute(self, arguments, options):
        try:
            rc = self.main(arguments, **options)
        except DataError, err:
            return self._report_error(unicode(err), help=True)
        except (KeyboardInterrupt, SystemExit):
            return self._report_error('Execution stopped by user.',
                                      rc=STOPPED_BY_USER)
        except:
            raise    # <----------- THIS WAS ADDED -----------
            error, details = get_error_details()
            return self._report_error('Unexpected error: %s' % error,
                                      details, rc=FRAMEWORK_ERROR)
        else:
            return rc or 0


Reply via email to