You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get TypeError: __init__() got an unexpected keyword argument 'retries' after latest update when trying to create an instance through httpx.Client().
Traceback:
>>> client = httpx.Client()
Exception ignored in: <function Client.__del__ at 0x0000029540F5C948>
Traceback (most recent call last):
File "C:\Users\UrbiJ\AppData\Local\Programs\Python\Python37\lib\site-packages\httpx\_client.py", line 1130, in __del__
self.close()
File "C:\Users\UrbiJ\AppData\Local\Programs\Python\Python37\lib\site-packages\httpx\_client.py", line 1102, in close
self._transport.close()
AttributeError: 'Client' object has no attribute '_transport'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\UrbiJ\AppData\Local\Programs\Python\Python37\lib\site-packages\httpx\_client.py", line 608, in __init__
trust_env=trust_env,
File "C:\Users\UrbiJ\AppData\Local\Programs\Python\Python37\lib\site-packages\httpx\_client.py", line 649, in _init_transport
verify=verify, cert=cert, http2=http2, limits=limits, trust_env=trust_env
File "C:\Users\UrbiJ\AppData\Local\Programs\Python\Python37\lib\site-packages\httpx\_transports\default.py", line 67, in __init__
backend=backend,
TypeError: __init__() got an unexpected keyword argument 'retries'
Tbh, I'm Not sure if I updated httpx without the dependency being updated, or if I accidentally installed a previous version of httpcore later... It could also be second option, in that case I must have forgotten to activate the venv of some projects
Activity
johtso commentedon Mar 5, 2021
What's your
httpcoreversion?I'm guessing that somehow you updated
httpxwithout thehttpcoredependency being updated.The
retriesargument was added tohttpcorein version0.12.1, andhttpxenforceshttpcore >= 0.12.1UrbiJr commentedon Mar 5, 2021
yeah indeed that was the problem ! thank you
johtso commentedon Mar 5, 2021
One of the downsides of the separate libraries approach. Out of curiosity, how did you manage to update
httpxwithout the dependency updating?UrbiJr commentedon Mar 5, 2021
Tbh, I'm Not sure if I updated
httpxwithout the dependency being updated, or if I accidentally installed a previous version ofhttpcorelater... It could also be second option, in that case I must have forgotten to activate thevenvof some projectsjohtso commentedon Mar 5, 2021
Ah, that would make sense!
Colin-b commentedon Mar 5, 2021
No that's not on your side, this is a bug in
httpx==17.0.0, resolved by #1495 , not yet released on pypi.johtso commentedon Mar 5, 2021
Whoops! Didn't realise that wasn't in
17.0.0..florimondmanca commentedon Mar 6, 2021
Yup, in 0.17.0 you should have bumped the minimum HTTPCore version to make sure 0.17.0 shipped with versions that has the
retriesoption. :)lovelydinosaur commentedon Mar 12, 2021
My post-match review on this is that we ought to have had an httpcore 0.13.0 release, prior to httpx 0.17.0.
If we're pinning to
>=httpcore minor version numbers, then we've got something (slightly) wrong.Not a big deal, just worth mentioning.
(At this point tho' I think we just want to have a minor httpx release that pins to httpcore >= 0.12.1)
lovelydinosaur commentedon Mar 12, 2021
Slightly related discussion... #1504
[-]httpx.Client() fails on latest release[/-][+]Incompatible with httpcore 0.12.0[/+]