plaid-python icon indicating copy to clipboard operation
plaid-python copied to clipboard

urllib3 deprecation warning

Open radoshi opened this issue 1 year ago • 3 comments

Hello,

We're seeing deprecation warnings in plaid python lib for urllib3

  /.../lib/python3.12/site-packages/plaid/exceptions.py:105: DeprecationWarning: HTTPResponse.getheaders() is deprecated and will be removed in urllib3 v2.1.0. Instead access HTTPResponse.headers directly.
    self.headers = http_resp.getheaders()

python: 3.12.4 plaid-python: 23.0.0

It's coming from: https://github.com/plaid/plaid-python/blob/master/plaid/exceptions.py#L105

Urllib's current version (as of 7/16/24) is 2.2.2 Here is the urllib3 code in question: https://github.com/urllib3/urllib3/blob/main/src/urllib3/response.py#L514

In the past, this doesn't seem to have been a priority: https://github.com/plaid/plaid-python/issues/447 and https://github.com/plaid/plaid-python/issues/474 (to be fair, slightly different file, though I suspect same solution).

The urllib3 dependency in the plaid lib is >1.25.3 https://github.com/plaid/plaid-python/blob/master/setup.py#L7

I could be wrong, but I believe this update to requirements.txt didn't actually restrict urllib3 to 2.1.0 as intended: https://github.com/plaid/plaid-python/issues/447#issuecomment-1363088131

(FWIW I don't think you should restrict it any longer since 2.1.0 has been superceded since January of this year.)

Is there any chance of a fix for this?

Thank you so much!

radoshi avatar Jul 17 '24 05:07 radoshi

Thanks for filing this!

What has changed since the last time this issue was filed is that this has been fixed upstream https://github.com/OpenAPITools/openapi-generator/blame/master/samples/client/echo_api/python/openapi_client/rest.py#L54 so while upgrading the python generator version continues to be an extremely messy prospect (due to the extensive breaking changes it would cause for users of the python client library), we could try cherry-picking the fix.

We can't promise a timeline (this doesn't appear to be a super urgent issue for anyone) but I'll take a look when I get a chance.

(BTW the intention of the edit in the requirements.txt is to prevent the use of urllib3 2.1.0 and later versions, not to allow it, so I think the edit is correct (although could be less strict, since I believe it is currently also blocking urllib3 2.0). )

phoenixy1 avatar Jul 17 '24 07:07 phoenixy1

Just wanted to update that a fix has been pushed, so this is anticipated to be fixed in the next release of the plaid-python client library.

phoenixy1 avatar Jul 18 '24 21:07 phoenixy1

@phoenixy1 amazing! Thank you.

radoshi avatar Jul 18 '24 22:07 radoshi

@phoenixy1 the restriction on urllib3 hasn't been removed from requirements.txt in master. Is that expected to happen also?

emosenkis avatar Aug 07 '24 21:08 emosenkis

@emosenkis yes, it is part of the fix that will be in the next release of the plaid-python client library

phoenixy1 avatar Aug 07 '24 21:08 phoenixy1

Hi @phoenixy1 When is the next release of the library expected?

abeerag avatar Aug 12 '24 23:08 abeerag

@abeerag end of October at the absolute latest, but I think it will probably be released in September.

phoenixy1 avatar Aug 13 '24 05:08 phoenixy1

This should now be fixed with today's release -- there is now no restriction on using newer versions of urllib3 with the plaid-python library. If this doesn't resolve the issue for you, please comment or open a new issue

phoenixy1 avatar Sep 05 '24 22:09 phoenixy1