from requests import get
if __name__ == '__main__':
invalid_url = 'http://_/'
req = get(invalid_url,
res = req.send() # throws ConnectionError
The reason is catch_exceptions_if_in_safe_mode() decorates request() which calls Session.request() which does not call Request.send() when send_request is False which is the case with async requests. I guess we should decorate Request.send() not request()
See issue #583
We will also have to change the catch_exceptions_if_in_safe_mode decorator a bit, so that it can decorate a method rather than a function, but that shouldn't be difficult.
Fixes safe mode when not sending requests immediately (issue #639)
+1 for this @piotr-dobrogost requests fork fixes exceptions when using grequest
an obsolete request since safe_mode is removed in 1.0?