This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rkdls
Recipients methane, rkdls
Date 2018-02-03.10:54:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517655277.68.0.467229070634.issue32729@psf.upfronthosting.co.za>
In-reply-to
Content
Oh.. you are right. 
I think it's my bug. here is code
```
import urllib3
import certifi
from functools import wraps
import signal
from urllib3 import Timeout


def timeoutdec(sec):
    def decorator(func):
        def _timeout(signum, frame):
            raise TimeoutError()

        @wraps(func)
        def wrapper(*args, **kwargs):
            signal.signal(signal.SIGALRM, _timeout)
            signal.alarm(sec)
            try:
                result = func(*args, **kwargs)
            finally:
                signal.alarm(0)
            return result
        return wrapper
    return decorator


@timeoutdec(2)
def for_test():
    timeout = Timeout(connect=10.0, read=2.0)
    url = 'http://httpbin.org/delay/7'
    method = 'GET'
    body = None
    headers = None
    http = urllib3.PoolManager(timeout=timeout,
                               cert_reqs='CERT_REQUIRED',
                               ca_certs=certifi.where())
    while True:
        response = http.urlopen(method, url,
                                body=body,
                                headers=headers,
                                preload_content=True)

        print(response.data)


for_test()

```

here is the code that i got same traceback.

maybe the TimeoutError is raised from my code, timeoutdec().

I thought it was python bug. sorry for bothering you.


and I will close my PR-32729.
History
Date User Action Args
2018-02-03 10:54:37rkdlssetrecipients: + rkdls, methane
2018-02-03 10:54:37rkdlssetmessageid: <1517655277.68.0.467229070634.issue32729@psf.upfronthosting.co.za>
2018-02-03 10:54:37rkdlslinkissue32729 messages
2018-02-03 10:54:37rkdlscreate