Message311545
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. |
|
Date |
User |
Action |
Args |
2018-02-03 10:54:37 | rkdls | set | recipients:
+ rkdls, methane |
2018-02-03 10:54:37 | rkdls | set | messageid: <1517655277.68.0.467229070634.issue32729@psf.upfronthosting.co.za> |
2018-02-03 10:54:37 | rkdls | link | issue32729 messages |
2018-02-03 10:54:37 | rkdls | create | |
|