Arno-Can Uestuensoez <acue.opensou...@gmail.com> added the comment:

@xtreak
I didn't checked the source of the assignment of the instance of *Retry* to 
*self.total*. For me it was important to get the display of the actual source 
of the failure, which is the failed access to PyPI. Thus my proposal, just to 
intercept the error, display a bug-report, and display the quite good error 
message for the failed PyPI access already contained in the code. 

Thus the intention to replace:

>  File 
> "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py",
>  line 315, in increment
>
>    total -= 1
>
> TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'

by:

> Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after 
> connection broken by 
> 'ConnectTimeoutError(&lt;requests.packages.urllib3.connection.VerifiedHTTPSConnection
>  object at/
>
>  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after 
> connection broken by 
'ConnectTimeoutError(&lt;requests.packages.urllib3.connection.VerifiedHTTPSConnection
 object at/
>
>  Could not find a version that satisfies the requirement evdev (from 
> versions: )
>
> No matching distribution found for evdev
>
> WARNING : Pip failed to install software!

Optionally with an additional error message for the faulty assignment to  the 
member *total*. But this is actually just a repetition counter, so even the 
integer replacement(>=1) should be OK. If an application uses it - wrongly - as 
a reference pointer, this will fail than immediately and the app recognises 
it's error straight away.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35334>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to