kennethreitz/requests — pull request #937 by cleg (2012-11-13 15:45:44+00:00)
Title: Fix for default_user_agent when SIGCHILD intercepted 

In environment, where SIGCHILD interrupted (e.g. running code under gunicorn) — platform.system() and platform.release() causes `IOError: [Errno 10] No child processes`

Tail of the stacktrace in this case:
```
File "/Users/cleg/Projects/nimble-all/server/eggs/braintree-2.14.1-py2.7.egg/braintree/util/http_strategy/requests_strategy.py", line 2, in
import requests
File "/usr/local/lib/python2.7/site-packages/requests/__init__.py", line 53, in
from .models import Request, Response
File "/usr/local/lib/python2.7/site-packages/requests/models.py", line 27, in
from .defaults import SCHEMAS
File "/usr/local/lib/python2.7/site-packages/requests/defaults.py", line 34, in
'User-Agent': default_user_agent(),
File "/usr/local/lib/python2.7/site-packages/requests/utils.py", line 546, in default_user_agent
'%s/%s' % (platform.system(), platform.release()),
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 1303, in release
return uname()[2]
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 1250, in uname
processor = _syscmd_uname('-p','')
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 1007, in _syscmd_uname
rc = f.close()
IOError: [Errno 10] No child processes
```

I've implementer simple workaround to make this code workable in any circumstances. Maybe it's not the best solution in this case, but it does the trick. Maybe better add general error handling to whole `default_user_agent` function.