[New-bugs-announce] [issue42060] Usage of assert in http/client.py

Felipe Rodrigues report at bugs.python.org
Sat Oct 17 08:53:09 EDT 2020


New submission from Felipe Rodrigues <felipe at felipevr.com>:

Hi all!

I was testing some static analysis tool and decided to use the HTTP module as testing ground. While running `bandit` at the client module, it detected 3 instances of using `assert` inside the code. Twice in the HTTPResponse class and once in the HTTPConnection class.

Now, I know that this will only cause any trouble when running python with the optimize settings turned on and if someone is that concerned about optimization, they probably won't be using the stdlib's HTTP implementation, but I think it would be fitting to fix this corner case.

I've written a PR that fixes this but I'm not sure if the raised exceptions and messages are ok

----------
components: Library (Lib)
messages: 378810
nosy: fbidu
priority: normal
severity: normal
status: open
title: Usage of assert in http/client.py
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42060>
_______________________________________


More information about the New-bugs-announce mailing list