[issue32729] socket error handling needed

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32729] socket error handling needed

2018-02-03 Thread yang

yang  added the comment:

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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32729] socket error handling needed

2018-02-03 Thread INADA Naoki

INADA Naoki  added the comment:

And your screenshot doesn't contain "full" traceback chain.
It can be very important hint about who creates invalid TimeoutError.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32729] socket error handling needed

2018-02-03 Thread INADA Naoki

INADA Naoki  added the comment:

It may be bug of raising TimeoutError, not catching.
That's why I want example code to reproduce.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32729] socket error handling needed

2018-02-03 Thread yang

yang  added the comment:

When timeout error occurred in urllib3.Poolmanager.urlopen(), the built-in 
TimeoutError raised which is not caught in existing timeout exception clause.

Thus, It is caught by 'error' except and it is not checking Nonetype so that 
raising IndexError

It patched that error and detailed in PR-5458

https://github.com/python/cpython/pull/5458

Thank you and sorry for not good at english.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32729] socket error handling needed

2018-02-01 Thread INADA Naoki

INADA Naoki  added the comment:

Please give us reproducible example.
Otherwise, we can't know it's our bug or it's bug of caller.

--
nosy: +inada.naoki

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32729] socket error handling needed

2018-01-31 Thread yang

yang  added the comment:

In the lib/socket.py 

Inside of readinto function, 576 line 
needed None type check or something

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32729] socket error handling needed

2018-01-31 Thread yang

Change by yang :


--
keywords: +patch
pull_requests: +5286
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32729] socket error handling needed

2018-01-31 Thread yang

yang  added the comment:

If socket error occurred I think it is a timeout error or something. but It's 
not error raising correctly but IndexError which is not correct error MSG.

It will be fixed or None type check needed.

--
resolution:  -> fixed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32729] socket error handling needed

2018-01-30 Thread 양영일

New submission from 양영일 :

socket error handling needed

--
components: IO
messages: 311313
nosy: 양영일
priority: normal
severity: normal
status: open
title: socket error handling needed
type: crash
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com