Responses has historically used from urllib3.connection import HTTPHeaderDict but that import is now failing in 1.26.0. Looking through the history this was changed as part of #2018
This change wasn't in the release notes and seems like an accidental regression. Is there a more stable package we should be importing HTTPHeaderDict from?
Describe your environment.
responses and urllib>=1.25.10from urllib3.connection import HTTPHeaderDict
This import has worked for at least the past year.
An import error is raised.
Refs getsentry/responses#354
Is there a more stable package we should be importing HTTPHeaderDict from?
This passive aggressive tact is unnecessary.
HTTPHeaderDict isn't supposed to be a public class (hence being defined in _collections). The import of HTTPHeaderDict in urllib3.response is likely more stable but there aren't any guarantees there either.
I've opened https://github.com/urllib3/urllib3/pull/2046 against 1.26 to relieve your users pain over this issue, however this import will not work in v2.
Will be released in v1.26.1
This passive aggressive tact is unnecessary.
I'm sorry. That was not my intent, I will try to be more direct in the future.
... however this import will not work in v2.
@sethmlarson In responses, we use this class when creating stubbed HTTP responses as it makes handling cookies easier. Will there be a different path to achieve that?
Most helpful comment
I've opened https://github.com/urllib3/urllib3/pull/2046 against 1.26 to relieve your users pain over this issue, however this import will not work in v2.