Make using session the default#1566
Conversation
I have no idea why you would not want to use a session by default. If you make more than 1 request in your script you benefit by an order of magnitude on wait to reconnect.
|
@Matthew-Jenkins wrapping into readme. |
|
This looks more like a custom/environmental issue. Likely something is monkey-patched or non-standard in your setup that causes the internally created session object to be GCed, which drops auth state. The proposed “fix” doesn’t actually change anything functionally, both cases are just session=requests.Session(). The only difference is that one is bound weakly inside the class while the other persists in your calling scope, so GC can’t reclaim it between calls. That points to a lifetime/GC issue in your environment rather than a problem in the library. |
|
@Matthew-Jenkins I think needed to review a full solution. |
I have no idea why you would not want to use a session by default. If you make more than 1 request in your script you benefit by an order of magnitude on wait to reconnect.