psf / requests

A simple, yet elegant, HTTP library.
https://requests.readthedocs.io/en/latest/
Apache License 2.0
52.2k stars 9.34k forks source link

requests > 2.31.0 - Unhashable type 'list' for 'cert' parameter #6751

Closed greateggsgreg closed 5 months ago

greateggsgreg commented 5 months ago

Subject

The requests.get() parameter used to accept 'cert' as a tuple or list, and this may be a regression from #1165

Environment

All

Steps to Reproduce

>>> import requests
>>> requests.get('https://localhost:8080/asdf', cert=['client-cert.pem', 'client-key.pem'], verify='ca-cert.pem')
Traceback (most recent call last):
<snip>
TypeError: unhashable type: 'list'
>>> requests.get('https://localhost:8080/asdf', cert=('client-cert.pem', 'client-key.pem'), verify='ca-cert.pem')
<Response [200]>

Expected Behavior

From requests == 2.31.0:

>>> import requests
>>> requests.get('https://localhost:8080/asdf'', cert=['client-cert.pem', 'client-key.pem'], verify='ca-cert.pem')
<Response [200]>
sigmavirus24 commented 5 months ago

It's always been documented as a tuple, and there's never been testing for accepting a list. I understand this seems like a regression but in reality it's an accidental improvement in what we accept to better match what we have documented since before 1.0

rayjlinden commented 2 months ago

It broke shit. Thanks for that. Particularly, since you also improved nothing...