[issue42060] Usage of assert in http/client.py

2020-10-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: Are these assertion failures actually reachable due to malformed input? If so, there should be some tests to that effect. Otherwise, if they're actually "impossible" situations, I don't think this change is necessary. -- nosy: +benjamin.peterson

[issue42060] Usage of assert in http/client.py

2020-10-18 Thread Vedran Čačić
Vedran Čačić added the comment: If I understand correctly, those are _private methods_ (names start with underscore). In such cases, asserts can be completely fine, since the library writer controls the situations where the method is called. If it is never called with _UNKNOWN argument, asser

[issue42060] Usage of assert in http/client.py

2020-10-17 Thread Felipe Rodrigues
Change by Felipe Rodrigues : -- keywords: +patch pull_requests: +21700 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22737 ___ Python tracker ___

[issue42060] Usage of assert in http/client.py

2020-10-17 Thread Felipe Rodrigues
New submission from Felipe Rodrigues : 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